Add 'old-conf/' from commit '62a64a79a8'
git-subtree-dir: old-conf git-subtree-mainline:4667974392git-subtree-split:62a64a79a8
This commit is contained in:
commit
83de52d5db
195 changed files with 13408 additions and 0 deletions
39
old-conf/nixos-modules/system/persist.nix
Normal file
39
old-conf/nixos-modules/system/persist.nix
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{ config, lib, pkgs, inputs, ... }:
|
||||
let
|
||||
cfg = config.ragon.persist;
|
||||
in
|
||||
{
|
||||
options.ragon.persist.enable = lib.mkEnableOption "Enables persistence";
|
||||
options.ragon.persist.extraFiles = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
};
|
||||
options.ragon.persist.extraDirectories = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.anything;
|
||||
default = [ ];
|
||||
};
|
||||
options.ragon.persist.baseDir = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "/persistent";
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
|
||||
environment.persistence.${cfg.baseDir} = {
|
||||
directories = [
|
||||
"/etc/nixos"
|
||||
"/etc/NetworkManager/system-connections"
|
||||
"/var/lib/nixos"
|
||||
"/root/.ssh"
|
||||
] ++ (lib.unique cfg.extraDirectories);
|
||||
files = [
|
||||
"/etc/machine-id"
|
||||
"/etc/ssh/ssh_host_rsa_key"
|
||||
"/etc/ssh/ssh_host_rsa_key.pub"
|
||||
"/etc/ssh/ssh_host_ed25519_key"
|
||||
"/etc/ssh/ssh_host_ed25519_key.pub"
|
||||
] ++ cfg.extraFiles;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue