diff --git a/nixos/desktop/configuration.nix b/nixos/desktop/configuration.nix index 9c1cd86..42c7557 100644 --- a/nixos/desktop/configuration.nix +++ b/nixos/desktop/configuration.nix @@ -55,6 +55,31 @@ }; }; + pkgs = [ + writeShellApplication + { + name = "dvd"; + + runtimeInputs = [echo direnv]; + + text = '' + echo "use flake \"github:the-nix-way/dev-templates?dir=$1\"" >> .envrc + direnv allow + ''; + } + writeShellApplication + { + name = "dvt"; + + runtimeInputs = [direnv nix]; + + text = '' + nix flake init -t "github:the-nix-way/dev-templates#$1" + direnv allow + ''; + } + ]; + environment.systemPackages = with pkgs; [ # System tools age @@ -91,28 +116,8 @@ # User tools noisetorch - writeShellApplication - { - name = "dvd"; - - runtimeInputs = [echo direnv]; - - text = '' - echo "use flake \"github:the-nix-way/dev-templates?dir=$1\"" >> .envrc - direnv allow - ''; - } - writeShellApplication - { - name = "dvt"; - - runtimeInputs = [direnv nix]; - - text = '' - nix flake init -t "github:the-nix-way/dev-templates#$1" - direnv allow - ''; - } + (callPackage ../shared/scripts/dvd.nix {}) + (callPackage ../shared/scripts/dvt.nix {}) ]; programs.direnv = { diff --git a/nixos/shared/scripts/dvd.nix b/nixos/shared/scripts/dvd.nix new file mode 100644 index 0000000..7b10c3f --- /dev/null +++ b/nixos/shared/scripts/dvd.nix @@ -0,0 +1,17 @@ +{ + lib, + stdenv, + direnv, + writeShellApplication, +}: +writeShellApplication +{ + name = "dvd"; + + runtimeInputs = [echo direnv]; + + text = '' + echo "use flake \"github:the-nix-way/dev-templates?dir=$1\"" >> .envrc + direnv allow + ''; +} diff --git a/nixos/shared/scripts/dvt.nix b/nixos/shared/scripts/dvt.nix new file mode 100644 index 0000000..641c030 --- /dev/null +++ b/nixos/shared/scripts/dvt.nix @@ -0,0 +1,17 @@ +{ + lib, + stdenv, + direnv, + writeShellApplication, +}: +writeShellApplication +{ + name = "dvt"; + + runtimeInputs = [direnv nix]; + + text = '' + nix flake init -t "github:the-nix-way/dev-templates#$1" + direnv allow + ''; +}