diff --git a/flake.nix b/flake.nix index 09b5671..63203f7 100644 --- a/flake.nix +++ b/flake.nix @@ -49,8 +49,35 @@ home-manager.nixosModules.home-manager { home-manager.useUserPackages = true; - home-manager.users.yaroslav = import ./home/yaroslav/Aphelion/Aphelion.nix; - } + home-manager.users.yaroslav = { + imports = [ + impermanence.homeManagerModules.home-manager + "./home/yaroslav/Aphelion/Aphelion.nix" + ]; + home.persistence."/nix/persist/home" = { + directories = [ + "Downloads" + "Music" + "Pictures" + "Documents" + "Videos" + ".ssh" + "nixos" + ".local/share/keyrings" + ".local/share/nicotine" + ".local/share/mpd" + ".config/nicotine" + ".mozilla" + ".local/share/AyuGramDesktop" + ]; + files = [ + ".p10k.zsh" + ".zsh_history" + + ]; + }; + }; + } ]; }; }; diff --git a/hosts/Aphelion/hardware-Aphelion.nix b/hosts/Aphelion/hardware-Aphelion.nix index e273e14..5246899 100644 --- a/hosts/Aphelion/hardware-Aphelion.nix +++ b/hosts/Aphelion/hardware-Aphelion.nix @@ -29,6 +29,12 @@ options = [ "subvol=@nix" ]; }; + fileSystems."/nix/persist/home" = + { + device = "/dev/disk/by-uuid/3126fadd-b793-4110-bcb7-577b7978cba2"; + fsType = "btrfs"; + options = [ "compress=zstd" "subvol=@home-persist" ]; + }; fileSystems."/boot" = { device = "/dev/disk/by-uuid/595C-784B"; fsType = "vfat"; @@ -43,7 +49,7 @@ fileSystems."/vol/Trash" = { device = "/dev/mapper/yarikpc-trash"; fsType = "ext4"; - options = [ "defaults" "size=1G" "uid=1000" "gid=100" ]; + options = [ "defaults" ]; }; swapDevices = [ ]; @@ -57,10 +63,17 @@ # networking.interfaces.lxdbr0.useDHCP = lib.mkDefault true; # networking.interfaces.veth9787cb37.useDHCP = lib.mkDefault true; # networking.interfaces.virbr0.useDHCP = lib.mkDefault true; - systemd.tmpfiles.rules = [ - "d /vol/Trash - yaroslav users - -" - ]; - + boot.initrd.systemd.tmpfiles.settings = { + "100-mountpoint-Trash" = { + "/vol/Trash" = { + d = { + user = "root"; + mode = "0770"; + group = "users"; + }; + }; + }; + }; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; diff --git a/hosts/generic/users.nix b/hosts/generic/users.nix index 160cebd..1819e28 100644 --- a/hosts/generic/users.nix +++ b/hosts/generic/users.nix @@ -3,11 +3,14 @@ { users.users.yaroslav = { isNormalUser = true; - extraGroups = [ "wheel" "incus-admin" "networkmanager" "libvirtd" ]; # Enable ‘sudo’ for the user. + extraGroups = [ "wheel" "incus-admin" "networkmanager" "libvirtd" ]; shell = pkgs.zsh; packages = with pkgs; [ tree ]; initialHashedPassword = "$6$.r5fJE91KtrOA2T.$JVjtzlFWx.RsTsNmO5WOsi1MhK6TUTKo8K5F2GgG.bAXYuYjGu4sK3SMzhk4oJ9FBoAcnyHmk7sLMsgLbUeoE1"; }; + users.users.root = { + initialHashedPassword = "$y$j9T$eS.via4Hx/iPNJKAFbVah/$aHFf172uH6UYrSXPMrnbaFkAQ2o8AnJcYd4JgX1/of5"; + }; }