-
Notifications
You must be signed in to change notification settings - Fork 13
/
flake.nix
122 lines (107 loc) · 3.2 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
{
description = "jnsgruk's nixos configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
master.url = "github:nixos/nixpkgs/master";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
agenix.url = "github:ryantm/agenix";
agenix.inputs.nixpkgs.follows = "nixpkgs";
catppuccin.url = "github:catppuccin/nix";
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
flypi.url = "github:jnsgruk/flypi";
home-manager.url = "github:nix-community/home-manager/release-24.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
lanzaboote.url = "github:nix-community/lanzaboote";
lanzaboote.inputs.nixpkgs.follows = "nixpkgs";
libations.url = "github:jnsgruk/libations";
libations.inputs.nixpkgs.follows = "nixpkgs";
vscode-server.url = "github:nix-community/nixos-vscode-server";
vscode-server.inputs.nixpkgs.follows = "nixpkgs";
};
outputs =
{
self,
nixpkgs,
unstable,
...
}@inputs:
let
inherit (self) outputs;
stateVersion = "24.11";
username = "jon";
libx = import ./lib {
inherit
self
inputs
outputs
stateVersion
username
;
};
in
{
# nix build .#homeConfigurations."jon@freyja".activationPackage
homeConfigurations = {
# Desktop machines
"${username}@freyja" = libx.mkHome {
hostname = "freyja";
desktop = "hyprland";
};
"${username}@kara" = libx.mkHome {
hostname = "kara";
desktop = "hyprland";
};
# Headless machines
"${username}@thor" = libx.mkHome { hostname = "thor"; };
"${username}@volnir" = libx.mkHome {
hostname = "volnir";
system = "aarch64-linux";
};
"ubuntu@dev" = libx.mkHome {
hostname = "dev";
user = "ubuntu";
};
};
# nix build .#nixosConfigurations.freyja.config.system.build.toplevel
nixosConfigurations = {
# Desktop machines
freyja = libx.mkHost {
hostname = "freyja";
desktop = "hyprland";
};
kara = libx.mkHost {
hostname = "kara";
desktop = "hyprland";
};
# Headless machines
thor = libx.mkHost {
hostname = "thor";
};
volnir = libx.mkHost {
hostname = "volnir";
};
};
# Custom packages; acessible via 'nix build', 'nix shell', etc
packages = libx.forAllSystems (
system:
let
pkgs = unstable.legacyPackages.${system};
in
import ./pkgs { inherit pkgs; }
);
# Custom overlays
overlays = import ./overlays { inherit inputs; };
# Devshell for bootstrapping
# Accessible via 'nix develop' or 'nix-shell' (legacy)
devShells = libx.forAllSystems (
system:
let
pkgs = unstable.legacyPackages.${system};
in
import ./shell.nix { inherit pkgs; }
);
formatter = libx.forAllSystems (system: self.packages.${system}.nixfmt-plus);
};
}