Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions nixos/modules/services/misc/nix-daemon.nix
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,8 @@ in
// { CURL_CA_BUNDLE = "/etc/ssl/certs/ca-bundle.crt"; }
// config.networking.proxy.envVars;

unitConfig.RequiresMountsFor = "/nix/store";

serviceConfig =
{ Nice = cfg.daemonNiceLevel;
IOSchedulingPriority = cfg.daemonIONiceLevel;
Expand Down
14 changes: 7 additions & 7 deletions nixos/modules/system/activation/switch-to-configuration.pl
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,12 @@ sub fingerprintUnit {

sub pathToUnitName {
my ($path) = @_;
die unless substr($path, 0, 1) eq "/";
return "-" if $path eq "/";
$path = substr($path, 1);
$path =~ s/\//-/g;
# FIXME: handle - and unprintable characters.
return $path;
open my $cmd, "-|", "systemd-escape", "--suffix=mount", "-p", $path
or die "Unable to escape $path!\n";
my $escaped = join "", <$cmd>;
chomp $escaped;
close $cmd or die;
return $escaped;
}

sub unique {
Expand All @@ -290,7 +290,7 @@ sub unique {
foreach my $mountPoint (keys %$prevFss) {
my $prev = $prevFss->{$mountPoint};
my $new = $newFss->{$mountPoint};
my $unit = pathToUnitName($mountPoint) . ".mount";
my $unit = pathToUnitName($mountPoint);
if (!defined $new) {
# Filesystem entry disappeared, so unmount it.
$unitsToStop{$unit} = 1;
Expand Down