{environment,nix}: remove references to $HOME
These can’t be relied upon in a post‐user‐activation world. Technically a breaking change, if anyone has their home directory outside of `/Users` or is using `root` for this, but, well, I did my best and these are legacy defaults anyway.
This commit is contained in:
parent
2892da83ea
commit
bed70a84af
3 changed files with 29 additions and 5 deletions
|
|
@ -1,4 +1,4 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ options, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
|
|
@ -75,7 +75,7 @@ in
|
|||
else if config.system.stateVersion >= 6 then
|
||||
"/etc/nix-darwin/configuration.nix"
|
||||
else
|
||||
"$HOME/.nixpkgs/darwin-configuration.nix";
|
||||
"${config.system.primaryUserHome}/.nixpkgs/darwin-configuration.nix";
|
||||
defaultText = literalExpression ''
|
||||
if config.nixpkgs.flake.setNixPath then
|
||||
# Don’t set this for flake‐based systems.
|
||||
|
|
@ -83,7 +83,7 @@ in
|
|||
else if config.system.stateVersion >= 6 then
|
||||
"/etc/nix-darwin/configuration.nix"
|
||||
else
|
||||
"$HOME/.nixpkgs/darwin-configuration.nix"
|
||||
"''${config.system.primaryUserHome}/.nixpkgs/darwin-configuration.nix"
|
||||
'';
|
||||
description = ''
|
||||
The path of the darwin configuration.nix used to configure the system,
|
||||
|
|
@ -175,6 +175,16 @@ in
|
|||
|
||||
config = {
|
||||
|
||||
# This is horrible, sorry.
|
||||
system.requiresPrimaryUser = mkIf (
|
||||
config.nix.enable
|
||||
&& !config.nixpkgs.flake.setNixPath
|
||||
&& config.system.stateVersion < 6
|
||||
&& options.environment.darwinConfig.highestPrio == (mkOptionDefault {}).priority
|
||||
) [
|
||||
"environment.darwinConfig"
|
||||
];
|
||||
|
||||
environment.systemPath = mkMerge [
|
||||
[ (makeBinPath cfg.profiles) ]
|
||||
(mkOrder 1200 [ "/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" ])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue