summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorMalo Bourgon <mbourgon@gmail.com>2022-08-13 14:17:44 -0700
committerMalo Bourgon <mbourgon@gmail.com>2022-08-16 10:41:51 -0700
commit5f141365afa8fcdd7fc7aee65031b850118f1bc0 (patch)
tree846b7a09364c9857667a186d3d813a77b607df2a /modules
parent490ef804858936eab2def7b0564f68a2e777d7d9 (diff)
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.
Diffstat (limited to 'modules')
-rw-r--r--modules/alias.nix6
-rw-r--r--modules/module-list.nix1
-rw-r--r--modules/nix/default.nix41
-rw-r--r--modules/nix/nix-info.nix15
4 files changed, 15 insertions, 48 deletions
diff --git a/modules/alias.nix b/modules/alias.nix
index d495d2f..cd7140f 100644
--- a/modules/alias.nix
+++ b/modules/alias.nix
@@ -10,7 +10,6 @@ in
options = {
networking.networkservices = mkOption { internal = true; default = null; };
- nix.profile = mkOption { internal = true; default = null; };
security.enableAccessibilityAccess = mkOption { internal = true; default = null; };
security.accessibilityPrograms = mkOption { internal = true; default = null; };
@@ -19,8 +18,7 @@ in
config = {
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.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;
- nix.package = mkIf (config.nix.profile != null) config.nix.profile;
-
system.activationScripts.extraPostActivation.text = mkDefault "";
system.activationScripts.extraUserPostActivation.text = mkDefault "";
diff --git a/modules/module-list.nix b/modules/module-list.nix
index d4c1b35..f8ec8dd 100644
--- a/modules/module-list.nix
+++ b/modules/module-list.nix
@@ -34,7 +34,6 @@
./networking
./nix
./nix/nix-darwin.nix
- ./nix/nix-info.nix
./nix/nixpkgs.nix
./environment
./fonts
diff --git a/modules/nix/default.nix b/modules/nix/default.nix
index 38e66e7..92b7d17 100644
--- a/modules/nix/default.nix
+++ b/modules/nix/default.nix
@@ -6,7 +6,7 @@ let
cfg = config.nix;
- isNix20 = versionAtLeast (cfg.version or "<unknown>") "1.12pre";
+ nixPackage = cfg.package.out;
nixConf =
let
@@ -61,9 +61,10 @@ let
in
{
- imports = mapAttrsToList (oldConf: newConf:
- mkRenamedOptionModule [ "nix" oldConf ] [ "nix" "settings" newConf ]
- ) legacyConfMappings;
+ imports = [
+ (mkRemovedOptionModule [ "nix" "profile" ] "Use `nix.package` instead.")
+ (mkRemovedOptionModule [ "nix" "version" ] "Consider using `nix.package.version` instead.")
+ ] ++ mapAttrsToList (oldConf: newConf: mkRenamedOptionModule [ "nix" oldConf ] [ "nix" "settings" newConf ]) legacyConfMappings;
###### interface
@@ -72,27 +73,15 @@ in
nix = {
package = mkOption {
- type = types.either types.package types.path;
+ type = types.package;
default = pkgs.nix;
- defaultText = "pkgs.nix";
- example = literalExpression "pkgs.nixUnstable";
+ defaultText = literalExpression "pkgs.nix";
description = ''
- This option specifies the package or profile that contains the version of Nix 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
+ This option specifies the Nix package instance to use throughout the system.
'';
};
# 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
useDaemon = mkOption {
type = types.bool;
default = false;
@@ -475,14 +464,12 @@ in
]))
];
-
- nix.package = mkIf (config.system.stateVersion < 3)
- (mkDefault "/nix/var/nix/profiles/default");
-
- nix.version = mkIf (isDerivation cfg.package) cfg.package.version or "<unknown>";
-
- environment.systemPackages = mkIf (isDerivation cfg.package)
- [ cfg.package ];
+ environment.systemPackages =
+ [
+ nixPackage
+ pkgs.nix-info
+ ]
+ ++ optional (config.programs.bash.enableCompletion) pkgs.nix-bash-completions;
environment.etc."nix/nix.conf".source = nixConf;
diff --git a/modules/nix/nix-info.nix b/modules/nix/nix-info.nix
deleted file mode 100644
index 146a08c..0000000
--- a/modules/nix/nix-info.nix
+++ /dev/null
@@ -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 ];
-
- };
-}