-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathflake.nix
More file actions
75 lines (74 loc) · 3.03 KB
/
Copy pathflake.nix
File metadata and controls
75 lines (74 loc) · 3.03 KB
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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nix-inspect.url = "github:bluskript/nix-inspect";
nixos-wsl.url = "github:nix-community/NixOS-WSL";
deploy-rs.url = "github:serokell/deploy-rs";
vscode-server.url = "github:nix-community/nixos-vscode-server";
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
comin = {
url = "github:nlewo/comin";
inputs.nixpkgs.follows = "nixpkgs";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager/release-26.05";
inputs.nixpkgs.follows = "nixpkgs";
};
ip-whitelist = {
url = "github:Mafyuh/nixos-ip-whitelist-firewall";
};
};
outputs =
{ self, nixpkgs, ... }@inputs:
let
systems = [ "x86_64-linux" "aarch64-linux" ];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system});
nixosConfig = { modules ? [] }: nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs;
pkgs-unstable = import inputs.nixpkgs-unstable {
system = "x86_64-linux";
config.allowUnfree = true;
};
};
modules = [ ./common/default.nix inputs.sops-nix.nixosModules.sops ] ++ modules;
};
wslConfig = { modules ? [] }: nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [ ./common/nix.nix ./common/packages.nix ./common/users.nix inputs.home-manager.nixosModules.home-manager ] ++ modules;
};
in {
nixosConfigurations = {
template = nixosConfig { modules = [ inputs.comin.nixosModules.comin inputs.disko.nixosModules.disko inputs.home-manager.nixosModules.home-manager ./hosts/template/disk-config.nix ./hosts/template/default.nix ]; };
laptop = nixosConfig { modules = [ inputs.comin.nixosModules.comin inputs.disko.nixosModules.disko inputs.home-manager.nixosModules.home-manager ./hosts/laptop/disk-config.nix ./hosts/laptop/default.nix ]; };
racknerd-vps = nixosConfig { modules = [ inputs.comin.nixosModules.comin inputs.disko.nixosModules.disko inputs.home-manager.nixosModules.home-manager inputs.ip-whitelist.nixosModules.default ./hosts/racknerd-vps/disk-config.nix ./hosts/racknerd-vps/default.nix ]; };
wsl = wslConfig { modules = [ inputs.comin.nixosModules.comin ./hosts/wsl/default.nix ]; };
};
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
packages = [
pkgs.nix-inspect
pkgs.deploy-rs
pkgs.nvd
pkgs.nix-output-monitor
pkgs.sops
pkgs.age
pkgs.ssh-to-age
];
shellHook = ''
echo "Nix Development Environment"
'';
};
});
} // import ./deploy.nix { inherit self inputs; };
}