-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
130 lines (127 loc) · 3.85 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
{
description = "Dovs nixos configs";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixos-hardware.url = github:NixOS/nixos-hardware/master;
home-manager.url = "github:nix-community/home-manager/release-24.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
emacs-overlay.url = "github:nix-community/emacs-overlay/master";
nix-matlab.url = "gitlab:doronbehar/nix-matlab";
sops-nix.url = github:Mic92/sops-nix;
};
outputs = inputs@{ self, home-manager, nixpkgs, unstable, nixos-hardware, emacs-overlay, nix-matlab, sops-nix, ... }:
let
system = "x86_64-linux";
pkgs =
import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [
(import ./overlays { unstable = unstable; })
emacs-overlay.overlay
nix-matlab.overlay
];
};
defaultNixOptions = {
nix.settings.auto-optimise-store = true;
};
mkComputer = configurationNix: userName: extraModules: extraHomeModules: inputs.nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit system inputs pkgs nixos-hardware; };
modules = [
#Secrets management
sops-nix.nixosModules.sops
#Machine config
configurationNix
defaultNixOptions
#User config
(./. + "/users/${userName}")
#Home manager
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users."${userName}" = {
imports = [ (./. + "/users/${userName}/home.nix") ] ++ extraHomeModules;
};
}
] ++ extraModules;
};
in
{
nixosConfigurations = {
nixosvm = mkComputer
./machines/nixosvm #machine specific configuration
"dovalperin" #default user
[
./modules/gnome
./modules/tailscale
./modules/ssh
] #modules to load
[
./modules/zsh
]; #modules to be loaded by home-manager
DovDev = mkComputer
./machines/DovDev #machine specific configuration
"dovalperin" #default user
[
./modules/xserver
./modules/gnome
./modules/tailscale
./modules/ssh
./modules/zoom
./modules/browsers
./modules/postgresql
./modules/redis
] #modules to load
[
./modules/zsh
./modules/emacs
]; #modules to be loaded by home-manager
ascent = mkComputer
./machines/ascent
"worker"
[
./modules/ssh
./modules/tailscale
./modules/matrix
]
[ ];
humblegeoffrey = mkComputer
./machines/humblegeoffrey
"dovalperin"
[
./modules/xserver
./modules/gnome
./modules/ssh
./modules/browsers
./modules/postgresql
./modules/redis
./modules/tailscale
./modules/zoom
] #modules to load
[
./modules/zsh
./modules/emacs
]; #modules to be loaded by home-manager
spaceship = mkComputer
./machines/spaceship
"dovalperin"
[
./modules/xserver
./modules/gnome
./modules/ssh
./modules/browsers
./modules/postgresql
./modules/redis
./modules/tailscale
./modules/zoom
] #modules to load
[
./modules/zsh
./modules/emacs
]; #modules to be loaded by home-manager
};
};
}