From 41c18930577c170f4a26691a7630799793f99d7a Mon Sep 17 00:00:00 2001 From: Frantisek Bohacek Date: Sat, 14 Oct 2023 21:28:39 +0200 Subject: [PATCH] feat: pin channels and registry --- hosts/configuration.nix | 7 ++++++- hosts/home.nix | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/hosts/configuration.nix b/hosts/configuration.nix index d1733ca..a6c4df4 100644 --- a/hosts/configuration.nix +++ b/hosts/configuration.nix @@ -145,6 +145,12 @@ }; nix = { # Nix Package Manager settings + registry.nixpkgs.flake = inputs.nixpkgs; + nixPath = [ + "nixpkgs=flake:nixpkgs" + "nixpkgs-stable=flake:nixpkgs-stable" + ]; + settings = { auto-optimise-store = true; # Optimise syslinks substituters = [ @@ -161,7 +167,6 @@ options = "--delete-older-than 2d"; }; package = pkgs.nixVersions.unstable; # Enable nixFlakes on system - registry.nixpkgs.flake = inputs.nixpkgs; extraOptions = '' experimental-features = nix-command flakes keep-outputs = true diff --git a/hosts/home.nix b/hosts/home.nix index 9c2b893..43a47ce 100644 --- a/hosts/home.nix +++ b/hosts/home.nix @@ -11,7 +11,7 @@ # └─ default.nix # -{ config, lib, nix-index-database, nixpkgs, stable, pkgs, user, location, ... }: +{ config, lib, nix-index-database, nixpkgs, inputs, stable, pkgs, user, location, ... }: { imports = # Home Manager Modules @@ -21,6 +21,11 @@ (import ../modules/services/home.nix); nixpkgs.config.allowUnfree = true; + nix = { + registry.nixpkgs.flake = inputs.nixpkgs; + }; + home.sessionVariables.NIX_PATH = + "nixpkgs=flake:nixpkgs$\{NIX_PATH:+:$NIX_PATH}"; xdg = { userDirs = let dir = s: "${config.home.homeDirectory}/${s}"; in { -- 2.48.1