From f1b4f907ee9460900991dd35d4636d823e4921d1 Mon Sep 17 00:00:00 2001 From: Lillian-Violet Date: Wed, 17 Jan 2024 15:25:52 +0100 Subject: [PATCH] Install them this way? --- nixos/desktop/configuration.nix | 49 ++++++++++++++++++--------------- nixos/shared/scripts/dvd.nix | 17 ++++++++++++ nixos/shared/scripts/dvt.nix | 17 ++++++++++++ 3 files changed, 61 insertions(+), 22 deletions(-) create mode 100644 nixos/shared/scripts/dvd.nix create mode 100644 nixos/shared/scripts/dvt.nix 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 + ''; +}