-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
117 lines (105 loc) · 3.3 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
{
description = "My Nix configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-2405.url = "github:nixos/nixpkgs/nixos-24.05";
nixarr.url = "github:rasmus-kirk/nixarr/dev";
nixarr.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
agenix.url = "github:ryantm/agenix";
agenix.inputs.nixpkgs.follows = "nixpkgs";
agenix.inputs.home-manager.follows = "home-manager";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
};
outputs = inputs @ {
self,
nixpkgs,
agenix,
nixarr,
home-manager,
nixos-hardware,
...
}:
let
# Systems supported
supportedSystems = [
"x86_64-linux" # 64-bit Intel/AMD Linux
"aarch64-linux" # 64-bit ARM Linux
"x86_64-darwin" # 64-bit Intel macOS
"aarch64-darwin" # 64-bit ARM macOS
];
# Helper to provide system-specific attributes
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs { inherit system; };
});
in {
nixosModules = rec {
kirk = import ./modules/nixos;
default = kirk;
};
homeManagerModules = rec {
kirk = import ./modules/home-manager;
default = kirk;
};
devShells = forAllSystems ({ pkgs } : {
default = pkgs.mkShell {
packages = with pkgs; [
alejandra
nixd
];
};
});
packages = forAllSystems ({ pkgs } : {
default = pkgs.callPackage ./docs/mkDocs.nix {inherit inputs;};
});
formatter = forAllSystems ({ pkgs }: pkgs.alejandra);
nixosConfigurations = {
pi = nixpkgs.lib.nixosSystem rec {
system = "aarch64-linux";
modules = [
./configurations/nixos/pi/configuration.nix
agenix.nixosModules.default
nixos-hardware.nixosModules.raspberry-pi-4
self.nixosModules.default
nixarr.nixosModules.default
home-manager.nixosModules.home-manager
{
home-manager.users.user = {
imports = [
./configurations/home-manager/pi/home.nix
self.homeManagerModules.default
];
config.home.packages = [home-manager.packages."${system}".default];
};
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
}
];
specialArgs = {inherit inputs;};
};
};
homeConfigurations = {
work = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
system = "x86_64-linux";
config.allowUnfree = true;
};
modules = [
./configurations/home-manager/work/home.nix
self.homeManagerModules.default
];
};
deck = home-manager.lib.homeManagerConfiguration {
pkgs = import nixpkgs {
system = "x86_64-linux";
config.allowUnfree = true;
};
modules = [
./configurations/home-manager/deck/home.nix
self.homeManagerModules.default
];
};
};
};
}