-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into auto_update_deps
- Loading branch information
Showing
7 changed files
with
107 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,5 +78,6 @@ | |
''; | ||
}) | ||
); | ||
systemd.tmpfiles.rules = [ "D /var/tmp/system-manager 0755 root root -" ]; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
./environment.nix | ||
./etc.nix | ||
./systemd.nix | ||
./tmpfiles.nix | ||
./upstream/nixpkgs | ||
]; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ config, lib, ... }: | ||
let | ||
inherit (lib) types; | ||
in | ||
{ | ||
options = { | ||
systemd.tmpfiles.rules = lib.mkOption { | ||
type = types.listOf types.str; | ||
default = [ ]; | ||
example = [ "d /tmp 1777 root root 10d" ]; | ||
description = lib.mdDoc '' | ||
Rules for creation, deletion and cleaning of volatile and temporary files | ||
automatically. See | ||
{manpage}`tmpfiles.d(5)` | ||
for the exact format. | ||
''; | ||
}; | ||
}; | ||
|
||
config = { | ||
environment.etc."tmpfiles.d/00-system-manager.conf".text = '' | ||
# This file is created automatically and should not be modified. | ||
# Please change the option ‘systemd.tmpfiles.rules’ instead. | ||
${lib.concatStringsSep "\n" config.systemd.tmpfiles.rules} | ||
''; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
use crate::activate; | ||
|
||
use super::ActivationResult; | ||
use std::process; | ||
|
||
type TmpFilesActivationResult = ActivationResult<()>; | ||
|
||
pub fn activate() -> TmpFilesActivationResult { | ||
let mut cmd = process::Command::new("systemd-tmpfiles"); | ||
cmd.arg("--create") | ||
.arg("--remove") | ||
.arg("/etc/tmpfiles.d/00-system-manager.conf"); | ||
let output = cmd | ||
.stdout(process::Stdio::inherit()) | ||
.stderr(process::Stdio::inherit()) | ||
.output() | ||
.expect("Error forking process"); | ||
|
||
output.status.success().then_some(()).ok_or_else(|| { | ||
activate::ActivationError::WithPartialResult { | ||
result: (), | ||
source: anyhow::anyhow!( | ||
"Error while creating tmpfiles\nstdout: {}\nstderr: {}", | ||
String::from_utf8_lossy(output.stdout.as_ref()), | ||
String::from_utf8_lossy(output.stderr.as_ref()) | ||
), | ||
} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters