os/impermanence: init

This commit is contained in:
Charlie Root 2024-09-02 22:26:06 +02:00
commit e5813bbbd6
3 changed files with 48 additions and 0 deletions

16
flake.lock generated
View file

@ -605,6 +605,21 @@
"type": "github" "type": "github"
} }
}, },
"impermanence": {
"locked": {
"lastModified": 1724489415,
"narHash": "sha256-ey8vhwY/6XCKoh7fyTn3aIQs7WeYSYtLbYEG87VCzX4=",
"owner": "nix-community",
"repo": "impermanence",
"rev": "c7f5b394397398c023000cf843986ee2571a1fd7",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "impermanence",
"type": "github"
}
},
"lix": { "lix": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -2683,6 +2698,7 @@
"home-manager": "home-manager", "home-manager": "home-manager",
"hyprland": "hyprland", "hyprland": "hyprland",
"hyprland-plugins": "hyprland-plugins", "hyprland-plugins": "hyprland-plugins",
"impermanence": "impermanence",
"lix-module": "lix-module", "lix-module": "lix-module",
"neovim-flake": "neovim-flake", "neovim-flake": "neovim-flake",
"nixpak": "nixpak", "nixpak": "nixpak",

View file

@ -50,6 +50,8 @@
helix.url = "github:helix-editor/helix"; helix.url = "github:helix-editor/helix";
impermanence.url = "github:nix-community/impermanence";
neovim-flake = { neovim-flake = {
url = "github:notashelf/nvf"; url = "github:notashelf/nvf";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";

View file

@ -0,0 +1,30 @@
{
inputs,
config,
lib,
...
}: let
inherit (lib) optionalString mkIf mkForce;
cfg = config.modules.system.impermanence;
in {
imports = [
inputs.impermanence.nixosModules.impermanence
];
environment.persistence."/persist" = {
directories = [
"/etc/nixos"
"/etc/nix"
"/etc/NetworkManager/system-connections"
"/var/db/sudo"
"/var/lib/bluetooth"
"/var/lib/nixos"
"/var/lib/pipewire"
"/var/lib/systemd/coredump"
];
files = [
"/etc/machine-id"
];
};
}