Browse Source

update nix packaging

main
Milan 5 months ago
parent
commit
24a408d416
Signed by: petabyteboy GPG Key ID: A6DC6A7CB0B97859
  1. 7
      nix/backend.nix
  2. 4
      nix/default.nix
  3. 22
      nix/sources.json
  4. 5
      nix/sources.nix

7
nix/backend.nix

@ -1,4 +1,4 @@
{ lib, naersk
{ lib, ever-given
, srcDir ?
lib.cleanSourceWith {
filter = lib.cleanSourceFilter;
@ -6,12 +6,13 @@
filter =
name: type: !(lib.hasInfix "frontend" name)
&& !(lib.hasInfix "target" name)
&& !(lib.hasInfix "config.yaml" name);
&& !(lib.hasInfix "config.yaml" name)
&& !(lib.hasInfix "nix" name);
src = ../.;
};
}
}:
naersk.buildPackage {
ever-given.buildRustPackage {
src = srcDir;
}

4
nix/default.nix

@ -5,9 +5,7 @@
let
callPackage = pkgs.lib.callPackageWith (pkgs // newpkgs);
newpkgs = {
naersk = callPackage sources.naersk {
inherit (pkgs.xorg) lndir;
};
ever-given = callPackage sources.ever-given {};
rusty-lg-backend = callPackage ./backend.nix {};
rusty-lg-frontend = callPackage ./frontend.nix {};
};

22
nix/sources.json

@ -1,14 +1,14 @@
{
"naersk": {
"branch": "master",
"description": "Build rust crates in Nix. No configuration, no code generation, no IFD. Sandbox friendly.",
"ever-given": {
"branch": "main",
"description": "Minimalistic Nix expression to track Rust dependencies [maintainer=@petabyteboy]",
"homepage": "",
"owner": "nmattia",
"repo": "naersk",
"rev": "ce273fa593dcc94a629d0d869f07d96d2b337e37",
"sha256": "1hx47l7gfim0cs9fn8r91wwl0641wi2fdq67ygb4ydx7msb8sm6h",
"owner": "nix-community",
"repo": "ever-given",
"rev": "1eda41085a1a29ca608591edc5926ee71657bb27",
"sha256": "1h76gqvb8ij43hcx4lbq06vnb84ixk872402dvisv47yqi5wigp4",
"type": "tarball",
"url": "https://github.com/nmattia/naersk/archive/ce273fa593dcc94a629d0d869f07d96d2b337e37.tar.gz",
"url": "https://github.com/nix-community/ever-given/archive/1eda41085a1a29ca608591edc5926ee71657bb27.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"niv": {
@ -29,10 +29,10 @@
"homepage": "",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "78942ee55f933ce76a3c65bbe83a8a5733d0fb78",
"sha256": "1w7vmqry1ggfxs6xpwirsws7nai8ksg5ywc9y2ix85lwkhanhqiq",
"rev": "e694182338984855c6446a222f91b827f5faf126",
"sha256": "04mj7kasb8y76sqdr58w1lhmh3gbb4lzymjc5yc9x9n1nh6jwg5g",
"type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/78942ee55f933ce76a3c65bbe83a8a5733d0fb78.tar.gz",
"url": "https://github.com/NixOS/nixpkgs/archive/e694182338984855c6446a222f91b827f5faf126.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
}
}

5
nix/sources.nix

@ -98,7 +98,10 @@ let
saneName = stringAsChars (c: if isNull (builtins.match "[a-zA-Z0-9]" c) then "_" else c) name;
ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}";
in
if ersatz == "" then drv else ersatz;
if ersatz == "" then drv else
# this turns the string into an actual Nix path (for both absolute and
# relative paths)
if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}";
# Ports of functions for older nix versions

Loading…
Cancel
Save