From f10911f9d6a934f7ddd87b77d372592381fc9ea0 Mon Sep 17 00:00:00 2001 From: zimbatm Date: Fri, 28 Aug 2020 14:25:38 +0200 Subject: [PATCH] add support for `nix develop` (#159) Co-authored-by: Rok Garbas --- flake.lock | 18 +++++++++--------- flake.nix | 19 ++++++++----------- overlay.nix | 7 +++++++ 3 files changed, 24 insertions(+), 20 deletions(-) create mode 100644 overlay.nix diff --git a/flake.lock b/flake.lock index 4fd260e..9476ae3 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1595175601, - "narHash": "sha256-NMxaD3mdKyp+6nidFkZe7XOzVXtWMpOH1v4KYZxo/Z0=", + "lastModified": 1597943282, + "narHash": "sha256-G/VQBlqO7YeFOSvn29RqdvABZxmQBtiRYVA6kjqWZ6o=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5717d9d2f7ca0662291910c52f1d7b95b568fec2", + "rev": "c59ea8b8a0e7f927e7291c14ea6cd1bd3a16ff38", "type": "github" }, "original": { @@ -17,11 +17,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1595619256, - "narHash": "sha256-TOSvHwfQevzE/uTFBWYAt1I/F9F3YRkOV8gUrqUQfkk=", + "lastModified": 1598616250, + "narHash": "sha256-NB4mVmsYo8I3f3I2rz9skUdlhjtNCXFReyKvNhAk+T4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "fd0febffda9af90d6d369ecb4cb9aaf347116bce", + "rev": "86fa61033a96d3b58838bb399cc16514a0b5c71e", "type": "github" }, "original": { @@ -34,11 +34,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1595517229, - "narHash": "sha256-5eMk3+Twb2fDyFX5sm33JYSRaPAvKe9vHV5w/HjbiHs=", + "lastModified": 1598458730, + "narHash": "sha256-rTt9Jgj1x9HizutceLrraLxLPgLLwQERUwEvToV7CtQ=", "owner": "nix-community", "repo": "poetry2nix", - "rev": "270a0b26b773e566ad59927c51d40a5e9b8ff08d", + "rev": "6f1cc3a0784520bfc43fd49257ee5a9b57b166b6", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 5ff5858..d3d8db7 100644 --- a/flake.nix +++ b/flake.nix @@ -10,25 +10,22 @@ let systems = [ "x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux" ]; forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system); - allPackages = system: + mkPackage = path: system: let pkgs = import nixpkgs { inherit system; - overlays = [ - poetry2nix.overlay - ]; + overlays = [ poetry2nix.overlay ]; }; in + import path { inherit pkgs; }; + packages = system: { - import_scripts = import ./import-scripts { - inherit pkgs; - }; - frontend = import ./. { - inherit pkgs; - }; + import_scripts = mkPackage ./import-scripts system; + frontend = mkPackage ./. system; }; in { - packages = forAllSystems allPackages; + defaultPackage = forAllSystems (mkPackage ./.); + packages = forAllSystems packages; }; } diff --git a/overlay.nix b/overlay.nix new file mode 100644 index 0000000..cad0b00 --- /dev/null +++ b/overlay.nix @@ -0,0 +1,7 @@ +final: prev: +{ + nixos-search = { + frontend = import ./. { pkgs = prev; }; + import_scripts = import ./import-scripts { pkgs = prev; }; + }; +}