-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
170 lines (149 loc) · 4.76 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
159
160
161
162
163
164
165
166
167
168
169
170
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
nixpkgs05.url = "github:NixOS/nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
# darwin stuff
# darwin.url = "github:LnL7/nix-darwin";
darwin.url = "github:szethh/nix-darwin/dock-persistent-others";
darwin.inputs.nixpkgs.follows = "nixpkgs";
# nixvirt = {
# url = "github:AshleyYakeley/NixVirt/nixpkgs-24.05";
# inputs.nixpkgs.follows = "nixpkgs";
# };
nixvirt = {
url = "https://flakehub.com/f/AshleyYakeley/NixVirt/*.tar.gz";
# url = "git+file:///Users/szeth/dev/forks/NixVirt?ref=master";
inputs.nixpkgs.follows = "nixpkgs";
};
# ghostscript-fix = {
# url = "github:carlocab/nixpkgs/fix-ghostscript";
# };
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
firefox-addons = {
url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
disko = {
# url = "github:nix-community/disko";
url = "git+file:///Users/szeth/dev/forks/disko?ref=fix-mdadm-symlink";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
nixpkgs,
nixpkgs05,
nixpkgs-unstable,
sops-nix,
home-manager,
darwin,
disko,
# ghostscript-fix,
...
}@inputs:
let
systemLinux = "x86_64-linux";
systemDarwin = "x86_64-darwin";
pkgsLinux = import nixpkgs {
system = systemLinux;
overlays = [ (import ./packages/caddy_plugins.nix) ];
};
pkgsLinuxUnstable = import nixpkgs-unstable {
system = systemLinux;
# overlays = [ (import ./packages/caddy_plugins.nix) ];
};
# the overlays are applied in darwin.nix
pkgsDarwin = import nixpkgs { system = systemDarwin; };
pkgsDarwin05 = import nixpkgs05 { system = systemDarwin; };
pkgsDarwinUnstable = import nixpkgs-unstable { system = systemDarwin; };
in
{
# nix develop
devShells.${systemDarwin}.default = pkgsDarwinUnstable.mkShell {
buildInputs = with pkgsDarwinUnstable; [
colmena
sops
];
# ++ [ pkgsDarwin05.colmena ];
# for some reason sops tries to look for the key in ~/Application Support/sops/age/keys.txt
# https://github.com/getsops/sops/issues/983
shellHook = ''
# $SHELL
zsh
export SOPS_AGE_KEY_FILE=~/.config/sops/age/keys.txt
'';
};
# nix darwin
darwinConfigurations = {
mackie = darwin.lib.darwinSystem {
system = systemDarwin;
# specialArgs = {
# inherit ghostscript-fix;
# };
modules = [
./darwin
# i cannot figure this out
# but it could be useful for building stuff locally on macos instead of on the remote host
# (import ./darwin/darwin-linux-builder.nix {
# inherit nixpkgs;
# pkgs = pkgsDarwin;
# system = systemLinux;
# })
home-manager.darwinModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.szeth = import ./home.nix;
home-manager.backupFileExtension = "nix.bak";
# Optionally, use home-manager.extraSpecialArgs to pass
# arguments to home.nix
home-manager.extraSpecialArgs = {
inherit inputs;
};
}
];
};
};
## BOOTSTRAP ##
nixosConfigurations.htz = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
modules = [
disko.nixosModules.disko
./hosts/htz/bootstrap.nix
];
};
# colmena stuff
colmena = {
meta = {
nixpkgs = pkgsLinux;
# nodeNixpkgs = {
# nixvm = pkgsLinuxUnstable; # these two need to be the same, since we are building the same package and the hash needs to be the same
# };
specialArgs = {
inherit inputs;
pkgsStable = pkgsLinux;
pkgsUnstable = pkgsLinuxUnstable;
};
};
defaults = {
imports = [
sops-nix.nixosModules.sops
disko.nixosModules.disko
];
};
nixie = import ./hosts/nixie;
htz = import ./hosts/htz;
nixvm = import ./hosts/nixvm;
flat = import ./hosts/flat;
# (inputs // { pkgs-unstable = pkgsLinuxUnstable; });
};
};
}