Add config builder

This commit is contained in:
Peter Selby 2023-11-06 13:59:39 -08:00
parent e0bffa4095
commit 7fbdb29e10
4 changed files with 21 additions and 22 deletions

View File

@ -23,11 +23,11 @@
"rotate-text": "rotate-text" "rotate-text": "rotate-text"
}, },
"locked": { "locked": {
"lastModified": 1627398156, "lastModified": 1666806097,
"narHash": "sha256-Ru1aV3NuIFXAsvUE3de8KR7xDZOo1GCBJdsWKJn+Ebw=", "narHash": "sha256-4/QpDoyf2I7RvhbmK15PB+qPuLYU3Lm0woUChA1fn+k=",
"owner": "vlaci", "owner": "vlaci",
"repo": "nix-doom-emacs", "repo": "nix-doom-emacs",
"rev": "fee14d217b7a911aad507679dafbeaa8c1ebf5ff", "rev": "cc495913aeb4212349392e1c68a62b8e63248123",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -187,11 +187,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1633596850, "lastModified": 1646616315,
"narHash": "sha256-5+qVLYvfOropjLAvpQs/APtD8eYnEIbAd9a36lGHZM0=", "narHash": "sha256-A1g4AjM/4kVWBzfCx9HqCszVFlcsk+C9NHG3X6hRjaI=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "49695f33aac22358b59e49c94fe6472218e5d766", "rev": "454abeb5a891b2b56f10a30f2a846e8341cbfe9b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -204,11 +204,11 @@
"niten-doom-config": { "niten-doom-config": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1633712607, "lastModified": 1684432992,
"narHash": "sha256-6PAw7Xvoj4JROeTqK1nhT2zv7bPpiQlm9t7H5HQ0f2k=", "narHash": "sha256-ex/H6we7BLjidBxo0n5EZ9YUflLr03sLWdf5YGsF6jU=",
"ref": "master", "ref": "refs/heads/master",
"rev": "0a4f8ce4121ba3d64d29b0d52733c08febfb83d8", "rev": "47773717b06d21004db3dea96f2329f912ef8dd3",
"revCount": 35, "revCount": 64,
"type": "git", "type": "git",
"url": "https://git.fudo.org/niten/doom-emacs.git" "url": "https://git.fudo.org/niten/doom-emacs.git"
}, },
@ -251,11 +251,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1634115022, "lastModified": 1659914493,
"narHash": "sha256-K9DZMQ47VRrg9gtTPwex5p0E8LnwM/dDkNe7AQW0qj0=", "narHash": "sha256-lkA5X3VNMKirvA+SUzvEhfA7XquWLci+CGi505YFAIs=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "564cb4d81d4f734dd068684adec5a60077397fe9", "rev": "022caabb5f2265ad4006c1fa5b1ebe69fb0c3faf",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -24,5 +24,8 @@
(import ./module.nix { inherit doom-emacs niten-doom-config; }) (import ./module.nix { inherit doom-emacs niten-doom-config; })
]; ];
}; };
mkHomeManagerConfiguration = { username, user-email, home-dir, enable-gui, ... }: import ./niten.nix {
inherit username user-email home-dir enable-gui doom-emacs niten-doom-config;
};
}; };
} }

View File

@ -38,18 +38,15 @@ in {
user-email = if (user-cfg.email != null) then user-email = if (user-cfg.email != null) then
user-cfg.email else "${username}@${config.instance.local-domain}"; user-cfg.email else "${username}@${config.instance.local-domain}";
home-dir = config.users.users.${username}.home; home-dir = config.users.users.${username}.home;
in (import user-configs.${username} { in ((import user-configs.${username} {
inherit inherit
config
lib
pkgs
doom-emacs doom-emacs
niten-doom-config niten-doom-config
username username
user-email user-email
home-dir home-dir
enable-gui; enable-gui;
}); }) { inherit config, lib, pgks, ...});
in mapAttrs generate-config local-users; in mapAttrs generate-config local-users;
}; };
} }

View File

@ -1,9 +1,6 @@
{ {
doom-emacs, doom-emacs,
niten-doom-config, niten-doom-config,
config,
lib,
pkgs,
username, username,
user-email, user-email,
home-dir, home-dir,
@ -11,6 +8,8 @@
... ...
}: }:
{ config, lib, pkgs, }:
with lib; with lib;
let let