-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
106 lines (100 loc) · 3.17 KB
/
Copy pathflake.nix
File metadata and controls
106 lines (100 loc) · 3.17 KB
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
{
description = "Llamas NixOS Configuration - Dendritic Pattern";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
flake-parts.url = "github:hercules-ci/flake-parts";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
determinate.url = "https://flakehub.com/f/DeterminateSystems/determinate/*";
};
outputs =
inputs@{
self,
nixpkgs,
flake-parts,
home-manager,
determinate,
...
}:
let
lib = nixpkgs.lib;
# Auto-discover all dendritic modules
discovered = import ./tree/discover.nix { inherit lib; };
homeModules = discovered.homeModules;
nixosModules = discovered.nixosModules;
# Helper: get packages for a system
pkgsFor =
system:
import nixpkgs {
inherit system;
config.allowUnfree = true;
};
in
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
flake = {
inherit homeModules nixosModules;
nixosConfigurations = {
razorback = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
determinate.nixosModules.default
./tree/hosts/razorback/configuration.nix
inputs.nixos-hardware.nixosModules.framework-16-7040-amd
{ imports = lib.attrValues nixosModules; }
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.nciechanowski.imports = lib.attrValues homeModules ++ [
./tree/hosts/razorback/users/nciechanowski.nix
];
}
];
};
VSVR-20-NixOS = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
determinate.nixosModules.default
./tree/hosts/VSVR-20-NixOS/configuration.nix
{ imports = lib.attrValues nixosModules; }
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.VSVR-20-NixOS.imports = lib.attrValues homeModules ++ [
./tree/hosts/VSVR-20-NixOS/users/VSVR-20-NixOS.nix
];
}
];
};
};
homeConfigurations = lib.listToAttrs (
map
(system: {
name = "vagrant-${system}";
value = home-manager.lib.homeManagerConfiguration {
pkgs = pkgsFor system;
modules = [
{ imports = lib.attrValues homeModules; }
./tree/hosts/vagrant/home.nix
];
};
})
[
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
]
);
};
};
}