From 6e5876f2fff248c095858975ec0b04455aa7964a Mon Sep 17 00:00:00 2001 From: Rouven Seifert Date: Sat, 20 May 2023 13:20:05 +0200 Subject: [PATCH] impermanence test --- flake.lock | 28 ++++++++++++++++++----- flake.nix | 4 ++++ hosts/thinkpad/default.nix | 10 ++++++++ hosts/thinkpad/hardware-configuration.nix | 10 ++++---- users/rouven/default.nix | 1 + users/rouven/modules/packages.nix | 2 +- 6 files changed, 43 insertions(+), 12 deletions(-) diff --git a/flake.lock b/flake.lock index 3c426db..b924c71 100644 --- a/flake.lock +++ b/flake.lock @@ -77,6 +77,21 @@ "type": "github" } }, + "impermanence": { + "locked": { + "lastModified": 1684264534, + "narHash": "sha256-K0zr+ry3FwIo3rN2U/VWAkCJSgBslBisvfRIPwMbuCQ=", + "owner": "nix-community", + "repo": "impermanence", + "rev": "89253fb1518063556edd5e54509c30ac3089d5e6", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "impermanence", + "type": "github" + } + }, "nix-colors": { "inputs": { "base16-schemes": "base16-schemes", @@ -179,11 +194,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1684481515, - "narHash": "sha256-sDMEZ4HLP6sVNiBcgla3KWihdDjh67DP5ZWkGKWFgY0=", + "lastModified": 1684528365, + "narHash": "sha256-2b5IfkV6WPZ3S9SgIajbftinfGlBnwUwOcmLiyCck+w=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5b1bc788f578cd83d54b48bb057d6f6703ae7725", + "rev": "5ae23a806c7cb16e2ade63400d0c6e5aa8e54797", "type": "github" }, "original": { @@ -216,6 +231,7 @@ "inputs": { "home-manager": "home-manager", "hyprland": "hyprland", + "impermanence": "impermanence", "nix-colors": "nix-colors", "nix-index-database": "nix-index-database", "nixos-hardware": "nixos-hardware", @@ -233,11 +249,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1684032930, - "narHash": "sha256-ueeSYDii2e5bkKrsSdP12JhkW9sqgYrUghLC8aDfYGQ=", + "lastModified": 1684571352, + "narHash": "sha256-342PCrDSZ70qVX5hwz1M0cYNBdEcIBVzxyjrU/Um3RU=", "owner": "Mic92", "repo": "sops-nix", - "rev": "a376127bb5277cd2c337a9458744f370aaf2e08d", + "rev": "df8b52249e78a0ac33680c9e0b7a029ec22cd8f5", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 7b53d0e..8e451a6 100644 --- a/flake.nix +++ b/flake.nix @@ -12,6 +12,8 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + impermanence.url = "github:nix-community/impermanence"; + home-manager = { inputs = { nixpkgs.follows = "nixpkgs"; @@ -38,6 +40,7 @@ , nix-index-database , hyprland , sops-nix + , impermanence , nix-colors , nixos-hardware , purge @@ -61,6 +64,7 @@ home-manager.nixosModules.home-manager sops-nix.nixosModules.sops nix-index-database.nixosModules.nix-index + impermanence.nixosModules.impermanence { home-manager.extraSpecialArgs = attrs; home-manager.users.rouven = { diff --git a/hosts/thinkpad/default.nix b/hosts/thinkpad/default.nix index 2e300fc..19255cc 100755 --- a/hosts/thinkpad/default.nix +++ b/hosts/thinkpad/default.nix @@ -23,6 +23,16 @@ auto-optimise-store = true; }; + environment.persistence."/nix/persist/system" = { + directories = [ + "/etc/nixos" # bind mounted from /nix/persist/system/etc/nixos to /etc/nixos + "/etc/ssh" + ]; + files = [ + "/etc/machine-id" + ]; + }; + time.timeZone = "Europe/Berlin"; i18n.defaultLocale = "en_US.UTF-8"; console = { diff --git a/hosts/thinkpad/hardware-configuration.nix b/hosts/thinkpad/hardware-configuration.nix index 3465a43..8475af0 100644 --- a/hosts/thinkpad/hardware-configuration.nix +++ b/hosts/thinkpad/hardware-configuration.nix @@ -24,9 +24,9 @@ fileSystems."/" = { - device = "/dev/disk/by-uuid/3d44cde5-17a2-4023-b9ae-3a02ae68aa81"; - fsType = "btrfs"; - options = [ "subvol=root" "compress=zstd" "discard=async" "noatime" ]; + device = "tmpfs"; + fsType = "tmpfs"; + options = [ "size=3G" "mode=755" ]; }; @@ -51,11 +51,11 @@ options = [ "subvol=log" "compress=zstd" "discard=async" "noatime" ]; }; - fileSystems."/nix/store" = + fileSystems."/nix" = { device = "/dev/disk/by-uuid/3d44cde5-17a2-4023-b9ae-3a02ae68aa81"; fsType = "btrfs"; - options = [ "subvol=store" "compress=zstd" "discard=async" "noatime" ]; + options = [ "subvol=nix" "compress=zstd" "discard=async" "noatime" ]; }; fileSystems."/boot" = diff --git a/users/rouven/default.nix b/users/rouven/default.nix index 21eedba..c27aa2a 100644 --- a/users/rouven/default.nix +++ b/users/rouven/default.nix @@ -5,6 +5,7 @@ users.users.rouven = { isNormalUser = true; extraGroups = [ "wheel" "video" "libvirtd" ]; + initialHashedPassword = "$6$X3XERQv28Nt1UUT5$MjdMBDuXyEwexkuKqmNFweez69q4enY5cjMXSbBxOc6Bq7Fhhp7OqmCm02k3OGjoZFXzPV9ZHuMSGKZOtwYIk1"; }; home-manager.useUserPackages = true; home-manager.useGlobalPkgs = true; diff --git a/users/rouven/modules/packages.nix b/users/rouven/modules/packages.nix index 6b26d6c..88638bb 100644 --- a/users/rouven/modules/packages.nix +++ b/users/rouven/modules/packages.nix @@ -41,7 +41,7 @@ yubikey-manager yubikey-manager-qt yubioath-flutter - bitwarden + # bitwarden # misc neofetch # obligatory