-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
93 lines (76 loc) · 2.64 KB
/
flake.nix
File metadata and controls
93 lines (76 loc) · 2.64 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
{
description = "Unified NixOS flake — desktop (physshell) & WSL";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-wsl = {
url = "github:nix-community/NixOS-WSL/main";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs@{ self, nixpkgs, home-manager, agenix, nixos-wsl, ... }:
let
system = "x86_64-linux";
lib = nixpkgs.lib;
# Whitelist of allowed unfree packages (used on the desktop host)
unfreeNames = [
"nvidia-x11" "nvidia-settings"
"steam" "steam-unwrapped"
"code" "vscode" "cursor" "microsoft-edge"
];
allowUnfree = pkg: builtins.elem (lib.getName pkg) unfreeNames;
in
{
# ── Desktop (physical machine) ──────────────────────────────
nixosConfigurations.physshell = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit allowUnfree inputs; };
modules = [
./hosts/physshell/configuration.nix
# System-wide allowUnfree predicate
({ ... }: { nixpkgs.config.allowUnfreePredicate = allowUnfree; })
./modules/maintenance.nix
({ ... }: { maintenance.enable = true; })
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.backupFileExtension = "bkp";
home-manager.users.physshell = {
imports = [
agenix.homeManagerModules.default
./hosts/physshell/home.nix
./modules/hm-maintenance.nix
({ ... }: { hmMaintenance.enable = true; })
];
};
}
];
};
# ── WSL ─────────────────────────────────────────────────────
nixosConfigurations.wsl = nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit inputs; };
modules = [
nixos-wsl.nixosModules.default
./hosts/wsl/configuration.nix
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.backupFileExtension = "bkp";
home-manager.users.nixos = {
imports = [
./hosts/wsl/home.nix
];
};
}
];
};
};
}