diff --git a/flake.lock b/flake.lock index a328212..833755d 100644 --- a/flake.lock +++ b/flake.lock @@ -104,11 +104,11 @@ ] }, "locked": { - "lastModified": 1721266288, - "narHash": "sha256-MsyTzXu9CJVcBr44ct8ILKF/Ro7VlF+tVZTylzAoXSs=", + "lastModified": 1721417620, + "narHash": "sha256-6q9b1h8fI3hXg2DG6/vrKWCeG8c5Wj2Kvv22RCgedzg=", "owner": "nix-community", "repo": "disko", - "rev": "e8e8d9a3a9c1d0e654ccda7834bf0288a9d15c47", + "rev": "bec6e3cde912b8acb915fecdc509eda7c973fb42", "type": "github" }, "original": { @@ -818,11 +818,11 @@ ] }, "locked": { - "lastModified": 1721135958, - "narHash": "sha256-H548rpPMsn25LDKn1PCFmPxmWlClJJGnvdzImHkqjuY=", + "lastModified": 1721534365, + "narHash": "sha256-XpZOkaSJKdOsz1wU6JfO59Rx2fqtcarQ0y6ndIOKNpI=", "owner": "nix-community", "repo": "home-manager", - "rev": "afd2021bedff2de92dfce0e257a3d03ae65c603d", + "rev": "635563f245309ef5320f80c7ebcb89b2398d2949", "type": "github" }, "original": { @@ -852,6 +852,21 @@ "type": "github" } }, + "impermanence": { + "locked": { + "lastModified": 1719091691, + "narHash": "sha256-AxaLX5cBEcGtE02PeGsfscSb/fWMnyS7zMWBXQWDKbE=", + "owner": "nix-community", + "repo": "impermanence", + "rev": "23c1f06316b67cb5dabdfe2973da3785cfe9c34a", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "impermanence", + "type": "github" + } + }, "kernel-src": { "flake": false, "locked": { @@ -872,11 +887,11 @@ "lix": { "flake": false, "locked": { - "lastModified": 1721371213, - "narHash": "sha256-7SdrlNe5DBlK5uLBhPPxVRWI50N1PFz3zMBeDYiX0Qs=", + "lastModified": 1721513673, + "narHash": "sha256-Tgdh7f1AB4D8aDw4obBwh0VYgZEcFBbjKZmMyolmnhw=", "ref": "refs/heads/main", - "rev": "aba5f19680b2f4c29d7ce2ff5e2a89128c1cb26d", - "revCount": 15985, + "rev": "1917e6c765b0b0012ed85a7a927db0bf83fb27ca", + "revCount": 15996, "type": "git", "url": "https://git@git.lix.systems/lix-project/lix" }, @@ -1004,11 +1019,11 @@ ] }, "locked": { - "lastModified": 1721270582, - "narHash": "sha256-MdZmYPPExntE5rJu88IhJSy8Um4UyZCTXhOwvzbjDVI=", + "lastModified": 1721550066, + "narHash": "sha256-wr6sSb+VpXy8HCvBqU6xvhpaARzWUbEK7uN5tLnqYDg=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "a3e4a7b8ffc08c7dc1973822a77ad432e1ec3dec", + "rev": "33bf7df5bbfcbbb49e6559b0c96c9e3b26d14e58", "type": "github" }, "original": { @@ -1048,11 +1063,11 @@ "nixpkgs": "nixpkgs_10" }, "locked": { - "lastModified": 1721140729, - "narHash": "sha256-f+RjBJ4BZ8Uv6QuQ/TEaA8crKP+Uw6DZXdtRY2EvwlQ=", + "lastModified": 1721541664, + "narHash": "sha256-hk9g7kuGqDz8TYAbX9R6IvLUDnE5UpxwLR41MZ5uTDU=", "owner": "nix-community", "repo": "nixd", - "rev": "334da32238a641c24ca7bff59d7a7d38c48fea06", + "rev": "963dd36863e18f942e90c66b2c76e7c161b61ff9", "type": "github" }, "original": { @@ -1063,11 +1078,11 @@ }, "nixosHardware": { "locked": { - "lastModified": 1721331912, - "narHash": "sha256-h2yaU+QEU4pHxMySHPIsRV2T/pihDHnrXBca8BY6xgc=", + "lastModified": 1721413321, + "narHash": "sha256-0GdiQScDceUrVGbxYpV819LHesK3szHOhJ09e6sgES4=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "bb90787ea034c8b9035dfcfc9b4dc23898d414be", + "rev": "ab165a8a6cd12781d76fe9cbccb9e975d0fb634f", "type": "github" }, "original": { @@ -1640,6 +1655,7 @@ "hercules-ci-effects": "hercules-ci-effects_3", "homeManager": "homeManager", "homeManagerGitWorkspace": "homeManagerGitWorkspace", + "impermanence": "impermanence", "lix": "lix", "lix-module": "lix-module", "mobile-nixos": "mobile-nixos", @@ -1807,11 +1823,11 @@ ] }, "locked": { - "lastModified": 1721382922, - "narHash": "sha256-GYpibTC0YYKRpFR9aftym9jjRdUk67ejw1IWiaQkaiU=", + "lastModified": 1721458737, + "narHash": "sha256-wNXLQ/ATs1S4Opg1PmuNoJ+Wamqj93rgZYV3Di7kxkg=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "50104496fb55c9140501ea80d183f3223d13ff65", + "rev": "888bfb10a9b091d9ed2f5f8064de8d488f7b7c97", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 2299602..7b754e0 100644 --- a/flake.nix +++ b/flake.nix @@ -68,6 +68,7 @@ flake = false; }; arion.url = "github:hercules-ci/arion"; + impermanence.url = "github:nix-community/impermanence"; }; outputs = inputs @ {flakeParts, ...}: diff --git a/hosts/default.nix b/hosts/default.nix index 7ec9a15..8adb65e 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -160,6 +160,7 @@ extraModules = with inputs; [ disko.nixosModules.disko arion.nixosModules.arion + impermanence.nixosModules.impermanence # lix-module.nixosModules.default # inputs.hercules-ci-agent.nixosModules.agent-service; # rock5b.nixosModules.default @@ -173,8 +174,8 @@ "home-planimetry".owner = "hass"; "cloudflare-dyndns-api-token" = {}; "restic-hetzner-password" = {}; - "minio-credentials".owner = "minio"; - "aws-credentials".owner = "hercules-ci-agent"; + # "minio-credentials".owner = "minio"; + # "aws-credentials".owner = "hercules-ci-agent"; "hass-ssh-key".owner = "hass"; # "matrix-registration-shared-secret".owner = "matrix-synapse"; # "matrix-sliding-sync-secret".owner = "matrix-synapse"; diff --git a/hosts/picard/default.nix b/hosts/picard/default.nix index 9b63f91..3dc217d 100644 --- a/hosts/picard/default.nix +++ b/hosts/picard/default.nix @@ -32,7 +32,7 @@ "restic" "binfmt" "greetd" - "syncthing" + # "syncthing" "hass-poweroff" "forgejo-runners" "teamviewer" diff --git a/hosts/sisko/default.nix b/hosts/sisko/default.nix index 760e9e4..6ec4fd2 100644 --- a/hosts/sisko/default.nix +++ b/hosts/sisko/default.nix @@ -13,7 +13,7 @@ "wireguard-server" "mediatomb" "transmission" - "hercules-ci" + # "hercules-ci" "home-assistant" "adguard-home" "cloudflare-dyndns" @@ -21,13 +21,13 @@ "invidious" "searx" "rock5b-samba" - "paperless" - "restic" - "syncthing" - "minio" - # "matrix" + # "paperless" + # "restic" + # "syncthing" + # "minio" + # # "matrix" "forgejo" - # "jellyfin" + # # "jellyfin" # "immich" ] ++ [ @@ -62,8 +62,6 @@ ccr.enable = true; - # services.rock5b-fan-control.enable = true; - nixpkgs.hostPlatform = "aarch64-linux"; swapDevices = []; @@ -84,26 +82,35 @@ "console=ttyS0,1500000" ]; - # fileSystems."/mnt/film" = { - # device = "//ccr.ydns.eu/film"; - # fsType = "cifs"; - # options = let - # credentials = pkgs.writeText "credentials" '' - # username=guest - # password= - # ''; - # in ["credentials=${credentials},x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"]; - # }; - # fileSystems."/mnt/archivio" = { - # device = "//ccr.ydns.eu/archivio"; - # fsType = "cifs"; - # options = let - # credentials = pkgs.writeText "credentials" '' - # username=guest - # password= - # ''; - # in ["credentials=${credentials},x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s"]; - # }; + environment.persistence."/persist" = { + hideMounts = true; + directories = [ + "/etc/NetworkManager/system-connections" + "/var/db/dhcpcd/" + "/var/lib/NetworkManager/" + "/var/lib/nixos" + "/var/lib/systemd" + "/var/lib/systemd/coredump" + "/var/log" + "/var/lib/containers" + "/var/lib/postgresql" + ]; + files = [ + "/etc/machine-id" + "/etc/ssh/ssh_host_ed25519_key" + "/etc/ssh/ssh_host_ed25519_key.pub" + "/etc/ssh/ssh_host_rsa_key" + "/etc/ssh/ssh_host_rsa_key.pub" + ]; + }; + + age.identityPaths = [ + "/persist/etc/ssh/ssh_host_ed25519_key" + "/persist/etc/ssh/ssh_host_rsa_key" + ]; + + fileSystems."/persist".neededForBoot = true; + boot.tmp.cleanOnBoot = true; fileSystems."/mnt/hd" = { device = "/dev/disk/by-id/ata-WDC_WD10EADS-22M2B0_WD-WCAV52709550-part1"; diff --git a/hosts/sisko/disko.nix b/hosts/sisko/disko.nix index 325dbcf..b1fda80 100644 --- a/hosts/sisko/disko.nix +++ b/hosts/sisko/disko.nix @@ -7,6 +7,10 @@ let # old_hd = "/dev/disk/by-id/ata-WDC_WD5000AAKX-08U6AA0_WD-WCC2E5TR40FU"; in { disko.devices = { + nodev."/" = { + fsType = "tmpfs"; + mountOptions = ["size=1024M" "defaults" "mode=755"]; + }; disk = { ssd = { device = ssd; @@ -17,20 +21,35 @@ in { ESP = { label = "ESP"; type = "EF00"; - size = "1G"; + size = "1024M"; content = { type = "filesystem"; format = "vfat"; mountpoint = "/boot"; }; }; - root = { - label = "root"; - size = "100%"; + nixroot = { + size = "100G"; content = { type = "filesystem"; format = "ext4"; - mountpoint = "/"; + mountpoint = "/nix"; + }; + }; + persist = { + size = "100G"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/persist"; + }; + }; + tmp = { + end = "0"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/tmp"; }; }; }; diff --git a/modules/forgejo/default.nix b/modules/forgejo/default.nix index 8a1f821..1365115 100644 --- a/modules/forgejo/default.nix +++ b/modules/forgejo/default.nix @@ -29,15 +29,11 @@ SHOW_FOOTER_VERSION = false; }; }; - mailerPasswordFile = config.age.secrets.autistici-password.path; + secrets.mailer.PASSWD = config.age.secrets.autistici-password.path; dump.enable = true; }; - systemd.tmpfiles.rules = [ - "d ${config.services.forgejo.stateDir} 770 forgejo forgejo" - ]; - - backup.paths = [ + environment.persistence."/persist".directories = [ config.services.forgejo.stateDir ]; diff --git a/modules/home-assistant/default.nix b/modules/home-assistant/default.nix index 99f86c7..b21f37c 100644 --- a/modules/home-assistant/default.nix +++ b/modules/home-assistant/default.nix @@ -210,8 +210,8 @@ in { }; }; - backup.paths = [ - "/var/lib/hass" + environment.persistence."/persist".directories = [ + config.services.home-assistant.configDir ]; # virtualisation.oci-containers = { diff --git a/modules/nginx-base/default.nix b/modules/nginx-base/default.nix index 8baeece..fa8dd61 100644 --- a/modules/nginx-base/default.nix +++ b/modules/nginx-base/default.nix @@ -16,4 +16,8 @@ recommendedProxySettings = true; recommendedTlsSettings = true; }; + + environment.persistence."/persist".directories = [ + "/var/lib/acme" + ]; }