/
flake.nix
67 lines (65 loc) · 1.97 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
{
description = "My nixos config";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
unstable-pkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
nur = {
url = "github:nix-community/NUR/master";
};
sops = {
url = "github:Mic92/sops-nix/master";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager/release-23.11";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, sops, nur, home-manager, nixos-hardware, ... }@inputs:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
nixosMachine = configFile: nixpkgs.lib.nixosSystem rec {
inherit system;
specialArgs = {
inherit inputs;
unstable = import inputs.unstable-pkgs { inherit system; config.allowUnfree = true; };
};
modules = [
home-manager.nixosModules.home-manager
sops.nixosModules.sops
nur.nixosModules.nur
"${./.}/machines/${configFile}.nix"
{
options = {
usedFlake = pkgs.lib.mkOption {
type = pkgs.lib.types.str;
default = "${configFile}";
};
};
}
];
};
in
{
devShells."${system}".default = pkgs.mkShell {
packages = [
pkgs.sops
pkgs.age
];
SOPS_AGE_KEY_FILE = "/home/xadet/nixos-configuration/keys/ageKey.txt";
};
installIso = (nixpkgs.lib.nixosSystem rec {
inherit system;
modules = [
"${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
./install/iso.nix
];
}).config.system.build.isoImage;
nixosConfigurations = builtins.foldl' (set: name: set // { "${name}" = nixosMachine "${name}"; }) { } [
"desktop-home"
"eove"
];
};
}