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