Fixed nixpkgs by generating a function by system.
This commit is contained in:
1 parent
52cad66083
commit
bff94c383a
2 files changed
+93
-26
No files matched your search
Generated
+61
@@ -0,0 +1,61 @@
|
|||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"flake-utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681202837,
|
||||||
|
"narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "cfacdce06f30d2b68473a46042957675eebb3401",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1682692304,
|
||||||
|
"narHash": "sha256-9/lyXN2BpHw+1xE+D2ySBSLMCHWqiWu5tPHBMRDib8M=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "937a9d1ee7b1351d8c55fff6611a8edf6e7c1c37",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
||||||
@@ -3,33 +3,39 @@
|
|||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs }: {
|
outputs = { self, nixpkgs, flake-utils }:
|
||||||
writePythonApplication = {name, contentFile}: let
|
flake-utils.lib.eachDefaultSystem (system:
|
||||||
wrappedScript = pkgs.writeText "wrappedScript" (builtins.readFile contentFile);
|
let
|
||||||
in
|
pkgs = import nixpkgs { inherit system;};
|
||||||
pkgs.writeShellApplication {
|
in
|
||||||
name = name;
|
{
|
||||||
runtimeInputs = [
|
writePythonApplication = {name, contentFile}: let
|
||||||
wrappedScript
|
wrappedScript = pkgs.writeText "wrappedScript" (builtins.readFile contentFile);
|
||||||
pkgs.python311];
|
in
|
||||||
text = ''
|
pkgs.writeShellApplication {
|
||||||
exec ${pkgs.python38}/bin/python ${wrappedScript} "$@"
|
name = name;
|
||||||
'';
|
runtimeInputs = [
|
||||||
};
|
wrappedScript
|
||||||
|
pkgs.python311];
|
||||||
|
text = ''
|
||||||
|
exec ${pkgs.python38}/bin/python ${wrappedScript} "$@"
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
writeBabashkaApplication = {name, contentFile}: let
|
writeBabashkaApplication = {name, contentFile}: let
|
||||||
wrappedScript = pkgs.writeText "wrappedScript" (builtins.readFile contentFile);
|
wrappedScript = pkgs.writeText "wrappedScript" (builtins.readFile contentFile);
|
||||||
in
|
in
|
||||||
pkgs.writeShellApplication {
|
pkgs.writeShellApplication {
|
||||||
name = name;
|
name = name;
|
||||||
runtimeInputs = [
|
runtimeInputs = [
|
||||||
wrappedScript
|
wrappedScript
|
||||||
pkgs.babashka];
|
pkgs.babashka];
|
||||||
text = ''
|
text = ''
|
||||||
exec ${pkgs.babashka}/bin/bb ${wrappedScript} "$@"
|
exec ${pkgs.babashka}/bin/bb ${wrappedScript} "$@"
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
});
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user