From cc6d8f0545958c05080ed295830cefa71212ff26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laure=CE=B7t?= Date: Wed, 29 Nov 2023 15:35:59 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20(hydrogen/system)=20format=20nix?= =?UTF-8?q?=20settings=20file=20+=20enable=20experimental=20features?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hosts/hydrogen/system/nix/default.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/hosts/hydrogen/system/nix/default.nix b/hosts/hydrogen/system/nix/default.nix index 4626f4b..9efa733 100644 --- a/hosts/hydrogen/system/nix/default.nix +++ b/hosts/hydrogen/system/nix/default.nix @@ -1,4 +1,4 @@ -{ ... }: { +{ lib, pkgs, nixpkgs, ... }: { # optimizations nix.settings.auto-optimise-store = true; @@ -8,4 +8,16 @@ dates = "weekly"; options = "--delete-older-than 30d"; }; + + # experimental features + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + # pin nixpkgs registry + nix.registry.nixpkgs.flake = nixpkgs; + + # print diff between two generations + system.activationScripts.nvd-report-changes = '' + PATH=$PATH:${lib.makeBinPath [ pkgs.nvd pkgs.nix ]} + nvd diff $(ls -dv /nix/var/nix/profiles/system-*-link | tail -2) + ''; }