homemanager: fix passthrough of options

This commit is contained in:
Christoph Hollizeck 2024-11-24 00:00:03 +01:00
parent c37f1e7ac8
commit 1957b47664
Signed by: Daholli
GPG key ID: 249300664F2AF2C7
7 changed files with 18 additions and 49 deletions

View file

@ -17,6 +17,4 @@ with lib.wyrdgard;
direnv = enabled;
};
};
home.stateVersion = "24.11";
}

View file

@ -2,11 +2,12 @@
lib,
pkgs,
config,
namespace,
osConfig ? { },
format ? "unknown",
...
}:
with lib.wyrdgard;
with lib.${namespace};
{
wyrdgard = {
apps = {
@ -17,6 +18,4 @@ with lib.wyrdgard;
direnv = enabled;
};
};
home.stateVersion = "23.11";
}

View file

@ -7,10 +7,7 @@
}:
let
inherit (lib) mkIf mkEnableOption;
cfg = config.${namespace}.desktop.addons.hypridle;
username = config.${namespace}.user.name;
in
{
options.${namespace}.desktop.addons.hypridle = {
@ -18,7 +15,7 @@ in
};
config = mkIf cfg.enable {
snowfallorg.users.${username}.home.config = {
${namespace}.home.extraOptions = {
services.hypridle = {
enable = true;
settings = {

View file

@ -20,15 +20,15 @@ in
};
config = {
${namespace}.home.extraOptions = {
home.stateVersion = config.system.stateVersion;
home.file = mkAliasDefinitions options.${namespace}.home.file;
xdg.enable = true;
xdg.configFile = mkAliasDefinitions options.${namespace}.home.configFile;
};
snowfallorg.users.${config.${namespace}.user.name}.home.config =
config.${namespace}.home.extraOptions;
snowfallorg.users.${config.${namespace}.user.name}.home.config = mkMerge [
{
home.stateVersion = config.system.stateVersion;
home.file = mkAliasDefinitions options.${namespace}.home.file;
xdg.enable = true;
xdg.configFile = mkAliasDefinitions options.${namespace}.home.configFile;
}
config.${namespace}.home.extraOptions
];
home-manager = {
useUserPackages = true;

View file

@ -2,7 +2,6 @@
config,
lib,
namespace,
options,
pkgs,
...
}:
@ -11,33 +10,6 @@ with lib.${namespace};
let
cfg = config.${namespace}.user;
defaultIconFileName = "profile.png";
defaultIcon = pkgs.stdenvNoCC.mkDerivation {
name = "default-icon";
src = ./. + "/${defaultIconFileName}";
dontUnpack = true;
installPhase = ''
cp $src $out
'';
passthru = {
fileName = defaultIconFileName;
};
};
propagatedIcon =
pkgs.runCommandNoCC "propagated-icon"
{
passthru = {
inherit (fileName) ;
};
}
''
local target="$out/share/${namespace}-icons/user/${cfg.name}"
mkdir -p "$target"
cp ${cfg.icon} "$target/${cfg.icon.fileName}"
'';
in
{
options.${namespace}.user = with types; {
@ -45,7 +17,7 @@ in
fullName = mkOpt str "Christoph Hollizeck" "The full name of the user.";
email = mkOpt str "christoph.hollizeck@hey.com" "The email of the user.";
initialPassword = mkOpt str "asdf" "The initial password to use when the user is first created.";
icon = mkOpt (nullOr package) defaultIcon "The profile picture to use for the user.";
icon = mkOpt (nullOr path) ./${defaultIconFileName} "The profile picture to use for the user.";
extraGroups = mkOpt (listOf str) [ ] "Groups for the user to be assigned.";
extraOptions = mkOpt attrs { } (mdDoc "Extra options passed to `users.users.<name>`.");
trustedPublicKeys = mkOption {
@ -78,7 +50,7 @@ in
"Videos/.keep".text = "";
"projects/.keep".text = "";
".face".source = cfg.icon;
"Pictures/${cfg.icon.fileName or (builtins.baseNameOf cfg.icon)}".source = cfg.icon;
"Pictures/${defaultIconFileName}".source = cfg.icon;
};
};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 130 B

View file

@ -28,6 +28,9 @@ in
programs.ssh.extraConfig = ''
AddressFamily inet
'';
home-manager = {
backupFileExtension = ".bak";
};
${namespace} = {
archetypes = {
@ -76,7 +79,7 @@ in
windowrulev2 = [
"workspace 8 silent, class:^(steam)$, title:^(Friends List)"
"workspace 8 silent, class:^(discord)$, title:^(Discord)"
"workspace 8 silent, class:^(vesktop)$, title:^(Discord)"
"workspace 7 silent, class:^(com.obsproject.Studio)$"
];
};