diff --git a/modules/scripts/zet.nix b/modules/scripts/zet.nix new file mode 100644 index 00000000..4630d2fb --- /dev/null +++ b/modules/scripts/zet.nix @@ -0,0 +1,37 @@ +{ inputs, withSystem, ... }: + +let + name = "zet"; +in +{ + perSystem = + { pkgs, ... }: + { + packages.${name} = pkgs.writeShellApplication { + inherit name; + + bashOptions = [ "pipefail" ]; + + runtimeInputs = with pkgs; [ + bashInteractive + coreutils + fzf + git + ]; + + text = builtins.readFile "${inputs.zet}/${name}"; + }; + }; + + flake.modules.homeManager.base = + { config, pkgs, ... }: + { + home.packages = [ + (withSystem pkgs.system (psArgs: psArgs.config.packages.${name})) + ]; + + home.sessionVariables = { + ZET_DIR = "${config.xdg.userDirs.documents}/zet"; + }; + }; +} diff --git a/modules/zet/default.nix b/modules/zet/default.nix deleted file mode 100644 index 32b0e75e..00000000 --- a/modules/zet/default.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ inputs, ... }: - -{ - flake.modules.homeManager.base = - { pkgs, ... }: - { - home.packages = - let - name = "zet"; - in - [ - (pkgs.writeShellApplication { - inherit name; - - runtimeInputs = with pkgs; [ - bashInteractive - coreutils - fzf - git - ]; - - text = builtins.readFile "${inputs.zet}/${name}"; - }) - ]; - }; -}