home-manager/common: Use new upstream nix.settings to configure Nix

This commit is contained in:
Jack O'Sullivan 2022-04-17 16:01:07 +01:00
parent c02f50e5bc
commit 934e7afcb8
3 changed files with 17 additions and 22 deletions
home-manager

@ -15,7 +15,6 @@
hostname = "h.nul.ie"; hostname = "h.nul.ie";
sshOpts = [ "-4" "-p" "8022" ]; sshOpts = [ "-4" "-p" "8022" ];
}; };
nix.config.cores = "16";
}; };
home.packages = with pkgs; [ home.packages = with pkgs; [
@ -23,6 +22,8 @@
mame mame
]; ];
nix.settings.cores = 16;
programs = { programs = {
ssh.matchBlocks = { ssh.matchBlocks = {
home = { home = {

@ -9,9 +9,10 @@
{ {
my = { my = {
deploy.enable = false; deploy.enable = false;
nix.config.cores = "6";
}; };
nix.settings.cores = 6;
programs = { programs = {
ssh.enable = false; ssh.enable = false;
}; };

@ -19,11 +19,6 @@ in
shell = mkOpt' str null "User's shell (so NixOS or others can set it externally)."; 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."; 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 = { ssh = {
authKeys = { authKeys = {
literal = mkOpt' (listOf singleLineStr) [ ] "List of OpenSSH keys to allow"; literal = mkOpt' (listOf singleLineStr) [ ] "List of OpenSSH keys to allow";
@ -37,13 +32,20 @@ in
}; };
config = mkMerge [ config = mkMerge [
(mkIf (versionAtLeast config.home.stateVersion "22.05") { (mkIf (versionAtLeast config.home.stateVersion "22.05") {
nix.registry = { nix = {
pkgs = { package = pkgs.nix;
to = { registry = {
type = "path"; pkgs = {
path = toString pkgs.path; 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); isStandalone = !(args ? osConfig);
shell = mkDefault "${config.programs.fish.package}/bin/fish"; 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; 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 = { programs = {
# Even when enabled this will only be actually installed in standalone mode # 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 # Note: `home-manager.path` is for telling home-manager is installed and setting it in NIX_PATH, which we should