summary refs log tree commit diff
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2023-10-28 15:29:35 +0200
committerJörg Thalheim <Mic92@users.noreply.github.com>2023-11-02 12:39:05 +0100
commitaf459e624ee596f0729b3f709affbed188a03a52 (patch)
tree6a6617ab6f000ae0ae490fa34c007b24a2beb758
parentfa804edfb7869c9fb230e174182a8a1a7e512c40 (diff)
downloadnixpkgs-af459e624ee596f0729b3f709affbed188a03a52.tar
nixpkgs-af459e624ee596f0729b3f709affbed188a03a52.tar.gz
nixpkgs-af459e624ee596f0729b3f709affbed188a03a52.tar.bz2
nixpkgs-af459e624ee596f0729b3f709affbed188a03a52.tar.lz
nixpkgs-af459e624ee596f0729b3f709affbed188a03a52.tar.xz
nixpkgs-af459e624ee596f0729b3f709affbed188a03a52.tar.zst
nixpkgs-af459e624ee596f0729b3f709affbed188a03a52.zip
installer/cd-dvd/channel: stop using lib
the lack of with allows lsp's to spot errors better
-rw-r--r--nixos/modules/installer/cd-dvd/channel.nix8
1 files changed, 3 insertions, 5 deletions
diff --git a/nixos/modules/installer/cd-dvd/channel.nix b/nixos/modules/installer/cd-dvd/channel.nix
index 8426ba8fac0..b97534d34dd 100644
--- a/nixos/modules/installer/cd-dvd/channel.nix
+++ b/nixos/modules/installer/cd-dvd/channel.nix
@@ -3,8 +3,6 @@
 
 { config, lib, pkgs, ... }:
 
-with lib;
-
 let
   # This is copied into the installer image, so it's important that it is filtered
   # to avoid including a large .git directory.
@@ -27,7 +25,7 @@ let
       if [ ! -e $out/nixos/nixpkgs ]; then
         ln -s . $out/nixos/nixpkgs
       fi
-      ${optionalString (config.system.nixos.revision != null) ''
+      ${lib.optionalString (config.system.nixos.revision != null) ''
         echo -n ${config.system.nixos.revision} > $out/nixos/.git-revision
       ''}
       echo -n ${config.system.nixos.versionSuffix} > $out/nixos/.version-suffix
@@ -47,14 +45,14 @@ in
 
   # Provide the NixOS/Nixpkgs sources in /etc/nixos.  This is required
   # for nixos-install.
-  boot.postBootCommands = mkAfter
+  boot.postBootCommands = lib.mkAfter
     ''
       if ! [ -e /var/lib/nixos/did-channel-init ]; then
         echo "unpacking the NixOS/Nixpkgs sources..."
         mkdir -p /nix/var/nix/profiles/per-user/root
         ${config.nix.package.out}/bin/nix-env -p /nix/var/nix/profiles/per-user/root/channels \
           -i ${channelSources} --quiet --option build-use-substitutes false \
-          ${optionalString config.boot.initrd.systemd.enable "--option sandbox false"} # There's an issue with pivot_root
+          ${lib.optionalString config.boot.initrd.systemd.enable "--option sandbox false"} # There's an issue with pivot_root
         mkdir -m 0700 -p /root/.nix-defexpr
         ln -s /nix/var/nix/profiles/per-user/root/channels /root/.nix-defexpr/channels
         mkdir -m 0755 -p /var/lib/nixos