From e1231e1341f7ce9ab499f0b7bf952d2981da3d9b Mon Sep 17 00:00:00 2001 From: Nicolas Mattia Date: Mon, 28 Jan 2019 19:48:51 +0100 Subject: [PATCH] Clean up nix files --- default.nix | 19 ++----------------- nix/default.nix | 12 ++++++++++++ shell.nix | 4 ++++ 3 files changed, 18 insertions(+), 17 deletions(-) create mode 100644 nix/default.nix create mode 100644 shell.nix diff --git a/default.nix b/default.nix index e61aa12..40abcf6 100644 --- a/default.nix +++ b/default.nix @@ -1,17 +1,2 @@ -with { fetch = import ./nix/fetch.nix; }; -let - - # The (pinned) Nixpkgs where the original packages are sourced from - pkgs = import fetch.nixpkgs {}; - - # The list of packages to be installed - shellPackages = [ snack-exe ]; - - snack-exe = (import fetch.snack).snack-exe; - snack-lib = (import fetch.snack).snack-lib; -in - if pkgs.lib.inNixShell - then pkgs.mkShell - { buildInputs = shellPackages; - } - else snack-lib.inferHPackBuild ./package.yaml +with { pkgs = import ./nix; }; +pkgs.snack-lib.inferHPackBuild ./package.yaml diff --git a/nix/default.nix b/nix/default.nix new file mode 100644 index 0000000..85ef4c4 --- /dev/null +++ b/nix/default.nix @@ -0,0 +1,12 @@ +with { fetch = import ./fetch.nix; }; +import fetch.nixpkgs + { overlays = + [ (self: super: + { + snack-exe = (import fetch.snack).snack-exe; + snack-lib = (import fetch.snack).snack-lib; + } + ) + ] ; + config = { } ; + } diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..834168e --- /dev/null +++ b/shell.nix @@ -0,0 +1,4 @@ +with { pkgs = import ./nix; }; +pkgs.mkShell + { buildInputs = [ pkgs.snack-exe ]; + }