-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
119 lines (107 loc) · 3.36 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-master.url = "github:nixos/nixpkgs/master";
lanzaboote.url = "github:nix-community/lanzaboote";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
cachix-deploy.url = "github:cachix/cachix-deploy-flake";
deploy-rs.url = "github:serokell/deploy-rs";
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix.url = "github:Mic92/sops-nix";
home-manager = {
url = "github:nix-community/home-manager/release-24.11";
# The `follows` keyword in inputs is used for inheritance.
# Here, `inputs.nixpkgs` of home-manager is kept consistent with
# the `inputs.nixpkgs` of the current flake,
# to avoid problems caused by different versions of nixpkgs.
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
};
outputs =
{
self,
nixpkgs,
nix-formatter-pack,
deploy-rs,
...
}@inputs:
let
inherit (self) outputs;
system = "x86_64-linux";
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
stateVersion = "23.11";
libx = import ./lib { inherit inputs outputs stateVersion; };
in
{
homeConfigurations = {
"yohan@laptop-nix" = libx.mkHome {
hostname = "laptop-nix";
username = "yohan";
desktop = "kde";
};
"yohan@surface-nix" = libx.mkHome {
hostname = "surface-nix";
username = "yohan";
desktop = "gnome";
};
};
nixosConfigurations = {
"laptop-nix" = libx.mkHost {
hostname = "laptop-nix";
username = "yohan";
desktop = "kde";
};
"surface-nix" = libx.mkHost {
hostname = "surface-nix";
username = "yohan";
desktop = "gnome";
};
"tiny1" = libx.mkHost {
hostname = "tiny1";
username = "nix";
};
"tiny2" = libx.mkHost {
hostname = "tiny2";
username = "nix";
};
"ocr1" = libx.mkHost {
hostname = "ocr1";
username = "nix";
};
"rp" = libx.mkHost {
hostname = "rp";
username = "nix";
};
};
packages.${system} = {
hosts = {
tiny1 = self.nixosConfigurations."tiny1".config.system.build.toplevel;
ocr1 = self.nixosConfigurations."ocr1".config.system.build.toplevel;
tiny2 = self.nixosConfigurations."tiny2".config.system.build.toplevel;
};
#rp = self.nixosConfigurations."rp".config.system.build.toplevel;
};
packages.aarch64-linux = {
hosts = {
ocr1 = self.nixosConfigurations."ocr1".config.system.build.toplevel;
};
};
deploy.nodes = {
surface-nix = {
hostname = "surface-nix";
profiles.system = {
user = "root";
sshUser = "yohan";
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.surface-nix;
};
};
};
formatter.${system} = nixpkgs.legacyPackages.${system}.nixfmt-rfc-style;
overlays = import ./overlays { inherit inputs; };
};
}