-
Notifications
You must be signed in to change notification settings - Fork 7
/
nixos.nix
64 lines (62 loc) · 1.97 KB
/
nixos.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
# This function creates a NixOS system based on our VM setup for a
# particular architecture.
{ inputs, nixpkgs, home-manager, user, machine }:
let
pkgs-unstable = import inputs.nixpkgs-unstable { system = machine.system; config.allowUnfree = true; };
pkgs-caddy = import inputs.nixpkgs-caddy { system = machine.system; };
in
nixpkgs.lib.nixosSystem rec {
system = machine.system;
# NixOS level modules
modules = [
./hardware/${machine.name}.nix
./machines/${machine.name}.nix
./modules/users.nix
./modules/zsh.nix
./modules/nix.nix
./modules/environment.nix
./modules/system-packages.nix
./modules/docker.nix
./modules/code-server.nix
./modules/tailscale.nix
./modules/caddy.nix
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
backupFileExtension = "backup";
users.${user.name} = {
# Home-manager level modules
imports = [
{ home.stateVersion = machine.homeStateVersion; }
./home-modules/bat.nix
./home-modules/direnv.nix
./home-modules/git.nix
./home-modules/helix.nix
./home-modules/lazygit.nix
./home-modules/tmux.nix
./home-modules/yazi.nix
./home-modules/zellij.nix
./home-modules/zoxide.nix
./home-modules/zsh.nix
# ./home-modules/emacs.nix
# ./home-modules/nushell/nushell.nix
];
};
# Arguments that are exposed to every `home-module`.
extraSpecialArgs = {
theme = builtins.readFile ./THEME.txt; # "dark" or "light"
inherit inputs pkgs-unstable user machine;
};
};
}
{
config._module.args = {
inherit inputs pkgs-unstable user machine pkgs-caddy;
};
}
] ++ nixpkgs.lib.optionals (machine.name == "raspberry-pi") [
inputs.raspberry-pi-nix.nixosModules.raspberry-pi
];
}