diff --git a/.gitignore b/.gitignore index 9dec873..f50ce71 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ !machines/enka/nushell/ !machines/enka/openttd/ !machines/enka/pipewire/ +!machines/enka/pueue/ !machines/enka/python/ !machines/enka/qt/ !machines/enka/steam/ @@ -33,6 +34,7 @@ !*.lua !*.md +!*.mp3 !*.nix !*.nu !*.sh diff --git a/flake.lock b/flake.lock index e686a45..edc3f5e 100644 --- a/flake.lock +++ b/flake.lock @@ -602,6 +602,22 @@ "type": "github" } }, + "nuScripts": { + "flake": false, + "locked": { + "lastModified": 1702127877, + "narHash": "sha256-W9czVqmYOmdn7G3dMdVkBYkeDzTizSLAF1X25pSB+gw=", + "owner": "RGBCube", + "repo": "nu_scripts", + "rev": "33fd3943d50bfac0103306c9ac800f931d199f0b", + "type": "github" + }, + "original": { + "owner": "RGBCube", + "repo": "nu_scripts", + "type": "github" + } + }, "root": { "inputs": { "fenix": "fenix", @@ -612,6 +628,7 @@ "hyprpicker": "hyprpicker", "nixSuper": "nixSuper", "nixpkgs": "nixpkgs_7", + "nuScripts": "nuScripts", "themes": "themes", "tools": "tools", "zls": "zls" diff --git a/flake.nix b/flake.nix index 6883487..c259da0 100644 --- a/flake.nix +++ b/flake.nix @@ -76,6 +76,11 @@ url = "github:clo4/ghostty-hm-module"; }; + nuScripts = { + url = "github:RGBCube/nu_scripts"; + flake = false; + }; + fenix = { url = "github:nix-community/fenix"; inputs.nixpkgs.follows = "nixpkgs"; @@ -102,6 +107,7 @@ nixpkgs, homeManager, ghosttyModule, + nuScripts, fenix, tools, themes, @@ -117,6 +123,7 @@ ulib = { inherit (tools) recursiveUpdateMap; + inherit nuScripts; recursiveUpdate3 = x: y: z: lib.recursiveUpdate x (lib.recursiveUpdate y z); }; diff --git a/machines/enka/default.nix b/machines/enka/default.nix index 3706556..985dac6 100644 --- a/machines/enka/default.nix +++ b/machines/enka/default.nix @@ -34,6 +34,7 @@ ./nushell ./openttd ./pipewire + ./pueue ./python ./steam ./steck diff --git a/machines/enka/nushell/boom.mp3 b/machines/enka/nushell/boom.mp3 new file mode 100644 index 0000000..65a3a91 Binary files /dev/null and b/machines/enka/nushell/boom.mp3 differ diff --git a/machines/enka/nushell/configuration.nu b/machines/enka/nushell/configuration.nix.nu similarity index 97% rename from machines/enka/nushell/configuration.nu rename to machines/enka/nushell/configuration.nix.nu index c371b60..597c5d2 100644 --- a/machines/enka/nushell/configuration.nu +++ b/machines/enka/nushell/configuration.nix.nu @@ -1,3 +1,4 @@ +'' $env.config = { bracketed_paste: true buffer_editor: "" @@ -180,8 +181,18 @@ $env.config.cursor_shape = { } $env.config.hooks = { - command_not_found: {} - display_output: "if (term size).columns >= 100 { table --expand } else { table }" + command_not_found: {|| + task status + | where label == boom + | get id + | each {|id| + (task kill $id) + task remove $id + } + + task spawn --label boom { pw-play ${./boom.mp3} } + } + display_output: "table --expand" env_change: {} pre_execution: [ { @@ -413,3 +424,4 @@ $env.config.keybindings = [ event: { send: enter } } ] +'' diff --git a/machines/enka/nushell/default.nix b/machines/enka/nushell/default.nix index 0413005..7f52633 100644 --- a/machines/enka/nushell/default.nix +++ b/machines/enka/nushell/default.nix @@ -8,8 +8,11 @@ programs.starship = enabled {}; programs.nushell = enabled { - configFile.source = ./configuration.nu; - envFile.text = (import ./environment.nu.nix) theme; + configFile.text = import ./configuration.nix.nu; + envFile.text = import ./environment.nix.nu { + inherit (ulib) nuScripts; + inherit theme; + }; environmentVariables = { inherit (config.environment.variables) NIX_LD; diff --git a/machines/enka/nushell/environment.nu.nix b/machines/enka/nushell/environment.nix.nu similarity index 89% rename from machines/enka/nushell/environment.nu.nix rename to machines/enka/nushell/environment.nix.nu index a8dc7d3..eedb6bd 100644 --- a/machines/enka/nushell/environment.nu.nix +++ b/machines/enka/nushell/environment.nix.nu @@ -1,4 +1,4 @@ -theme: '' +{ nuScripts, theme }: '' $env.PROMPT_INDICATOR = ""; $env.PROMPT_INDICATOR_VI_INSERT = ""; $env.PROMPT_INDICATOR_VI_NORMAL = ""; @@ -24,4 +24,6 @@ def --wrapped hx [...arguments] { kitty @ set-spacing padding=${toString theme.padding} } } + +use ${nuScripts}/modules/background_task/task.nu '' diff --git a/machines/enka/pueue/default.nix b/machines/enka/pueue/default.nix new file mode 100644 index 0000000..2d8fd79 --- /dev/null +++ b/machines/enka/pueue/default.nix @@ -0,0 +1,39 @@ +{ homeConfiguration, enabled, ... }: + +homeConfiguration "nixos" { + services.pueue = enabled { + settings = { + shared = { + pueue_directory = "~/.local/share/pueue"; + use_unix_socket = true; + runtime_directory = null; + unix_socket_path = "~/.local/share/pueue/pueue_your_user.socket"; + host = "localhost"; + port = 6924; + daemon_cert = "~/.local/share/pueue/certs/daemon.cert"; + daemon_key = "~/.local/share/pueue/certs/daemon.key"; + shared_secret_path = "~/.local/share/pueue/shared_secret"; + }; + + client = { + restart_in_place = false; + read_local_logs = true; + show_confirmation_questions = false; + show_expanded_aliases = false; + dark_mode = false; + max_status_height = null; + status_time_format = "%H:%M:%S"; + status_datetime_format = "%Y-%m-%d\n%H:%M:%S"; + }; + + daemon = { + default_parallel_tasks = 10; + pause_group_on_failure = false; + pause_all_on_failure = false; + callback = "\"Task {{ id }}\nCommand: {{ command }}\nPath: {{ path }}\nFinished with status '{{ result }}'\""; + callback_log_lines = 10; + groups.default = 1; + }; + }; + }; +}