From 5981a6010b1f5f99cb0592980d975d9b6ec837b9 Mon Sep 17 00:00:00 2001 From: Gabriel Fontes Date: Fri, 5 Aug 2022 22:55:29 -0300 Subject: [PATCH] remove profile activation, add channel sync to default nixos config --- minimal/nixos/configuration.nix | 16 ++++++++-------- standard/nixos/configuration.nix | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/minimal/nixos/configuration.nix b/minimal/nixos/configuration.nix index bfc6edb..3bd757e 100644 --- a/minimal/nixos/configuration.nix +++ b/minimal/nixos/configuration.nix @@ -18,15 +18,15 @@ # You can also split up your configuration and import pieces of it here. ]; - # This will add your inputs as registries, making operations with them (such - # as nix shell nixpkgs#name) consistent with your flake inputs. - nix.registry = lib.mapAttrs' (n: v: lib.nameValuePair n { flake = v; }) inputs; + nix = { + # This will add each flake input as a registry + # To make nix3 commands consistent with your flake + registry = lib.mapAttrs (_: value: { flake = value; }) inputs; - # Will activate home-manager profiles for each user upon login - # This is useful when using ephemeral installations - environment.loginShellInit = '' - [ -d "$HOME/.nix-profile" ] || /nix/var/nix/profiles/per-user/$USER/home-manager/activate &> /dev/null - ''; + # This will additionally add your inputs to the system's legacy channels + # Making legacy nix commands consistent as well, awesome! + nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry; + }; nix = { settings = { diff --git a/standard/nixos/configuration.nix b/standard/nixos/configuration.nix index bfc6edb..3bd757e 100644 --- a/standard/nixos/configuration.nix +++ b/standard/nixos/configuration.nix @@ -18,15 +18,15 @@ # You can also split up your configuration and import pieces of it here. ]; - # This will add your inputs as registries, making operations with them (such - # as nix shell nixpkgs#name) consistent with your flake inputs. - nix.registry = lib.mapAttrs' (n: v: lib.nameValuePair n { flake = v; }) inputs; + nix = { + # This will add each flake input as a registry + # To make nix3 commands consistent with your flake + registry = lib.mapAttrs (_: value: { flake = value; }) inputs; - # Will activate home-manager profiles for each user upon login - # This is useful when using ephemeral installations - environment.loginShellInit = '' - [ -d "$HOME/.nix-profile" ] || /nix/var/nix/profiles/per-user/$USER/home-manager/activate &> /dev/null - ''; + # This will additionally add your inputs to the system's legacy channels + # Making legacy nix commands consistent as well, awesome! + nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry; + }; nix = { settings = {