add support for nix develop (#159)

Co-authored-by: Rok Garbas <rok@garbas.si>
This commit is contained in:
zimbatm 2020-08-28 14:25:38 +02:00 committed by GitHub
parent 8175e2be62
commit f10911f9d6
Failed to generate hash of commit
3 changed files with 24 additions and 20 deletions

View file

@ -2,11 +2,11 @@
"nodes": { "nodes": {
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1595175601, "lastModified": 1597943282,
"narHash": "sha256-NMxaD3mdKyp+6nidFkZe7XOzVXtWMpOH1v4KYZxo/Z0=", "narHash": "sha256-G/VQBlqO7YeFOSvn29RqdvABZxmQBtiRYVA6kjqWZ6o=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "5717d9d2f7ca0662291910c52f1d7b95b568fec2", "rev": "c59ea8b8a0e7f927e7291c14ea6cd1bd3a16ff38",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -17,11 +17,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1595619256, "lastModified": 1598616250,
"narHash": "sha256-TOSvHwfQevzE/uTFBWYAt1I/F9F3YRkOV8gUrqUQfkk=", "narHash": "sha256-NB4mVmsYo8I3f3I2rz9skUdlhjtNCXFReyKvNhAk+T4=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "fd0febffda9af90d6d369ecb4cb9aaf347116bce", "rev": "86fa61033a96d3b58838bb399cc16514a0b5c71e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -34,11 +34,11 @@
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_2"
}, },
"locked": { "locked": {
"lastModified": 1595517229, "lastModified": 1598458730,
"narHash": "sha256-5eMk3+Twb2fDyFX5sm33JYSRaPAvKe9vHV5w/HjbiHs=", "narHash": "sha256-rTt9Jgj1x9HizutceLrraLxLPgLLwQERUwEvToV7CtQ=",
"owner": "nix-community", "owner": "nix-community",
"repo": "poetry2nix", "repo": "poetry2nix",
"rev": "270a0b26b773e566ad59927c51d40a5e9b8ff08d", "rev": "6f1cc3a0784520bfc43fd49257ee5a9b57b166b6",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -10,25 +10,22 @@
let let
systems = [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" ]; systems = [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" ];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system); forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
allPackages = system: mkPackage = path: system:
let let
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
overlays = [ overlays = [ poetry2nix.overlay ];
poetry2nix.overlay
];
}; };
in in
import path { inherit pkgs; };
packages = system:
{ {
import_scripts = import ./import-scripts { import_scripts = mkPackage ./import-scripts system;
inherit pkgs; frontend = mkPackage ./. system;
};
frontend = import ./. {
inherit pkgs;
};
}; };
in in
{ {
packages = forAllSystems allPackages; defaultPackage = forAllSystems (mkPackage ./.);
packages = forAllSystems packages;
}; };
} }

7
overlay.nix Normal file
View file

@ -0,0 +1,7 @@
final: prev:
{
nixos-search = {
frontend = import ./. { pkgs = prev; };
import_scripts = import ./import-scripts { pkgs = prev; };
};
}