-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathflake.nix
158 lines (139 loc) · 4.08 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
{
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";
website-builder.url = "github:rasmus-kirk/website-builder";
website-builder.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs @ {
self,
nixpkgs,
agenix,
nixarr,
home-manager,
nixos-hardware,
website-builder,
...
}: 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.default = import ./modules/nixos;
homeManagerModules.default = {
imports = [./modules/home-manager];
config._module.args = {inherit inputs;};
};
devShells = forAllSystems ({pkgs}: {
default = pkgs.mkShell {
packages = with pkgs; [
alejandra
nixd
];
};
});
packages = forAllSystems ({pkgs}: let
website = website-builder.lib {
pkgs = pkgs;
src = ./.;
headerTitle = "Rasmus Kirk";
standalonePages = [
{
inputFile = ./docs/index.md;
title = "Kirk Modules - Option Documentation";
}
];
navbar = [
{
title = "Home";
location = "/";
}
{
title = "Nixos";
location = "/nixos-options";
}
{
title = "Home Manager";
location = "/home-manager-options";
}
{
title = "Github";
location = "https://github.com/rasmus-kirk/nix-config";
}
];
homemanagerModules = ./modules/home-manager;
nixosModules = ./modules/nixos;
};
in {
default = website.package;
debug = website.loop;
});
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
];
};
};
};
}