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