-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
172 lines (153 loc) · 5.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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
{
description = "deej81's Nix-Config";
inputs = {
#################### Official NixOS and HM Package Sources ####################
nixpkgs.url = "github:NixOS/nixpkgs/release-24.11";
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; # also see 'unstable-packages' overlay at 'overlays/default.nix"
hardware.url = "github:nixos/nixos-hardware";
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
#################### Utilities ####################
# Declarative partitioning and formatting
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
# Secrets management. See ./docs/secretsmgmt.md
sops-nix = {
url = "github:mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
# vim4LMFQR!
nixvim = {
url = "github:nix-community/nixvim/nixos-24.11";
inputs.nixpkgs.follows = "nixpkgs";
};
# Windows management
# for now trying to avoid this one because I want stability for my wm
# this is the hyprland development flake package / unstable
# hyprland = {
# url = "github:hyprwm/hyprland";
# inputs.nixpkgs.follows = "nixpkgs";
# };
# hyprland-plugins = {
# url = "github:hyprwm/hyprland-plugins";
# inputs.hyprland.follows = "hyprland";
# };
#################### Personal Repositories ####################
# Private secrets repo. See ./docs/secretsmgmt.md
# Authenticate via ssh and use shallow clone
# nix-secrets = {
# url = "git+ssh://[email protected]/emergentmind/nix-secrets.git?ref=main&shallow=1";
# flake = false;
# };
};
outputs = { self, nixpkgs, home-manager, disko, ... } @ inputs:
let
inherit (self) outputs;
forAllSystems = nixpkgs.lib.genAttrs [
"x86_64-linux"
#"aarch64-darwin"
];
inherit (nixpkgs) lib;
configVars = import ./vars { inherit inputs lib; };
configLib = import ./lib { inherit lib; };
specialArgs = { inherit inputs outputs configVars configLib nixpkgs; };
in
{
# Custom modules to enable special functionality for nixos or home-manager oriented configs.
nixosModules = import ./modules/nixos;
homeManagerModules = import ./modules/home-manager;
# Custom modifications/overrides to upstream packages.
overlays = import ./overlays { inherit inputs outputs; };
# Custom packages to be shared or upstreamed.
packages = forAllSystems
(system:
let pkgs = nixpkgs.legacyPackages.${system};
in import ./pkgs { inherit pkgs; }
);
# Nix formatter available through 'nix fmt' https://nix-community.github.io/nixpkgs-fmt
formatter = forAllSystems
(system:
nixpkgs.legacyPackages.${system}.nixpkgs-fmt
);
# Shell configured with packages that are typically only needed when working on or with nix-config.
devShells = forAllSystems
(system:
let pkgs = nixpkgs.legacyPackages.${system};
in import ./shell.nix { inherit pkgs; }
);
#################### NixOS Configurations ####################
#
# Building configurations available through `just rebuild` or `nixos-rebuild --flake .#hostname`
nixosConfigurations = {
# devlab
cheryl = lib.nixosSystem {
inherit specialArgs;
modules = [
home-manager.nixosModules.home-manager
{
home-manager.extraSpecialArgs = specialArgs;
}
./hosts/cheryl
];
};
mini790 = lib.nixosSystem {
inherit specialArgs;
modules = [
home-manager.nixosModules.home-manager
{
home-manager.extraSpecialArgs = specialArgs;
}
./hosts/mini790
];
};
nyx = lib.nixosSystem {
inherit specialArgs;
modules = [
home-manager.nixosModules.home-manager
{
home-manager.extraSpecialArgs = specialArgs;
}
disko.nixosModules.disko
{
disko.devices.disk.main.device = "/dev/nvme0n1";
}
./hosts/nyx
];
};
bjorn = lib.nixosSystem {
inherit specialArgs;
modules = [
home-manager.nixosModules.home-manager
{
home-manager.extraSpecialArgs = specialArgs;
}
./hosts/bjorn
];
};
framework13 = lib.nixosSystem {
inherit specialArgs;
modules = [
home-manager.nixosModules.home-manager
{
home-manager.extraSpecialArgs = specialArgs;
}
disko.nixosModules.disko
{
disko.devices.disk.main.device = "/dev/nvme0n1";
}
./hosts/framework13
];
};
installerISO = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
modules = [
./custom-iso.nix
];
};
};
};
}