blob: f3741f11b17a2625578761ff6250f291d018ccc4 [file] [log] [blame]
Samuel Shuertf68685d2023-10-28 20:07:56 -04001{ inputs, system, pkgs, drive_paths, ... }:
2let
3 inherit (inputs) self home-manager deploy-rs nixpkgs;
Skyler Grey22428b02023-11-19 13:20:56 +00004 config = (self.nixosConfigurations.clicks.extendModules { modules = [
5 ./hardware-configuration.nix
6 ./backups.nix
Skyler Greyadab78f2023-11-26 21:59:40 +00007 ./networking.nix
Skyler Grey22428b02023-11-19 13:20:56 +00008 ]; });
Samuel Shuertf68685d2023-10-28 20:07:56 -04009 deploy = {
10 sudo = "doas -u";
11 profiles = {
12 system = {
13 user = "root";
14 path = deploy-rs.lib.x86_64-linux.activate.nixos config;
15 };
16 } // (let
17 mkServiceConfig = service: {
18 user = service;
19
20 profilePath = "/nix/var/nix/profiles/per-user/${service}/home-manager";
21 path = deploy-rs.lib.x86_64-linux.activate.home-manager
22 (home-manager.lib.homeManagerConfiguration {
23 inherit pkgs;
24 modules = [
25 {
26 home.homeDirectory = "/services/${service}";
27 home.username = service;
28 home.stateVersion = "22.11";
29 programs.home-manager.enable = true;
30 }
31 "${../../services}/${service}"
32 ];
33 extraSpecialArgs = {
34 inherit (inputs) nixpkgs-clicksforms;
35 inherit system drive_paths;
36 };
37 });
38 };
39 in nixpkgs.lib.pipe ../../services [
40 builtins.readDir
41 (nixpkgs.lib.filterAttrs (_name: value: value == "directory"))
42 builtins.attrNames
43 (map (name: {
44 inherit name;
45 value = mkServiceConfig name;
46 }))
47 builtins.listToAttrs
48 ]) // (let
49 mkBlankConfig = username: {
50 user = username;
51
52 profilePath = "/nix/var/nix/profiles/per-user/${username}/home-manager";
53 path = deploy-rs.lib.x86_64-linux.activate.home-manager
54 (home-manager.lib.homeManagerConfiguration {
55 inherit pkgs;
56 modules = [
57 {
58 home.username = username;
59 home.stateVersion = "22.11";
60 programs.home-manager.enable = true;
61 }
62 "${../../homes}/${username}"
63 ];
64 });
65 };
66 in nixpkgs.lib.pipe ../../homes [
67 builtins.readDir
68 (nixpkgs.lib.filterAttrs (_name: value: value == "directory"))
69 builtins.attrNames
70 (map (name: {
71 inherit name;
72 value = mkBlankConfig name;
73 }))
74 builtins.listToAttrs
75 ]);
76 hostname = "a1d2";
77 profilesOrder = [ "system" ];
78 };
79in { inherit deploy config; }