From 2adb43a97b30ddd30e5c03c485725b1b3241e2eb Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Wed, 28 Aug 2019 19:20:44 -0700 Subject: pin nixpkgs --- default.nix | 15 +++++++++++++++ install.sh | 10 ++++++---- nixpkgs.nix | 5 +++++ 3 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 default.nix create mode 100644 nixpkgs.nix diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..74f0940 --- /dev/null +++ b/default.nix @@ -0,0 +1,15 @@ +let + nixpkgs = builtins.fetchTarball (import ./nixpkgs.nix); + pkgs = import "${nixpkgs}" {}; +in +rec { + home-manager = pkgs.callPackage ./home-manager/home-manager { + path = toString ./home-manager; + }; + + install = pkgs.callPackage ./home-manager/home-manager/install.nix { + inherit home-manager; + }; + + nixos = import ./home-manager/nixos; +} diff --git a/install.sh b/install.sh index c6b9c35..1e8d2a9 100755 --- a/install.sh +++ b/install.sh @@ -9,18 +9,20 @@ NIXDIR="$HOME/.config/nixpkgs" HOMEFILE="$NIXDIR/home.nix" NIXFILE="$(pwd)/$1" # +# [[ -e "$HOMEFILE" ]] || ln -s "$NIXFILE" "$HOMEFILE" [[ -e "$NIXDIR/config.nix" ]] || ln -s "$(pwd)/lib/config.nix" "$NIXDIR/config.nix" # -# The notmuch config location is by default ~/.notmuch-config, but home-manager +# the notmuch config location is by default ~/.notmuch-config, but home-manager # puts it at ~/.config/notmuch/notmuchrc (which makes sense) and then sets -# NOTMUCH_CONFIG. However, if a program for some reason doesn't read +# NOTMUCH_CONFIG. however, if a program for some reason doesn't read # NOTMUCH_CONFIG (emacs), then it won't find the right config file, so I # override with a symlink. # mkdir -p ~/.config/notmuch [[ -e ~/.notmuch-config ]] || ln -s ~/.config/notmuch/notmuchrc ~/.notmuch-config # -# Symlinking must occur before initial generation +# symlinking must occur before initial generation. now we can install, and +# pin our own nixpkgs. # -nix-shell ./home-manager -A install +nix-shell ./default.nix -A install diff --git a/nixpkgs.nix b/nixpkgs.nix new file mode 100644 index 0000000..44d9065 --- /dev/null +++ b/nixpkgs.nix @@ -0,0 +1,5 @@ +# Get the sha256 with: nix-prefetch-url --unpack ${url} +{ + url = "https://github.com/NixOS/nixpkgs/archive/a59b6608f97a37761e0d516d22074c91f937d0f3.tar.gz"; + sha256 = "0i92z4rx7f9wy285mzr3kipj7hn400xvpdayzkylkhld1yclm67q"; +} -- cgit v1.2.3