-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
142 lines (135 loc) · 3.69 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
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
136
137
138
139
140
141
142
{
description = "Samos's Flake";
inputs = {
# Overlays
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
home-manager = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland = {
type = "git";
url = "https://github.com/hyprwm/Hyprland.git";
rev = "3b99e906df8b439d65e740301940e57efc057012";
submodules = true;
# url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
};
stylix = {
url = "github:danth/stylix";
inputs.nixpkgs.follows = "nixpkgs";
};
anyrun = {
url = "github:Kirottu/anyrun";
inputs.nixpkgs.follows = "nixpkgs";
};
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
};
wezterm = {
url = "github:wez/wezterm?dir=nix";
inputs.nixpkgs.follows = "nixpkgs";
};
spicetify-nix = {
url = "github:Gerg-L/spicetify-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-gaming = {
url = "github:fufexan/nix-gaming";
inputs.nixpkgs.follows = "nixpkgs";
};
nixvim.url = "github:samos667/nivis";
adblock-unbound = {
url = "github:MayNiklas/nixos-adblock-unbound";
inputs = {
adblockStevenBlack.follows = "adblockStevenBlack";
};
};
# Adblocking lists for DNS servers
# input here, so it will get updated by nix flake update
adblockStevenBlack = {
url = "github:StevenBlack/hosts";
flake = false;
};
};
outputs = {
self,
nixpkgs,
home-manager,
agenix,
stylix,
...
} @ inputs: let
supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
nixpkgsFor = forAllSystems (system: import nixpkgs {inherit system;});
createNixosConfiguration = {
system,
username,
homeDirectory,
vars,
hostname ? null,
modules ? [],
includeHomeManager ? true,
}:
nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = {inherit inputs username homeDirectory hostname system vars;};
modules =
[
./hosts/${hostname}
{networking.hostName = hostname;}
]
++ (
if includeHomeManager
then [
home-manager.nixosModules.home-manager
{
home-manager = {
useUserPackages = true;
useGlobalPkgs = false;
extraSpecialArgs = {inherit inputs username homeDirectory hostname system vars;};
users.${username} = import ./home/${hostname}/home.nix {
inherit inputs username homeDirectory;
pkgs = nixpkgsFor.${system};
};
backupFileExtension = "oldd";
};
}
]
else []
)
++ modules;
};
in {
nixosConfigurations = {
masterace = createNixosConfiguration {
system = "x86_64-linux";
username = "sam";
homeDirectory = "/home/sam";
hostname = "masterace";
vars = {
cpu = "intel";
gpu = "amd";
de = "rational_pulsion";
};
modules = [
stylix.nixosModules.stylix
agenix.nixosModules.default
];
};
loulou = createNixosConfiguration {
system = "aarch64-linux";
username = "sam";
homeDirectory = "/home/sam";
hostname = "loulou";
vars = {
soc = "nanopi5";
};
modules = [
# agenix.nixosModules.default
];
};
};
};
}