-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
140 lines (127 loc) · 4.14 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
{
description = "Bazyli's Nix config";
inputs = {
# NixOS dependencies.
nixpkgs = {
url = "github:nixos/nixpkgs/nixos-unstable";
};
nixpkgs-stable = {
url = "github:nixos/nixpkgs/nixos-24.05";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
lanzaboote = {
url = "github:nix-community/lanzaboote/v0.4.1";
inputs.nixpkgs.follows = "nixpkgs";
};
hardware = {
url = "github:nixos/nixos-hardware";
};
nixos-cosmic = {
url = "github:lilyinstarlight/nixos-cosmic";
inputs.nixpkgs.follows = "nixpkgs";
};
grafana-dashboards = {
url = "github:blackheaven/grafana-dashboards.nix";
};
vpn-confinement = {
url = "github:Maroka-chan/VPN-Confinement";
};
# Home Manager dependencies.
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
nix-colors = {
url = "github:misterio77/nix-colors";
};
nix-index-database = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
anyrun = {
url = "github:anyrun-org/anyrun";
inputs.nixpkgs.follows = "nixpkgs";
};
anyrun-powermenu = {
url = "github:bcyran/anyrun-powermenu";
inputs.nixpkgs.follows = "nixpkgs";
};
hyprcursor-phinger = {
url = "github:jappie3/hyprcursor-phinger";
inputs.nixpkgs.follows = "nixpkgs";
};
timewall = {
url = "github:bcyran/timewall";
inputs.nixpkgs.follows = "nixpkgs";
};
# Secret management
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
my-secrets = {
url = "git+ssh://[email protected]/bcyran/nix-secrets.git?ref=main&shallow=1";
flake = false;
};
};
outputs = inputs: let
inherit (inputs.nixpkgs) lib;
# Systems supported by this flake.
systems = ["x86_64-linux"];
# Our custom lib.
myLib = import ./lib {inherit lib;};
in {
# Pakcages exported by this flake. Build using `nix build .#package`.
packages = myLib.forEachSystemPkgs systems inputs.nixpkgs (pkgs: import ./pkgs pkgs);
# We use `alejandra` as a formatter. Format using `nix fmt`.
formatter = myLib.forEachSystemPkgs systems inputs.nixpkgs (pkgs: pkgs.alejandra);
# Overlays exported by this flake. Accessible as `my.overlays`.
overlays = import ./overlays {inherit inputs;};
# Lib exported by this flake. Accessible as `my.lib`.
lib = myLib;
# NixOS modules exported by this flake. Accessible as `my.nixosModules`.
# They don't contain specific machine configurations, but rather generic, reusable modules,
# which can be enabled in specific configurations.
nixosModules = import ./modules/nixos;
# Home Manager modules exported by this flake. Accessible as `my.homeManagerModules`.
# Similarly to `nixosModules`, they contain generic, reusable modules.
homeManagerModules = import ./modules/home-manager;
# NixOS configurations exported by this flake.
# Those configurations mostly just enable selected stuff from `my.nixosModules`.
# Example usage: `nixos-rebuild switch --flake .#slimbook`.
nixosConfigurations = lib.mergeAttrsList [
(myLib.config.mkSystem {
name = "slimbook";
system = "x86_64-linux";
inherit inputs;
my = inputs.self;
})
(myLib.config.mkSystem {
name = "homelab";
system = "x86_64-linux";
inherit inputs;
my = inputs.self;
})
];
# Home Manager configurations exported by this flake.
# Those configurations mostly just enable selected stuff from `my.homeManagerModules`.
# Example usage: `home-manager switch --flake .#bazyli@slimbook`.
homeConfigurations = lib.mergeAttrsList [
(myLib.config.mkHome {
name = "bazyli@slimbook";
system = "x86_64-linux";
inherit inputs;
my = inputs.self;
})
(myLib.config.mkHome {
name = "bazyli@homelab";
system = "x86_64-linux";
inherit inputs;
my = inputs.self;
})
];
};
}