-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
120 lines (108 loc) · 3.99 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
{
description = "NixOS configuration for Dustin Krysak";
inputs = {
nixpkgs = { url = "github:nixos/nixpkgs/nixos-24.05"; };
nixpkgs-unstable = { url = "github:nixos/nixpkgs/nixos-unstable"; };
nixos-hardware = { url = "github:NixOS/nixos-hardware/master"; };
nix-flatpak = { url = "github:gmodena/nix-flatpak"; };
nvim = { url = "github:bashfulrobot/jvim"; };
hyprland = { url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; };
hyprland-plugins = {
url = "github:hyprwm/hyprland-plugins";
inputs.hyprland.follows = "hyprland";
};
hyprswitch.url = "github:h3rmt/hyprswitch/release?tag=v2.1.4";
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
plasma-manager = {
url = "github:nix-community/plasma-manager";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
nixvim = {
url = "github:nix-community/nixvim/nixos-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
zen-browser.url = "github:0xc000022070/zen-browser-flake";
nixpkgs-zoom.url =
"github:NixOS/nixpkgs/06031e8a5d9d5293c725a50acf01242193635022";
nur.url = "github:nix-community/NUR";
catppuccin.url = "github:catppuccin/nix";
};
outputs = inputs@{ self, nixpkgs, nixpkgs-unstable, home-manager
, plasma-manager, nix-flatpak, nur, nvim, disko, nixvim, catppuccin, ... }:
let
overlay-unstable = final: prev: {
unstable = import nixpkgs-unstable {
inherit (final) system;
config.allowUnfree = true;
config.nvidia.acceptLicense = true;
};
};
workstationOverlays =
[ nur.overlay nvim.overlays.default overlay-unstable ];
secrets =
builtins.fromJSON (builtins.readFile "${self}/secrets/secrets.json");
user-settings =
builtins.fromJSON (builtins.readFile "${self}/settings/settings.json");
commonModules = [
nur.nixosModules.nur
nix-flatpak.nixosModules.nix-flatpak
home-manager.nixosModules.home-manager
catppuccin.nixosModules.catppuccin
nixvim.nixosModules.nixvim
];
serverModules =
[ home-manager.nixosModules.home-manager nixvim.nixosModules.nixvim ];
commonHomeManagerConfig = {
home-manager = {
useUserPackages = true;
sharedModules = [ plasma-manager.homeManagerModules.plasma-manager ];
useGlobalPkgs = true;
extraSpecialArgs = { inherit user-settings secrets inputs; };
users."${user-settings.user.username}" = {
imports = [ catppuccin.homeManagerModules.catppuccin ];
};
};
};
serverHomeManagerConfig = {
home-manager = {
useUserPackages = true;
sharedModules = [ ];
useGlobalPkgs = true;
extraSpecialArgs = { inherit user-settings secrets inputs; };
users."${user-settings.user.username}" = { imports = [ ]; };
};
};
commonNixpkgsConfig = {
nixpkgs = {
overlays = workstationOverlays;
config.allowUnfree = true;
};
};
makeSystem = name: modules:
nixpkgs.lib.nixosSystem {
specialArgs = {
inherit user-settings inputs secrets nixpkgs-unstable;
};
system = "x86_64-linux";
modules = modules;
};
in {
nixosConfigurations = {
evo = makeSystem "evo" (commonModules
++ [ ./systems/evo commonHomeManagerConfig commonNixpkgsConfig ]);
rembot = makeSystem "rembot" (commonModules
++ [ ./systems/rembot commonHomeManagerConfig commonNixpkgsConfig ]);
nixdo = makeSystem "nixdo" [ ./systems/nixdo ];
srv = makeSystem "srv" (serverModules
++ [ ./systems/srv serverHomeManagerConfig commonNixpkgsConfig ]);
};
};
}