diff --git a/hosts/lars/default.nix b/hosts/lars/default.nix index ed2b6e0..ed31b66 100644 --- a/hosts/lars/default.nix +++ b/hosts/lars/default.nix @@ -7,6 +7,9 @@ programs.kdeconnect.enable = true; myOptions = { other = { + system = { + gitPath = "/home/lars/nichts"; + }; home-manager = { enable = true; enableDirenv = true; diff --git a/modules/cli/zsh.nix b/modules/cli/zsh.nix index 02b2647..04e90d8 100644 --- a/modules/cli/zsh.nix +++ b/modules/cli/zsh.nix @@ -2,6 +2,7 @@ with lib; let cfg = config.myOptions.programs.zsh; username = config.myOptions.other.system.username; + gitPath = config.myOptions.other.system.gitPath; in { options.myOptions.programs.zsh = { enable = mkEnableOption "zsh"; @@ -54,7 +55,7 @@ in { cd = "z"; nv = "nvim"; #TODO fix hardcoding of git repo path and profile name - update = "sudo -p 'password: ' echo 'Your daughter is just a fork of your wife.' && sudo nixos-rebuild switch --flake \"$HOME/nichts#${config.myOptions.other.system.hostname}\" --log-format internal-json |& nom --json"; + update = "sudo -p 'password: ' echo 'Your daughter is just a fork of your wife.' && sudo nixos-rebuild switch --flake \"${gitPath}#${config.myOptions.other.system.hostname}\" --log-format internal-json |& nom --json"; } // cfg.extraAliases; initExtraFirst = mkIf cfg.profiling "zmodload zsh/zprof"; diff --git a/modules/other/system.nix b/modules/other/system.nix index 2f14a84..e4d1328 100644 --- a/modules/other/system.nix +++ b/modules/other/system.nix @@ -15,6 +15,11 @@ in { description = "username for this system"; type = types.str; }; + + gitPath = mkOption { + description = "path to the flake directory"; + type = types.str; + }; }; config = {