diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-04-14 13:32:15 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-04-14 13:32:15 +0200 |
commit | 5e1362e4f73328ecbace995c2892f01b9a62e0b9 (patch) | |
tree | 8e7362893d22ac95e431ec66d2ed9fa6094a5d34 /pkgs/by-name/fu/fupdate/package.nix | |
parent | pkgs/fupdate: Split into `fupdate-flake` and `fupdate` (diff) | |
download | nixos-config-5e1362e4f73328ecbace995c2892f01b9a62e0b9.zip |
pkgs/fupdate: Rewrite in rust
Diffstat (limited to 'pkgs/by-name/fu/fupdate/package.nix')
-rw-r--r-- | pkgs/by-name/fu/fupdate/package.nix | 55 |
1 files changed, 29 insertions, 26 deletions
diff --git a/pkgs/by-name/fu/fupdate/package.nix b/pkgs/by-name/fu/fupdate/package.nix index 66372add..d33138e3 100644 --- a/pkgs/by-name/fu/fupdate/package.nix +++ b/pkgs/by-name/fu/fupdate/package.nix @@ -1,29 +1,32 @@ { - sysLib, - dash, - lix, - gnugrep, - fd, - coreutils, - bat, # used by batgrep - bat-extras, - gnused, # required by batgrep - git, # needed to fetch through git + rustPlatform, + installShellFiles, + makeWrapper, }: -sysLib.writeShellScript { - name = "fupdate"; - src = ./fupdate.sh; - generateCompletions = true; - keepPath = true; - dependencies = [ - dash - lix - gnugrep - fd - coreutils - bat # used by batgrep - bat-extras.batgrep - gnused # required by batgrep - git # needed to fetch through git +rustPlatform.buildRustPackage (finalAttrs: { + pname = "fupdate"; + version = "0.1.0"; + + src = ./.; + cargoLock = { + lockFile = ./Cargo.lock; + }; + + buildInputs = []; + + nativeBuildInputs = [ + installShellFiles + makeWrapper ]; -} + + postInstall = '' + installShellCompletion --cmd fupdate \ + --bash <(COMPLETE=bash $out/bin/fupdate) \ + --fish <(COMPLETE=fish $out/bin/fupdate) \ + --zsh <(COMPLETE=zsh $out/bin/fupdate) + ''; + + meta = { + mainProgram = "fupdate"; + }; +}) |