diff --git a/hosts/pinwheel/configuration.nix b/hosts/pinwheel/configuration.nix index d4e164b..6d81f4c 100644 --- a/hosts/pinwheel/configuration.nix +++ b/hosts/pinwheel/configuration.nix @@ -120,6 +120,7 @@ keyboard.enable = true; docker.enable = true; podman.enable = false; + scripts.enable = true; }; # This value determines the NixOS release from which the default diff --git a/hosts/pinwheel/modules/default.nix b/hosts/pinwheel/modules/default.nix index 0646c7e..709a65e 100644 --- a/hosts/pinwheel/modules/default.nix +++ b/hosts/pinwheel/modules/default.nix @@ -30,6 +30,7 @@ ./docker ./podman ./k8s + ./scripts ./work ]; diff --git a/hosts/pinwheel/modules/scripts/default.nix b/hosts/pinwheel/modules/scripts/default.nix new file mode 100644 index 0000000..612870b --- /dev/null +++ b/hosts/pinwheel/modules/scripts/default.nix @@ -0,0 +1,22 @@ +{ pkgs, lib, config, ... }: +let + enabled = config.mod.scripts.enable; + + t = pkgs.writeShellScriptBin "t" '' + bash -c "$*" + ${pkgs.libnotify}/bin/notify-send "CMD ended:" "$*" + ''; +in +{ + options = { + mod.scripts = { + enable = lib.mkEnableOption "add scripts module"; + }; + }; + + config = lib.mkIf enabled { + home-manager.users.alex = { + home.packages = [ t ]; + }; + }; +}