-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
118 lines (105 loc) · 3.05 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
{
description = "My NixOS configuration";
inputs = {
# Nix ecosystem
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
url = "github:mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-gl = {
url = "github:nix-community/nixgl";
inputs.nixpkgs.follows = "nixpkgs";
};
systems.url = "github:nix-systems/default-linux";
hardware.url = "github:nixos/nixos-hardware";
# Third party programs, packaged with nix
firefox-addons.url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
nixvim.url = "github:nix-community/nixvim/nixos-24.11";
nix-colors.url = "github:misterio77/nix-colors";
};
outputs = {
self,
nixpkgs,
home-manager,
systems,
...
} @ inputs: let
inherit (self) outputs;
lib = nixpkgs.lib // home-manager.lib;
forEachSystem = f: lib.genAttrs (import systems) (system: f pkgsFor.${system});
pkgsFor = lib.genAttrs (import systems) (
system:
import nixpkgs {
inherit system;
config.allowUnfree = true;
}
);
in {
inherit lib;
nixosModules = import ./modules/nixos;
homeManagerModules = import ./modules/home-manager;
overlays = import ./overlays {inherit inputs outputs;};
hydraJobs = import ./hydra.nix {inherit inputs outputs;};
packages = forEachSystem (pkgs: import ./pkgs {inherit pkgs;});
devShells = forEachSystem (pkgs: import ./shell.nix {inherit pkgs;});
formatter = forEachSystem (pkgs: pkgs.alejandra);
# Host configurations
nixosConfigurations = {
framework = lib.nixosSystem {
modules = [
./hosts/framework
];
specialArgs = {
inherit inputs outputs;
};
};
};
nixosConfigurations = {
homelab = lib.nixosSystem {
modules = [
./hosts/homelab
];
specialArgs = {
inherit inputs outputs;
};
};
};
# Home configurations
homeConfigurations = {
"om@framework" = lib.homeManagerConfiguration {
modules = [
./home/om/framework.nix
./home/om/nixpkgs.nix
inputs.sops-nix.homeManagerModules.sops
inputs.nix-colors.homeManagerModules.default
];
pkgs = pkgsFor.x86_64-linux;
extraSpecialArgs = {
inherit inputs outputs;
colors = inputs.nix-colors;
};
};
};
homeConfigurations = {
"om@homelab" = lib.homeManagerConfiguration {
modules = [
./home/om/homelab.nix
./home/om/nixpkgs.nix
inputs.sops-nix.homeManagerModules.sops
inputs.nix-colors.homeManagerModules.default
];
pkgs = pkgsFor.x86_64-linux;
extraSpecialArgs = {
inherit inputs outputs;
colors = inputs.nix-colors;
};
};
};
};
}