-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
executable file
·93 lines (78 loc) · 2.64 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
{
inputs = {
nixpkgs.url = "github:pongo1231/nixpkgs/mine";
nixpkgs-master.url = "github:nixos/nixpkgs";
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.11";
nixpkgs-desktop-kernel = {
#url = "github:pongo1231/nixpkgs/0e2d2f87f0f61065ee6ccb979a1213691e74dbac";
follows = "nixpkgs";
};
jovian = {
url = "github:pongo1231/Jovian-NixOS";
inputs.nixpkgs.follows = "nixpkgs";
};
#nixpkgs-jupiter-kernel.url = "github:nixos/nixpkgs/0e2d2f87f0f61065ee6ccb979a1213691e74dbac";
nixos-wsl = {
url = "github:nix-community/NixOS-WSL";
inputs.nixpkgs.follows = "nixpkgs";
};
/*chaotic = {
url = "github:chaotic-cx/nyx";
inputs.nixpkgs.follows = "nixpkgs";
};*/
winapps = {
url = "github:winapps-org/winapps";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
inputs: {
nixosConfigurations =
let
specialArgs = {
module = file: modules/${file};
patch = file: patches/${file};
pkg = file: pkgs/${file};
};
commonSystem = { system ? "x86_64-linux", type ? null, hostName, config ? null }:
inputs.nixpkgs.lib.nixosSystem
{
specialArgs = specialArgs // {
inherit system inputs;
};
modules = [
(_: {
nixpkgs.overlays = [
(import ./overlay.nix {
inherit system inputs;
inherit (specialArgs) pkg;
inherit (inputs.nixpkgs) lib;
})
];
nixpkgs = {
hostPlatform. system = system;
#buildPlatform.system = "x86_64-linux";
config.allowUnfree = true;
};
networking = {
inherit hostName;
};
})
./nix.nix
./modules/common
] ++ inputs.nixpkgs.lib.optionals (type != null) [
./modules/${type}
] ++ inputs.nixpkgs.lib.optionals (config != null) [
config
];
};
in
inputs.nixpkgs.lib.mapAttrs
(name: value: commonSystem ((import ./configs/${name}/info.nix) // {
hostName = name;
}
// inputs.nixpkgs.lib.optionalAttrs (builtins.pathExists ./configs/${name}/default.nix) { config = ./configs/${name}; })
)
(builtins.readDir ./configs);
};
}