-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
129 lines (126 loc) · 3.83 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
{
description = "A very stolen nixos configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
inputs.darwin.follows = "darwin";
};
darwin = {
url = "github:lnl7/nix-darwin";
inputs.nixpkgs.follows = "nixpkgs";
};
devshell = {
url = "github:numtide/devshell";
inputs.nixpkgs.follows = "nixpkgs";
};
emacs-overlay = {
url = "github:nix-community/emacs-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
lanzaboote = {
url = "github:nix-community/lanzaboote";
inputs.nixpkgs.follows = "nixpkgs";
};
lix-module = {
url = "https://git.lix.systems/lix-project/nixos-module/archive/main.tar.gz";
inputs.nixpkgs.follows = "nixpkgs";
};
# the flake.nix for mac-app-util seems to imply they want to use their own nixpkgs
mac-app-util.url = "github:hraban/mac-app-util";
madness.url = "github:antithesishq/madness";
nixos-wsl = {
url = "github:nix-community/nixos-wsl/main";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
inputs@{ self, nixpkgs, ... }:
let
inherit (self) outputs;
configureHome = {
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.glitch = import ./modules/home/default.nix;
# TODO: this is a little jank...
sharedModules = commonHomeManagerModules ++ [ (
{ ... }:
{
# TODO: move stateVersion out of the outputs
home.stateVersion = outputs.stateVersion;
}
)
];
extraSpecialArgs = {
inherit inputs outputs;
};
};
};
nixosSystem =
system: name:
nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {
inherit inputs outputs;
};
modules = commonNixosModules ++ [
(
{ ... }:
{
networking.hostName = name;
system.stateVersion = outputs.stateVersion;
home-manager.users.glitch = import ./machines/${name}/home.nix;
}
)
./machines/${name}/nixos.nix
];
};
darwinSystem = name: inputs.darwin.lib.darwinSystem {
system = "aarch64-darwin"; # ill probably never own an intel mac, right...?
specialArgs = {
inherit inputs outputs;
};
modules = commonDarwinModules ++ [
{
home-manager.users.glitch = import ./machines/${name}/home.nix;
}
./machines/${name}/darwin.nix
];
};
commonNixosModules = with inputs; [
agenix.nixosModules.default
home-manager.nixosModules.home-manager configureHome
lanzaboote.nixosModules.lanzaboote
# lix-module.nixosModules.default
madness.nixosModules.madness
./modules/nixos
];
commonDarwinModules = with inputs; [
agenix.darwinModules.default
home-manager.darwinModules.home-manager configureHome
mac-app-util.darwinModules.default
./modules/darwin
];
commonHomeManagerModules = with inputs; [
mac-app-util.homeManagerModules.default
];
in
{
stateVersion = "24.05";
nixosConfigurations = {
lich = nixosSystem "x86_64-linux" "lich";
lich-wsl = nixosSystem "x86_64-linux" "lich-wsl";
};
darwinConfigurations = {
braize = darwinSystem "braize";
};
overlays = [ inputs.emacs-overlay.overlays.default ];
};
}