-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
135 lines (116 loc) · 4.21 KB
/
flake.nix
File metadata and controls
135 lines (116 loc) · 4.21 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
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
129
130
131
132
133
134
135
{
description = "A shrimple NixOS flake";
inputs = {
nix-minecraft.url = "github:a-usr/nix-minecraft/overlayfs";
nix-minecraft.inputs.nixpkgs.follows = "nixpkgs";
mnw.url = "github:Gerg-L/mnw";
# NixOS official package source, using the nixos-24.05 branch here
# nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
trunk.url = "github:NixOS/nixpkgs"; # Do I even use this anymore
lanzaboote = {
url = "github:nix-community/lanzaboote/v1.0.0";
# Optional but recommended to limit the size of your system closure.
inputs.nixpkgs.follows = "nixpkgs";
};
niqspkgs.url = "github:diniamo/niqspkgs";
nixGaming.url = "github:fufexan/nix-gaming";
noctalia.url = "github:noctalia-dev/noctalia-shell/v4.0.0";
noctalia.inputs.nixpkgs.follows = "nixpkgs";
hyprland.url = "github:hyprwm/hyprland/v0.51.0";
hyprlock.url = "github:hyprwm/Hyprlock";
hyprlock.inputs.nixpkgs.follows = "nixpkgs";
hy3 = {
type = "github";
owner = "outfoxxed";
repo = "Hy3"; # where {version} is the hyprland release version
ref = "hl0.51.0";
inputs.hyprland.follows = "hyprland";
};
hyprpaper.url = "github:hyprwm/hyprpaper";
hyprpicker.url = "github:hyprwm/hyprpicker";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
hjem = {
url = "github:feel-co/hjem";
# You may want hjem to use your defined nixpkgs input to
# minimize redundancies.
inputs.nixpkgs.follows = "nixpkgs";
};
zen-browser = {
url = "github:0xc000022070/zen-browser-flake";
# IMPORTANT: we're using "libgbm" and is only available in unstable so ensure
# to have it up-to-date or simply don't specify the nixpkgs input
inputs.nixpkgs.follows = "nixpkgs";
};
stash.url = "github:notashelf/stash";
stash.inputs.nixpkgs.follows = "nixpkgs";
hjem-rum = {
url = "github:snugnug/hjem-rum";
# You may want hjem-rum to use your defined nixpkgs input to
# minimize redundancies.
inputs.nixpkgs.follows = "nixpkgs";
# Same goes for hjem, to avoid discrepancies between the version
# you use directly and the one hjem-rum uses.
inputs.hjem.follows = "hjem";
};
};
outputs =
inputs:
let
lib = import ./lib;
allModules = import ./modules { inherit lib; };
mkNixosConfig'' =
args:
lib.mkTopLevel inputs inputs.nixpkgs.lib.nixosSystem {
modules = allModules.nixosModules ++ args.modules;
}
// removeAttrs args [ "modules" ];
mkNixosConfig' =
host: extraModule:
mkNixosConfig'' {
modules = (lib.getModulesFromDir (./hosts + "/${host}/cms")) ++ [
{
_file = "Native Module Imports";
nativeModule.imports = lib.getModulesFromDir (./hosts + "/${host}/native") ++ [
{ networking.hostName = host; }
];
}
extraModule
];
};
mkNixosConfig = host: mkNixosConfig' host { };
mkNixosContainer = host: mkNixosConfig' host { nativeModule.boot.isNspawnContainer = true; };
mkPseudoConfig =
host:
mkPseudoConfig' {
modules = (lib.getModulesFromDir (./hosts + "/${host}/cms")) ++ [
{
_file = "Native Module Imports";
nativeModule.imports = lib.getModulesFromDir (./hosts + "/${host}/native");
}
];
};
mkPseudoConfig' = # for debugging
{
modules ? [ ],
}@args:
lib.mkTopLevel inputs (args: args) {
modules = allModules.nixosModules ++ modules;
}
// removeAttrs args [ "modules" ];
in
{
inherit lib inputs allModules;
nixpkgsLib = inputs.nixpkgs.lib;
nixosConfigurations = {
#lib = import ./overlays/lib.nix inputs;
ssd = import ./hosts/ssd inputs;
silenos = mkNixosConfig "silenos";
tiresias = mkNixosConfig "tiresias";
tiresias_c = mkNixosContainer "tiresias";
};
pseudo = mkPseudoConfig' { };
pseudo_host = mkPseudoConfig "tiresias";
};
}