mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
home-manager kat user refactor
This commit is contained in:
parent
b1f27aa74d
commit
1230ff387b
13 changed files with 34 additions and 82 deletions
|
|
@ -19,12 +19,6 @@ with lib;
|
|||
../../services/zfs.nix
|
||||
];
|
||||
|
||||
home-manager.users.kat = {
|
||||
imports = [
|
||||
./home.nix
|
||||
];
|
||||
};
|
||||
|
||||
# File Systems and Swap
|
||||
|
||||
boot.supportedFilesystems = singleton "zfs";
|
||||
|
|
|
|||
|
|
@ -23,12 +23,6 @@ in {
|
|||
./nixos/virtualhosts.nix
|
||||
];
|
||||
|
||||
home-manager.users.kat = {
|
||||
imports = [
|
||||
./home.nix
|
||||
];
|
||||
};
|
||||
|
||||
# File Systems and Swap
|
||||
|
||||
boot.supportedFilesystems = [ "zfs" "xfs" ];
|
||||
|
|
|
|||
|
|
@ -18,12 +18,6 @@ with lib;
|
|||
../../services/nginx.nix
|
||||
];
|
||||
|
||||
home-manager.users.kat = {
|
||||
imports = [
|
||||
./home.nix
|
||||
];
|
||||
};
|
||||
|
||||
# File Systems and Swap
|
||||
|
||||
boot.supportedFilesystems = singleton "zfs";
|
||||
|
|
|
|||
|
|
@ -1,24 +0,0 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
home-manager.users.kat = {
|
||||
imports = [ ./base ] ++ lib.optional (builtins.pathExists ../../trusted/users/kat) (import ../../trusted/users/kat);
|
||||
home.stateVersion = "20.09";
|
||||
};
|
||||
|
||||
users.users.kat = {
|
||||
uid = 1000;
|
||||
isNormalUser = true;
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCocjQqiDIvzq+Qu3jkf7FXw5piwtvZ1Mihw9cVjdVcsra3U2c9WYtYrA3rS50N3p00oUqQm9z1KUrvHzdE+03ZCrvaGdrtYVsaeoCuuvw7qxTQRbItTAEsfRcZLQ5c1v/57HNYNEsjVrt8VukMPRXWgl+lmzh37dd9w45cCY1QPi+JXQQ/4i9Vc3aWSe4X6PHOEMSBHxepnxm5VNHm4PObGcVbjBf0OkunMeztd1YYA9sEPyEK3b8IHxDl34e5t6NDLCIDz0N/UgzCxSxoz+YJ0feQuZtud/YLkuQcMxW2dSGvnJ0nYy7SA5DkW1oqcy6CGDndHl5StOlJ1IF9aGh0gGkx5SRrV7HOGvapR60RphKrR5zQbFFka99kvSQgOZqSB3CGDEQGHv8dXKXIFlzX78jjWDOBT67vA/M9BK9FS2iNnBF5x6shJ9SU5IK4ySxq8qvN7Us8emkN3pyO8yqgsSOzzJT1JmWUAx0tZWG/BwKcFBHfceAPQl6pwxx28TM3BTBRYdzPJLTkAy48y6iXW6UYdfAPlShy79IYjQtEThTuIiEzdzgYdros0x3PDniuAP0KOKMgbikr0gRa6zahPjf0qqBnHeLB6nHAfaVzI0aNbhOg2bdOueE1FX0x48sjKqjOpjlIfq4WeZp9REr2YHEsoLFOBfgId5P3BPtpBQ== cardno:000612078454"
|
||||
];
|
||||
shell = pkgs.zsh;
|
||||
extraGroups = [ "wheel" "video" "systemd-journal" "plugdev" ];
|
||||
hashedPassword =
|
||||
"$6$i28yOXoo$/WokLdKds5ZHtJHcuyGrH2WaDQQk/2Pj0xRGLgS8UcmY2oMv3fw2j/85PRpsJJwCB2GBRYRK5LlvdTleHd3mB.";
|
||||
};
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"f /var/lib/systemd/linger/kat"
|
||||
];
|
||||
}
|
||||
|
|
@ -1,11 +1,20 @@
|
|||
rec {
|
||||
base = ./base.nix;
|
||||
gui = ./gui.nix;
|
||||
sway = ./sway.nix;
|
||||
dev = ./dev.nix;
|
||||
media = ./media.nix;
|
||||
personal = ./personal.nix;
|
||||
|
||||
let katUser = { lib }: let
|
||||
userImport = profile: { config, ... }: {
|
||||
config.home-manager.users.kat = {
|
||||
imports = [
|
||||
(./. + "/${profile}")
|
||||
];
|
||||
};
|
||||
}; profileNames = [
|
||||
"gui"
|
||||
"sway"
|
||||
"dev"
|
||||
"media"
|
||||
"personal"
|
||||
]; userProfiles = with userProfiles;
|
||||
lib.genAttrs profileNames userImport // {
|
||||
base = { imports = [ ./nixos.nix (userImport "base") ]; };
|
||||
server = { imports = [ personal ]; };
|
||||
guiFull = { imports = [ gui sway dev media personal ]; };
|
||||
}
|
||||
}; in userProfiles;
|
||||
in { __functor = self: katUser; isModule = false; }
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
home-manager.users.kat = { imports = [ ./dev ]; };
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
home-manager.users.kat = { imports = [ ./gui ]; };
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
home-manager.users.kat = { imports = [ ./media ]; };
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
home-manager.users.kat = { imports = [ ./personal ]; };
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
home-manager.users.kat = { imports = [ ./sway ]; };
|
||||
}
|
||||
|
|
@ -8,9 +8,9 @@
|
|||
}@args: let
|
||||
colorHelpers = import ./color-helpers.nix { inherit lib; };
|
||||
lib = before // katlib // self;
|
||||
katlib = with before; with katlib; with self;
|
||||
katlib = with before; with katlib; with self;
|
||||
{
|
||||
inherit (colorHelpers) hextorgba;
|
||||
hostImport = import ./host-import.nix { inherit lib; };
|
||||
modList = import ./module-list.nix;
|
||||
modList = import ./module-list.nix { inherit lib; };
|
||||
}; in katlib
|
||||
|
|
|
|||
|
|
@ -1,6 +1,15 @@
|
|||
{ lib }: hostName: lib.filter builtins.pathExists [
|
||||
{ lib }: hostName: with lib; filter builtins.pathExists [
|
||||
(../../config/hosts + "/${hostName}/nixos.nix")
|
||||
(../../config/trusted/hosts + "/${hostName}/nixos.nix")
|
||||
../../config/trusted/profile
|
||||
../../config/profiles/base
|
||||
]
|
||||
] ++ singleton {
|
||||
options.home-manager.users = mkOption {
|
||||
type = types.attrsOf (types.submoduleWith {
|
||||
modules = filter builtins.pathExists [
|
||||
(../../config/hosts + "/${hostName}/home.nix")
|
||||
(../../config/trusted/hosts + "/${hostName}/home.nix")
|
||||
];
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
{ modulesDir, defaultFile ? "default.nix", importAll ? false }:
|
||||
{ lib }: { modulesDir, defaultFile ? "default.nix", importAll ? false }:
|
||||
|
||||
with builtins;
|
||||
|
||||
let
|
||||
isModule = m: lib.isFunction m && (m.isModule or true);
|
||||
filterAttrNamesToList = filter: set:
|
||||
foldl' (a: b: a ++ b) [ ]
|
||||
(map (e: if (filter e set.${e}) then [ e ] else [ ]) (attrNames set));
|
||||
|
|
@ -20,7 +21,7 @@ let
|
|||
in
|
||||
{
|
||||
inherit name;
|
||||
value = if (isFunction m) && !importAll then value else m;
|
||||
value = if lib.isFunction m && ! isModule m then m { inherit lib; } else if isModule m && !importAll then value else m;
|
||||
})
|
||||
files;
|
||||
in
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue