summary refs log tree commit diff
path: root/nixos/modules/config
diff options
context:
space:
mode:
authorRobert Hensing <roberth@users.noreply.github.com>2023-07-25 11:25:15 +0200
committerGitHub <noreply@github.com>2023-07-25 11:25:15 +0200
commitc9f9df2f8eff13e7577b3a143e3c47b5223e8084 (patch)
treed52d449d6be9962f4ccd9824b7ac8c10cc97d32a /nixos/modules/config
parent27112e1822f9a35e240ec203cc144300bc25757a (diff)
parentb825f65c90107d5ae49cb5fdcd0c52532f60fc42 (diff)
downloadnixpkgs-c9f9df2f8eff13e7577b3a143e3c47b5223e8084.tar
nixpkgs-c9f9df2f8eff13e7577b3a143e3c47b5223e8084.tar.gz
nixpkgs-c9f9df2f8eff13e7577b3a143e3c47b5223e8084.tar.bz2
nixpkgs-c9f9df2f8eff13e7577b3a143e3c47b5223e8084.tar.lz
nixpkgs-c9f9df2f8eff13e7577b3a143e3c47b5223e8084.tar.xz
nixpkgs-c9f9df2f8eff13e7577b3a143e3c47b5223e8084.tar.zst
nixpkgs-c9f9df2f8eff13e7577b3a143e3c47b5223e8084.zip
Merge pull request #245038 from R-VdP/fix_nix_channel
 nixos/nix-channel: only try to remove the nix-channel binary if it exists
Diffstat (limited to 'nixos/modules/config')
-rw-r--r--nixos/modules/config/nix-channel.nix14
1 files changed, 7 insertions, 7 deletions
diff --git a/nixos/modules/config/nix-channel.nix b/nixos/modules/config/nix-channel.nix
index 8f6caaabde8..3f8e088ede9 100644
--- a/nixos/modules/config/nix-channel.nix
+++ b/nixos/modules/config/nix-channel.nix
@@ -3,8 +3,8 @@
   configuration to work.
 
   See also
-   - ./nix.nix
-   - ./nix-flakes.nix
+  - ./nix.nix
+  - ./nix-flakes.nix
  */
 { config, lib, ... }:
 let
@@ -28,9 +28,9 @@ in
             Whether the `nix-channel` command and state files are made available on the machine.
 
             The following files are initialized when enabled:
-             - `/nix/var/nix/profiles/per-user/root/channels`
-             - `/root/.nix-channels`
-             - `$HOME/.nix-defexpr/channels` (on login)
+              - `/nix/var/nix/profiles/per-user/root/channels`
+              - `/root/.nix-channels`
+              - `$HOME/.nix-defexpr/channels` (on login)
 
             Disabling this option will not remove the state files from the system.
           '';
@@ -48,7 +48,7 @@ in
             "nixos-config=/etc/nixos/configuration.nix"
             "/nix/var/nix/profiles/per-user/root/channels"
           ]
-          else [];
+          else [ ];
         defaultText = ''
           if nix.channel.enable
           then [
@@ -86,7 +86,7 @@ in
       '';
 
     environment.extraSetup = mkIf (!cfg.channel.enable) ''
-      rm $out/bin/nix-channel
+      rm --force $out/bin/nix-channel
     '';
 
     # NIX_PATH has a non-empty default according to Nix docs, so we don't unset