From 49fac325cd5cb7a2b5e20a814068dd9f70d7911a Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Thu, 14 Sep 2023 13:10:27 +0200 Subject: [PATCH] pinning nixpkgs with niv --- README.md | 16 ++++++++++++++++ hosts/yodaTab/configuration.nix | 2 +- hosts/yodaTux/configuration.nix | 2 +- hosts/yodaYoga/configuration.nix | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9a3c4e8..8f829eb 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,8 @@ sudo /run/current-system/bin/switch-to-configuration boot ## Dependency management with niv +* https://nix.dev/tutorials/first-steps/towards-reproducibility-pinning-nixpkgs#dependency-management-with-niv + niv: > Easy dependency management for Nix projects. @@ -122,6 +124,20 @@ Change the tracking branch of nixpkgs from unstable to 23.05: niv modify nixpkgs --branch nixos-23.05 ``` +Pinning Nixpkgs. At the top of your `configuration.nix` file, replace + +```nix +{ config, pkgs, ... }: +{} +``` + +with + +```nix +{ config, sources ? import ../../nix/sources.nix, pkgs ? import sources.nixpkgs {}, ... }: +{} +``` + ## Add Home Manager with niv Home Manager: diff --git a/hosts/yodaTab/configuration.nix b/hosts/yodaTab/configuration.nix index f3c9380..708c687 100644 --- a/hosts/yodaTab/configuration.nix +++ b/hosts/yodaTab/configuration.nix @@ -2,7 +2,7 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running `nixos-help`). -{ config, pkgs, ... }: +{ config, sources ? import ../../nix/sources.nix, pkgs ? import sources.nixpkgs {}, ... }: let # Import Home Manager with niv. home-manager = (import ../../nix/sources.nix).home-manager; diff --git a/hosts/yodaTux/configuration.nix b/hosts/yodaTux/configuration.nix index 9b0cfdd..d856ebc 100644 --- a/hosts/yodaTux/configuration.nix +++ b/hosts/yodaTux/configuration.nix @@ -2,7 +2,7 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running `nixos-help`). -{ config, pkgs, ... }: +{ config, sources ? import ../../nix/sources.nix, pkgs ? import sources.nixpkgs {}, ... }: let # Import Home Manager with niv. home-manager = (import ../../nix/sources.nix).home-manager; diff --git a/hosts/yodaYoga/configuration.nix b/hosts/yodaYoga/configuration.nix index 8e5278b..7b4d45a 100644 --- a/hosts/yodaYoga/configuration.nix +++ b/hosts/yodaYoga/configuration.nix @@ -2,7 +2,7 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running `nixos-help`). -{ config, pkgs, ... }: +{ config, sources ? import ../../nix/sources.nix, pkgs ? import sources.nixpkgs {}, ... }: let # Import Home Manager with niv. home-manager = (import ../../nix/sources.nix).home-manager;