From 76ca66f59c9882fee5687128d5db307cf6676057 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Sun, 20 Jan 2019 17:04:34 +0100 Subject: [PATCH] Pin and make the project structure conform more to todomvc-nix This makes the Nix files work like todomvc-nix but a little simplified. Also it pins nixpkgs because for development (tests), you need -unstable instead of release-18.09 so that's automatic now. --- default.nix | 5 ++--- nix/default.nix | 13 +++++++++++++ nix/nixpkgs.nix | 5 +++++ nix/overlay.nix | 4 ++++ pkgs.nix | 3 --- 5 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 nix/default.nix create mode 100644 nix/nixpkgs.nix create mode 100644 nix/overlay.nix delete mode 100644 pkgs.nix diff --git a/default.nix b/default.nix index 226f2a6..8a370c0 100644 --- a/default.nix +++ b/default.nix @@ -1,6 +1,5 @@ -{ pkgs ? import ./pkgs.nix }: +args@{ pkgs ? import ./nix args, ... }: { - inherit (pkgs) arion; - tests = pkgs.callPackage ./tests {}; + inherit (pkgs) arion tests; } diff --git a/nix/default.nix b/nix/default.nix new file mode 100644 index 0000000..4c25cf1 --- /dev/null +++ b/nix/default.nix @@ -0,0 +1,13 @@ +/** + * This is the entry-point for all nix execution in this project. + */ +{ nixpkgsSrc ? ./nixpkgs.nix, ... }: +import (import ./nixpkgs.nix) { + # Makes the config pure as well. See /top-level/impure.nix: + config = { + }; + overlays = [ + # all the packages are defined there: + (import ./overlay.nix) + ]; +} diff --git a/nix/nixpkgs.nix b/nix/nixpkgs.nix new file mode 100644 index 0000000..4c64290 --- /dev/null +++ b/nix/nixpkgs.nix @@ -0,0 +1,5 @@ +# to update: $ nix-prefetch-url --unpack url +builtins.fetchTarball { + url = "https://github.com/NixOS/nixpkgs/archive/be445a9074f139d63e704fa82610d25456562c3d.tar.gz"; + sha256 = "15dc7gdspimavcwyw9nif4s59v79gk18rwsafylffs9m1ld2dxwa"; +} diff --git a/nix/overlay.nix b/nix/overlay.nix new file mode 100644 index 0000000..7386daa --- /dev/null +++ b/nix/overlay.nix @@ -0,0 +1,4 @@ +self: super: { + arion = super.callPackage ../arion.nix {}; + tests = super.callPackage ../tests {}; +} diff --git a/pkgs.nix b/pkgs.nix deleted file mode 100644 index f608d1a..0000000 --- a/pkgs.nix +++ /dev/null @@ -1,3 +0,0 @@ -import { - overlays = [ (self: super: { arion = super.callPackage ./arion.nix {}; }) ]; -}