mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 23:29:08 +01:00
Rename modules directory system to nixos
This commit is contained in:
parent
653a6f310b
commit
1c1b9221fc
48 changed files with 1 additions and 1 deletions
|
|
@ -1,44 +0,0 @@
|
|||
{
|
||||
config,
|
||||
inputs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.custom.persistence;
|
||||
in
|
||||
{
|
||||
imports = [ inputs.impermanence.nixosModules.impermanence ];
|
||||
|
||||
options.custom.persistence = {
|
||||
enable = lib.mkEnableOption "";
|
||||
directories = lib.mkOption {
|
||||
type = lib.types.listOf (lib.types.coercedTo lib.types.str (d: { directory = d; }) lib.types.attrs);
|
||||
default = [ ];
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
fileSystems."/persist".neededForBoot = true;
|
||||
|
||||
security.sudo.extraConfig = "Defaults lecture=never";
|
||||
|
||||
environment.persistence."/persist" = {
|
||||
hideMounts = true;
|
||||
|
||||
# See https://nixos.org/manual/nixos/stable/#ch-system-state
|
||||
directories = [
|
||||
"/var/lib/nixos"
|
||||
"/var/lib/systemd"
|
||||
"/var/log"
|
||||
]
|
||||
++ config.custom.persistence.directories;
|
||||
|
||||
files = [
|
||||
"/etc/machine-id"
|
||||
"/etc/ssh/ssh_host_ed25519_key"
|
||||
"/etc/ssh/ssh_host_ed25519_key.pub"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue