summary refs log tree commit diff
path: root/nixos/modules/installer/tools/nixos-generate-config.pl
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-05-25 14:56:28 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-05-25 18:04:34 +0200
commitc6ab4ab20613150dab0496958e21c14bbe0ca350 (patch)
treeca2151c79f28cb37573aad496f4079ff2de09ce7 /nixos/modules/installer/tools/nixos-generate-config.pl
parentfa1b9ec1e637252b522bcd5a23ab6fc4edc53333 (diff)
downloadnixpkgs-c6ab4ab20613150dab0496958e21c14bbe0ca350.tar
nixpkgs-c6ab4ab20613150dab0496958e21c14bbe0ca350.tar.gz
nixpkgs-c6ab4ab20613150dab0496958e21c14bbe0ca350.tar.bz2
nixpkgs-c6ab4ab20613150dab0496958e21c14bbe0ca350.tar.lz
nixpkgs-c6ab4ab20613150dab0496958e21c14bbe0ca350.tar.xz
nixpkgs-c6ab4ab20613150dab0496958e21c14bbe0ca350.tar.zst
nixpkgs-c6ab4ab20613150dab0496958e21c14bbe0ca350.zip
nixos-generate-config: Enable strictness
Diffstat (limited to 'nixos/modules/installer/tools/nixos-generate-config.pl')
-rw-r--r--nixos/modules/installer/tools/nixos-generate-config.pl10
1 files changed, 6 insertions, 4 deletions
diff --git a/nixos/modules/installer/tools/nixos-generate-config.pl b/nixos/modules/installer/tools/nixos-generate-config.pl
index 8e75f8d3c40..ed6c1b2dcd3 100644
--- a/nixos/modules/installer/tools/nixos-generate-config.pl
+++ b/nixos/modules/installer/tools/nixos-generate-config.pl
@@ -1,5 +1,6 @@
 #! @perl@
 
+use strict;
 use Cwd 'abs_path';
 use File::Spec;
 use File::Path;
@@ -69,6 +70,7 @@ for (my $n = 0; $n < scalar @ARGV; $n++) {
 my @attrs = ();
 my @kernelModules = ();
 my @initrdKernelModules = ();
+my @initrdAvailableKernelModules = ();
 my @modulePackages = ();
 my @imports;
 
@@ -379,7 +381,7 @@ EOF
     # Is this a btrfs filesystem?
     if ($fsType eq "btrfs") {
         my ($status, @id_info) = runCommand("btrfs subvol show $rootDir$mountPoint");
-        if ($status != 0 || join("", @msg) =~ /ERROR:/) {
+        if ($status != 0 || join("", @id_info) =~ /ERROR:/) {
             die "Failed to retrieve subvolume info for $mountPoint\n";
         }
         my @ids = join("", @id_info) =~ m/Subvolume ID:[ \t\n]*([^ \t\n]*)/;
@@ -440,7 +442,7 @@ sub toNixList {
 sub multiLineList {
     my $indent = shift;
     return " [ ]" if !@_;
-    $res = "\n${indent}[ ";
+    my $res = "\n${indent}[ ";
     my $first = 1;
     foreach my $s (@_) {
         $res .= "$indent  " if !$first;
@@ -494,7 +496,7 @@ if ($showHardwareConfig) {
     if ($force || ! -e $fn) {
         print STDERR "writing $fn...\n";
 
-        my $bootloaderConfig = "";
+        my $bootLoaderConfig = "";
         if (-e "/sys/firmware/efi/efivars") {
             $bootLoaderConfig = <<EOF;
   # Use the gummiboot efi boot loader.
@@ -568,7 +570,7 @@ $bootLoaderConfig
   # };
 
   # The NixOS release to be compatible with for stateful data such as databases.
-  system.stateVersion = "@nixosRelease@";
+  system.stateVersion = "${\(qw(@nixosRelease@))}";
 
 }
 EOF