From 934e7afcb846b7bf90c05c404011a28fde6c73ab Mon Sep 17 00:00:00 2001 From: Jack O'Sullivan Date: Sun, 17 Apr 2022 16:01:07 +0100 Subject: [PATCH] home-manager/common: Use new upstream nix.settings to configure Nix --- home-manager/configs/castle.nix | 3 ++- home-manager/configs/macsimum.nix | 3 ++- home-manager/modules/common.nix | 33 ++++++++++++------------------- 3 files changed, 17 insertions(+), 22 deletions(-) diff --git a/home-manager/configs/castle.nix b/home-manager/configs/castle.nix index 3c9963c..0d83069 100644 --- a/home-manager/configs/castle.nix +++ b/home-manager/configs/castle.nix @@ -15,7 +15,6 @@ hostname = "h.nul.ie"; sshOpts = [ "-4" "-p" "8022" ]; }; - nix.config.cores = "16"; }; home.packages = with pkgs; [ @@ -23,6 +22,8 @@ mame ]; + nix.settings.cores = 16; + programs = { ssh.matchBlocks = { home = { diff --git a/home-manager/configs/macsimum.nix b/home-manager/configs/macsimum.nix index 3bca8e8..fd9259a 100644 --- a/home-manager/configs/macsimum.nix +++ b/home-manager/configs/macsimum.nix @@ -9,9 +9,10 @@ { my = { deploy.enable = false; - nix.config.cores = "6"; }; + nix.settings.cores = 6; + programs = { ssh.enable = false; }; diff --git a/home-manager/modules/common.nix b/home-manager/modules/common.nix index 7b0e9b9..113c8d1 100644 --- a/home-manager/modules/common.nix +++ b/home-manager/modules/common.nix @@ -19,11 +19,6 @@ in shell = mkOpt' str null "User's shell (so NixOS or others can set it externally)."; fishCompletionsFrequency = mkOpt' (nullOr str) "daily" "How often to generate fish completions from manpages."; - nix = { - # TODO: Until https://github.com/nix-community/home-manager/issues/2324 - config = mkOpt' (attrsOf str) { } "nix.conf options"; - }; - ssh = { authKeys = { literal = mkOpt' (listOf singleLineStr) [ ] "List of OpenSSH keys to allow"; @@ -37,13 +32,20 @@ in }; config = mkMerge [ (mkIf (versionAtLeast config.home.stateVersion "22.05") { - nix.registry = { - pkgs = { - to = { - type = "path"; - path = toString pkgs.path; + nix = { + package = pkgs.nix; + registry = { + pkgs = { + to = { + type = "path"; + path = toString pkgs.path; + }; + exact = true; }; - exact = true; + }; + settings = { + experimental-features = [ "nix-command" "flakes" "ca-derivations" ]; + max-jobs = mkDefault "auto"; }; }; }) @@ -52,11 +54,6 @@ in isStandalone = !(args ? osConfig); shell = mkDefault "${config.programs.fish.package}/bin/fish"; - - nix.config = { - experimental-features = mkDefault "nix-command flakes ca-derivations"; - max-jobs = mkDefault "auto"; - }; }; home.file.".ssh/authorized_keys" = with config.my.ssh.authKeys; @@ -67,10 +64,6 @@ in ''; }; - xdg.configFile."nix/nix.conf" = mkIf (config.my.nix.config != { }) { - text = (concatStringsSep "\n" (mapAttrsToList (k: v: "${k} = ${v}") config.my.nix.config)) + "\n"; - }; - programs = { # Even when enabled this will only be actually installed in standalone mode # Note: `home-manager.path` is for telling home-manager is installed and setting it in NIX_PATH, which we should