mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-14 11:57:34 +00:00
Update def and implementation of nix.package
to match NixOS module
Also remove `nix.version` option since it's no longer being used anywhere, old irrelevant `nix-info` module, and all support for legacy `nix.profile` option.
This commit is contained in:
parent
490ef80485
commit
5f141365af
4 changed files with 15 additions and 48 deletions
|
@ -10,7 +10,6 @@ in
|
||||||
options = {
|
options = {
|
||||||
|
|
||||||
networking.networkservices = mkOption { internal = true; default = null; };
|
networking.networkservices = mkOption { internal = true; default = null; };
|
||||||
nix.profile = mkOption { internal = true; default = null; };
|
|
||||||
security.enableAccessibilityAccess = mkOption { internal = true; default = null; };
|
security.enableAccessibilityAccess = mkOption { internal = true; default = null; };
|
||||||
security.accessibilityPrograms = mkOption { internal = true; default = null; };
|
security.accessibilityPrograms = mkOption { internal = true; default = null; };
|
||||||
|
|
||||||
|
@ -19,8 +18,7 @@ in
|
||||||
config = {
|
config = {
|
||||||
|
|
||||||
assertions =
|
assertions =
|
||||||
[ { assertion = config.nix.profile == null; message = "nix.profile was renamed to nix.package"; }
|
[ { assertion = config.security.enableAccessibilityAccess == null; message = "security.enableAccessibilityAccess was removed, it's broken since 10.12 because of SIP"; }
|
||||||
{ assertion = config.security.enableAccessibilityAccess == null; message = "security.enableAccessibilityAccess was removed, it's broken since 10.12 because of SIP"; }
|
|
||||||
{ assertion = config.system.activationScripts.extraPostActivation.text == ""; message = "system.activationScripts.extraPostActivation was renamed to system.activationScripts.postActivation"; }
|
{ assertion = config.system.activationScripts.extraPostActivation.text == ""; message = "system.activationScripts.extraPostActivation was renamed to system.activationScripts.postActivation"; }
|
||||||
{ assertion = config.system.activationScripts.extraUserPostActivation.text == ""; message = "system.activationScripts.extraUserPostActivation was renamed to system.activationScripts.postUserActivation"; }
|
{ assertion = config.system.activationScripts.extraUserPostActivation.text == ""; message = "system.activationScripts.extraUserPostActivation was renamed to system.activationScripts.postUserActivation"; }
|
||||||
];
|
];
|
||||||
|
@ -31,8 +29,6 @@ in
|
||||||
|
|
||||||
networking.knownNetworkServices = mkIf (config.networking.networkservices != null) config.networking.networkservices;
|
networking.knownNetworkServices = mkIf (config.networking.networkservices != null) config.networking.networkservices;
|
||||||
|
|
||||||
nix.package = mkIf (config.nix.profile != null) config.nix.profile;
|
|
||||||
|
|
||||||
system.activationScripts.extraPostActivation.text = mkDefault "";
|
system.activationScripts.extraPostActivation.text = mkDefault "";
|
||||||
system.activationScripts.extraUserPostActivation.text = mkDefault "";
|
system.activationScripts.extraUserPostActivation.text = mkDefault "";
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,6 @@
|
||||||
./networking
|
./networking
|
||||||
./nix
|
./nix
|
||||||
./nix/nix-darwin.nix
|
./nix/nix-darwin.nix
|
||||||
./nix/nix-info.nix
|
|
||||||
./nix/nixpkgs.nix
|
./nix/nixpkgs.nix
|
||||||
./environment
|
./environment
|
||||||
./fonts
|
./fonts
|
||||||
|
|
|
@ -6,7 +6,7 @@ let
|
||||||
|
|
||||||
cfg = config.nix;
|
cfg = config.nix;
|
||||||
|
|
||||||
isNix20 = versionAtLeast (cfg.version or "<unknown>") "1.12pre";
|
nixPackage = cfg.package.out;
|
||||||
|
|
||||||
nixConf =
|
nixConf =
|
||||||
let
|
let
|
||||||
|
@ -61,9 +61,10 @@ let
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = mapAttrsToList (oldConf: newConf:
|
imports = [
|
||||||
mkRenamedOptionModule [ "nix" oldConf ] [ "nix" "settings" newConf ]
|
(mkRemovedOptionModule [ "nix" "profile" ] "Use `nix.package` instead.")
|
||||||
) legacyConfMappings;
|
(mkRemovedOptionModule [ "nix" "version" ] "Consider using `nix.package.version` instead.")
|
||||||
|
] ++ mapAttrsToList (oldConf: newConf: mkRenamedOptionModule [ "nix" oldConf ] [ "nix" "settings" newConf ]) legacyConfMappings;
|
||||||
|
|
||||||
###### interface
|
###### interface
|
||||||
|
|
||||||
|
@ -72,26 +73,14 @@ in
|
||||||
nix = {
|
nix = {
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
type = types.either types.package types.path;
|
type = types.package;
|
||||||
default = pkgs.nix;
|
default = pkgs.nix;
|
||||||
defaultText = "pkgs.nix";
|
defaultText = literalExpression "pkgs.nix";
|
||||||
example = literalExpression "pkgs.nixUnstable";
|
|
||||||
description = ''
|
description = ''
|
||||||
This option specifies the package or profile that contains the version of Nix to use throughout the system.
|
This option specifies the Nix package instance to use throughout the system.
|
||||||
To keep the version of nix originally installed the default profile can be used.
|
|
||||||
|
|
||||||
eg. /nix/var/nix/profiles/default
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# Not in NixOS module
|
|
||||||
version = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
default = "<unknown>";
|
|
||||||
example = "1.11.6";
|
|
||||||
description = "The version of nix. Used to determine what settings to configure in nix.conf";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Not in NixOS module
|
# Not in NixOS module
|
||||||
useDaemon = mkOption {
|
useDaemon = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
|
@ -475,14 +464,12 @@ in
|
||||||
]))
|
]))
|
||||||
];
|
];
|
||||||
|
|
||||||
|
environment.systemPackages =
|
||||||
nix.package = mkIf (config.system.stateVersion < 3)
|
[
|
||||||
(mkDefault "/nix/var/nix/profiles/default");
|
nixPackage
|
||||||
|
pkgs.nix-info
|
||||||
nix.version = mkIf (isDerivation cfg.package) cfg.package.version or "<unknown>";
|
]
|
||||||
|
++ optional (config.programs.bash.enableCompletion) pkgs.nix-bash-completions;
|
||||||
environment.systemPackages = mkIf (isDerivation cfg.package)
|
|
||||||
[ cfg.package ];
|
|
||||||
|
|
||||||
environment.etc."nix/nix.conf".source = nixConf;
|
environment.etc."nix/nix.conf".source = nixConf;
|
||||||
|
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
{ config, lib, pkgs, ... }:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
let
|
|
||||||
nix-info = pkgs.nix-info or null;
|
|
||||||
in
|
|
||||||
|
|
||||||
{
|
|
||||||
config = {
|
|
||||||
|
|
||||||
environment.systemPackages = mkIf (nix-info != null) [ nix-info ];
|
|
||||||
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Reference in a new issue