Skip to content

Commit

Permalink
Initial Nixpkgs mode
Browse files Browse the repository at this point in the history
- To make this work, a lot of functions had to be moved to a different struct (IMO it's
  a strict improvement even on its own)
- I noticed that adding pins twice did not fail, so I added a check and a corresponding
  --force flag
  • Loading branch information
piegamesde committed May 20, 2022
1 parent f71e61d commit 49b8467
Show file tree
Hide file tree
Showing 5 changed files with 383 additions and 244 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ USAGE:

FLAGS:
-n, --dry-run Don't actually apply the changes
-f, --force Overwrite existing pins with the same name
-h, --help Prints help information

OPTIONS:
Expand Down
5 changes: 5 additions & 0 deletions npins.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ let

cargoToml = builtins.fromTOML (builtins.readFile (src + "/Cargo.toml"));
runtimePath = lib.makeBinPath [ nix nix-prefetch-git git ];

self = rustPlatform.buildRustPackage {
pname = cargoToml.package.name;
version = cargoToml.package.version;
Expand All @@ -56,6 +57,10 @@ let
wrapProgram $out/bin/npins --prefix PATH : "${runtimePath}"
'';

postInstall = ''
ln -s $out/bin/npins $out/bin/npins-pkgs
'';

meta.tests = pkgs.callPackage ./test.nix { npins = self; };
};
in
Expand Down
Loading

0 comments on commit 49b8467

Please sign in to comment.