diff --git a/flake.in.nix b/flake.in.nix index f5466f1..9b674a4 100644 --- a/flake.in.nix +++ b/flake.in.nix @@ -20,7 +20,7 @@ type = "git"; }; in { - determinate = mkCustomUrl "https://flakehub.com/f/DeterminateSystems/determinate/0.1"; + determinate = mkInput "DeterminateSystems/determinate"; agenix = mkInput "ryantm/agenix"; catppuccin = mkInput "catppuccin/nix"; chaotic = mkInput "chaotic-cx/nyx/nyxpkgs-unstable"; diff --git a/flake.lock b/flake.lock index e0b4180..6315820 100644 --- a/flake.lock +++ b/flake.lock @@ -41,11 +41,11 @@ ] }, "locked": { - "lastModified": 1729527199, - "narHash": "sha256-D5/YksfRga8Akd04ZtIkuYSIOjXVrAzQIQBSeplokzU=", + "lastModified": 1730968822, + "narHash": "sha256-NocDjINsh6ismkhb0Xr6xPRksmhuB2WGf8ZmXMhxu7Y=", "owner": "hyprwm", "repo": "aquamarine", - "rev": "8d732fa8aff8b12ef2b1e2f00fc8153e41312b72", + "rev": "a49bc3583ff223f426cb3526fdaa4bcaa247ec14", "type": "github" }, "original": { @@ -72,11 +72,11 @@ }, "catppuccin": { "locked": { - "lastModified": 1730458408, - "narHash": "sha256-JQ+SphQn13bdibKUrBBBznYehXX4xJrxD1ifBp6vSWw=", + "lastModified": 1731232837, + "narHash": "sha256-0aIwr/RC/oe7rYkfJb47xjdEQDSNcqpFGsEa+EPlDEs=", "owner": "catppuccin", "repo": "nix", - "rev": "191fbf2d81a63fad8f62f1233c0051f09b75d0ad", + "rev": "32359bf226fe874d3b7a0a5753d291a4da9616fe", "type": "github" }, "original": { @@ -93,11 +93,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1730893653, - "narHash": "sha256-TZtKnKWwjuQbmf6PW8gvTQaQpliYO23b6ZtTsPGNT0o=", + "lastModified": 1731286286, + "narHash": "sha256-7jpkIFzw+dHqtn6/iPHQLnxk6X4RdTwaE03ivRulmaY=", "owner": "chaotic-cx", "repo": "nyx", - "rev": "a6f76172ccff493ced03c4c9f443eef671ccc634", + "rev": "363a6f38bc9a634e7431a5623194757b3f8c68a1", "type": "github" }, "original": { @@ -136,11 +136,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1730943699, - "narHash": "sha256-Z1atKXmCKjniZkF1Wn8amNHbMmsVO24r5psLp9XnUbo=", + "lastModified": 1731210504, + "narHash": "sha256-QE5qfTcJk1XBwTxoW3nJ2PWJ/YRppy8IiwsqLwnu4A0=", "owner": "lilyinstarlight", "repo": "nixos-cosmic", - "rev": "77f7a41adaf314680d322a8303f12b180b33961c", + "rev": "aa9d41c105d715974b86f8cf64f84e0995d5e747", "type": "github" }, "original": { @@ -178,11 +178,11 @@ ] }, "locked": { - "lastModified": 1730878299, - "narHash": "sha256-0VIz/3PKaylSIoRdOE07kkT1tMXgqaybXrfIS2Xz+so=", + "lastModified": 1731153869, + "narHash": "sha256-3Ftf9oqOypcEyyrWJ0baVkRpvQqroK/SVBFLvU3nPuc=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "98e7dba87238e4fa4eac609dc44f07dab40661c4", + "rev": "5c74ab862c8070cbf6400128a1b56abb213656da", "type": "github" }, "original": { @@ -207,14 +207,15 @@ "locked": { "lastModified": 1730754837, "narHash": "sha256-09/CM5Bwx06/emGO6qFvhTsQB2lQNzURk/SjQ8nbQIo=", + "owner": "DeterminateSystems", + "repo": "determinate", "rev": "61819e490d85ff68680def6f2b0d7ee602857078", - "revCount": 150, - "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/DeterminateSystems/determinate/0.1.150%2Brev-61819e490d85ff68680def6f2b0d7ee602857078/0192f90a-ec21-7c78-a3a3-7ddf7abdc50e/source.tar.gz" + "type": "github" }, "original": { - "type": "tarball", - "url": "https://flakehub.com/f/DeterminateSystems/determinate/0.1" + "owner": "DeterminateSystems", + "repo": "determinate", + "type": "github" } }, "determinate-nixd-aarch64-darwin": { @@ -885,11 +886,11 @@ ] }, "locked": { - "lastModified": 1730633670, - "narHash": "sha256-ZFJqIXpvVKvzOVFKWNRDyIyAo+GYdmEPaYi1bZB6uf0=", + "lastModified": 1730837930, + "narHash": "sha256-0kZL4m+bKBJUBQse0HanewWO0g8hDdCvBhudzxgehqc=", "owner": "nix-community", "repo": "home-manager", - "rev": "8f6ca7855d409aeebe2a582c6fd6b6a8d0bf5661", + "rev": "2f607e07f3ac7e53541120536708e824acccfaa8", "type": "github" }, "original": { @@ -905,11 +906,11 @@ ] }, "locked": { - "lastModified": 1730837930, - "narHash": "sha256-0kZL4m+bKBJUBQse0HanewWO0g8hDdCvBhudzxgehqc=", + "lastModified": 1731235328, + "narHash": "sha256-NjavpgE9/bMe/ABvZpyHIUeYF1mqR5lhaep3wB79ucs=", "owner": "nix-community", "repo": "home-manager", - "rev": "2f607e07f3ac7e53541120536708e824acccfaa8", + "rev": "60bb110917844d354f3c18e05450606a435d2d10", "type": "github" }, "original": { @@ -983,11 +984,11 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1730935817, - "narHash": "sha256-cvTFdvEyJ5yxB7s8t/Wd27h/N/XEjJqfG5SlM2Tq9PA=", + "lastModified": 1731279191, + "narHash": "sha256-9gJ3G8j9yUmzZdluh3fZoSN4qj/Y4XZgl2hsa8sdCwg=", "ref": "refs/heads/main", - "rev": "2ec2b3bfb39ba22ba945bb23dc95970dfa50eb5a", - "revCount": 5423, + "rev": "c10739e6e35c30ef5f273bfe5d219d361a31e226", + "revCount": 5438, "submodules": true, "type": "git", "url": "https://github.com/hyprwm/Hyprland" @@ -1015,11 +1016,11 @@ ] }, "locked": { - "lastModified": 1730755630, - "narHash": "sha256-IA5U8lHx/lnHwbx25dpPpeLbaALqNNjalYCf19tIoj0=", + "lastModified": 1731169722, + "narHash": "sha256-hOljwsXpY4Y6guvcr51tWCnXo6c56yaBknnLXk1m3Vk=", "owner": "hyprwm", "repo": "hyprland-plugins", - "rev": "44859f877739c05d031fcab4a2991ec004fa9bc4", + "rev": "844eb98250da448e17471f20beed23a5f5d33a3a", "type": "github" }, "original": { @@ -1094,11 +1095,11 @@ ] }, "locked": { - "lastModified": 1728941256, - "narHash": "sha256-WRypmcZ2Bw94lLmcmxYokVOHPJSZ7T06V49QZ4tkZeQ=", + "lastModified": 1731163338, + "narHash": "sha256-Qflei0JBeqQ0c8jxA8e982xAxJvfMwfx4Aci2eJi84s=", "owner": "hyprwm", "repo": "hyprutils", - "rev": "fd4be8b9ca932f7384e454bcd923c5451ef2aa85", + "rev": "60d3dece30f98e8ad85131829c8529950630d6bc", "type": "github" }, "original": { @@ -1134,11 +1135,11 @@ }, "impermanence": { "locked": { - "lastModified": 1730403150, - "narHash": "sha256-W1FH5aJ/GpRCOA7DXT/sJHFpa5r8sq2qAUncWwRZ3Gg=", + "lastModified": 1731242966, + "narHash": "sha256-B3C3JLbGw0FtLSWCjBxU961gLNv+BOOBC6WvstKLYMw=", "owner": "nix-community", "repo": "impermanence", - "rev": "0d09341beeaa2367bac5d718df1404bf2ce45e6f", + "rev": "3ed3f0eaae9fcc0a8331e77e9319c8a4abd8a71a", "type": "github" }, "original": { @@ -1156,11 +1157,11 @@ ] }, "locked": { - "lastModified": 1730652030, - "narHash": "sha256-uTToUpFphR9ywc+DQUD/8hmboOMFV1lBVFf/ztzdn6A=", + "lastModified": 1730962714, + "narHash": "sha256-Zi2NfnEqB+Xfxtnx6arIohSarXiJmwTqVa3nSpNWx30=", "owner": "Jovian-Experiments", "repo": "Jovian-NixOS", - "rev": "e74e57a37de55ecfdc62f49fe5a7463b2a52499a", + "rev": "93b525229c99fec0016db72a174f43b9d6237714", "type": "github" }, "original": { @@ -1275,11 +1276,11 @@ ] }, "locked": { - "lastModified": 1730604744, - "narHash": "sha256-/MK6QU4iOozJ4oHTfZipGtOgaT/uy/Jm4foCqHQeYR4=", + "lastModified": 1731209121, + "narHash": "sha256-BF7FBh1hIYPDihdUlImHGsQzaJZVLLfYqfDx41wjuF0=", "owner": "nix-community", "repo": "nix-index-database", - "rev": "cc2ddbf2df8ef7cc933543b1b42b845ee4772318", + "rev": "896019f04b22ce5db4c0ee4f89978694f44345c3", "type": "github" }, "original": { @@ -1391,11 +1392,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1730741070, - "narHash": "sha256-edm8WG19kWozJ/GqyYx2VjW99EdhjKwbY3ZwdlPAAlo=", + "lastModified": 1730963269, + "narHash": "sha256-rz30HrFYCHiWEBCKHMffHbMdWJ35hEkcRVU0h7ms3x0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d063c1dd113c91ab27959ba540c0d9753409edf3", + "rev": "83fb6c028368e465cd19bb127b86f971a5e41ebc", "type": "github" }, "original": { @@ -1423,11 +1424,11 @@ }, "nixpkgs-stable_3": { "locked": { - "lastModified": 1720386169, - "narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=", + "lastModified": 1730741070, + "narHash": "sha256-edm8WG19kWozJ/GqyYx2VjW99EdhjKwbY3ZwdlPAAlo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "194846768975b7ad2c4988bdb82572c00222c0d7", + "rev": "d063c1dd113c91ab27959ba540c0d9753409edf3", "type": "github" }, "original": { @@ -1439,11 +1440,11 @@ }, "nixpkgs_10": { "locked": { - "lastModified": 1730785428, - "narHash": "sha256-Zwl8YgTVJTEum+L+0zVAWvXAGbWAuXHax3KzuejaDyo=", + "lastModified": 1731139594, + "narHash": "sha256-IigrKK3vYRpUu+HEjPL/phrfh7Ox881er1UEsZvw9Q4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4aa36568d413aca0ea84a1684d2d46f55dbabad7", + "rev": "76612b17c0ce71689921ca12d9ffdc9c23ce40b2", "type": "github" }, "original": { @@ -1714,11 +1715,11 @@ }, "nixpkgs_9": { "locked": { - "lastModified": 1730531603, - "narHash": "sha256-Dqg6si5CqIzm87sp57j5nTaeBbWhHFaVyG7V6L8k3lY=", + "lastModified": 1730785428, + "narHash": "sha256-Zwl8YgTVJTEum+L+0zVAWvXAGbWAuXHax3KzuejaDyo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "7ffd9ae656aec493492b44d0ddfb28e79a1ea25d", + "rev": "4aa36568d413aca0ea84a1684d2d46f55dbabad7", "type": "github" }, "original": { @@ -1810,11 +1811,11 @@ "nixpkgs-stable": "nixpkgs-stable_3" }, "locked": { - "lastModified": 1729104314, - "narHash": "sha256-pZRZsq5oCdJt3upZIU4aslS9XwFJ+/nVtALHIciX/BI=", + "lastModified": 1730814269, + "narHash": "sha256-fWPHyhYE6xvMI1eGY3pwBTq85wcy1YXqdzTZF+06nOg=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "3c3e88f0f544d6bb54329832616af7eb971b6be6", + "rev": "d70155fdc00df4628446352fc58adc640cd705c2", "type": "github" }, "original": { @@ -1857,11 +1858,11 @@ ] }, "locked": { - "lastModified": 1730860036, - "narHash": "sha256-u0sfA4B65Q9cRO3xpIkQ4nldB8isfdIb3rWtsnRZ+Iw=", + "lastModified": 1731119076, + "narHash": "sha256-2eVhmocCZHJlFAz6Mt3EwPdFFVAtGgIySJc1EHQVxcc=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "b8eb3aeb21629cbe14968a5e3b1cbaefb0d1b260", + "rev": "23c4b3ba5f806fcf25d5a3b6b54fa0d07854c032", "type": "github" }, "original": { @@ -2182,11 +2183,11 @@ }, "unstable": { "locked": { - "lastModified": 1730785428, - "narHash": "sha256-Zwl8YgTVJTEum+L+0zVAWvXAGbWAuXHax3KzuejaDyo=", + "lastModified": 1731139594, + "narHash": "sha256-IigrKK3vYRpUu+HEjPL/phrfh7Ox881er1UEsZvw9Q4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4aa36568d413aca0ea84a1684d2d46f55dbabad7", + "rev": "76612b17c0ce71689921ca12d9ffdc9c23ce40b2", "type": "github" }, "original": { @@ -2284,11 +2285,11 @@ "nixpkgs": "nixpkgs_20" }, "locked": { - "lastModified": 1730649961, - "narHash": "sha256-RTSyBrLARVMAzUuCwhqMpNiY1ygocMGrNCWsya2Swhg=", + "lastModified": 1731201596, + "narHash": "sha256-W1zTYSLFuroahnbaYInl+d3I7uc8olZ8hcjI16PMCew=", "owner": "fufexan", "repo": "zen-browser-flake", - "rev": "34d57013ae28a454e629a43c20f21c93e9c41f18", + "rev": "ca4a27ef77733d50931c1ac7d4034e4dc27108d6", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 29a87fb..3f2b480 100644 --- a/flake.nix +++ b/flake.nix @@ -12,7 +12,7 @@ inputs.nixpkgs.follows = "nixpkgs"; url = "github:LnL7/nix-darwin/master"; }; - determinate.url = "https://flakehub.com/f/DeterminateSystems/determinate/0.1"; + determinate.url = "github:DeterminateSystems/determinate"; emacs.url = "git+https://git.pupbrained.xyz/pupbrained/nixmacs.git"; flakegen.url = "github:jorsn/flakegen"; home-manager = { diff --git a/systems/x86_64-linux/navis/default.nix b/systems/x86_64-linux/navis/default.nix index 9071a1d..33c342e 100644 --- a/systems/x86_64-linux/navis/default.nix +++ b/systems/x86_64-linux/navis/default.nix @@ -5,66 +5,36 @@ lib, ... }: { - # boot.initrd.systemd.services.wipe-root = { - # requires = ["dev-mapper-enc.device"]; - # after = ["dev-mapper-enc.device"]; - # wantedBy = ["initrd.target"]; - # script = lib.mkAfter '' - # mkdir /btrfs_tmp - # mount /dev/disk/by-uuid/d375c3a3-63a3-47f8-8b77-58fabbb8f67b /btrfs_tmp - # if [[ -e /btrfs_tmp/root ]]; then - # mkdir -p /btrfs_tmp/old_roots - # timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S") - # mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp" - # fi - # - # delete_subvolume_recursively() { - # IFS=$'\n' - # for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do - # delete_subvolume_recursively "/btrfs_tmp/$i" - # done - # btrfs subvolume delete "$1" - # } - # - # for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +30); do - # delete_subvolume_recursively "$i" - # done - # - # btrfs subvolume create /btrfs_tmp/root - # umount /btrfs_tmp - # ''; - # }; - facter.reportPath = ./facter.json; fileSystems = { "/" = { - device = "/dev/disk/by-uuid/d375c3a3-63a3-47f8-8b77-58fabbb8f67b"; + device = "/dev/mapper/enc"; fsType = "btrfs"; options = ["subvol=root"]; }; "/home" = { - device = "/dev/disk/by-uuid/d375c3a3-63a3-47f8-8b77-58fabbb8f67b"; + device = "/dev/mapper/enc"; fsType = "btrfs"; options = ["subvol=home" "compress=zstd"]; }; "/nix" = { - device = "/dev/disk/by-uuid/d375c3a3-63a3-47f8-8b77-58fabbb8f67b"; + device = "/dev/mapper/enc"; fsType = "btrfs"; options = ["subvol=nix" "compress=zstd" "noatime"]; }; "/persist" = { - device = "/dev/disk/by-uuid/d375c3a3-63a3-47f8-8b77-58fabbb8f67b"; + device = "/dev/mapper/enc"; neededForBoot = true; fsType = "btrfs"; options = ["subvol=persist" "compress=zstd"]; }; "/var/log" = { - device = "/dev/disk/by-uuid/d375c3a3-63a3-47f8-8b77-58fabbb8f67b"; + device = "/dev/mapper/enc"; fsType = "btrfs"; options = ["subvol=log" "compress=zstd" "noatime"]; neededForBoot = true; @@ -151,10 +121,6 @@ identityPaths = ["/persist/root/.ssh/id_ed25519"]; }; - chaotic.scx.enable = true; - chaotic.scx.package = pkgs.scx_git.rustland; - chaotic.scx.scheduler = "scx_rustland"; - virtualisation = { spiceUSBRedirection.enable = true; waydroid.enable = true; @@ -211,13 +177,34 @@ kernelPackages = pkgs.linuxPackages_cachyos; supportedFilesystems = ["btrfs" "ntfs"]; + # Encrypted device initrd.luks.devices."enc".device = "/dev/disk/by-uuid/9952fcd1-46eb-4c9c-ab7d-361d31fdb9a2"; tmp.useTmpfs = true; - # initrd.systemd = { - # enable = true; - # emergencyAccess = true; # No password needed because of LUKS - # }; + initrd.postDeviceCommands = lib.mkAfter '' + mkdir /btrfs_tmp + mount /dev/dm-0 /btrfs_tmp + if [[ -e /btrfs_tmp/root ]]; then + mkdir -p /btrfs_tmp/old_roots + timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S") + mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp" + fi + + delete_subvolume_recursively() { + IFS=$'\n' + for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do + delete_subvolume_recursively "/btrfs_tmp/$i" + done + btrfs subvolume delete "$1" + } + + for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +30); do + delete_subvolume_recursively "$i" + done + + btrfs subvolume create /btrfs_tmp/root + umount /btrfs_tmp + ''; plymouth = { enable = true; @@ -302,18 +289,15 @@ "https://cuda-maintainers.cachix.org" "https://hyprland.cachix.org" "https://nix-community.cachix.org" - "https://nyx.chaotic.cx/" ]; trusted-public-keys = [ "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" "cache.privatevoid.net:SErQ8bvNWANeAvtsOESUwVYr2VJynfuc9JRwlzTTkVg=" - "chaotic-nyx.cachix.org-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8=" "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" "cuda-maintainers.cachix.org-1:0dq3bujKpuEPMCX6U4WylrUDZ9JyUG0VpVZa7CNfq5E=" "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "nyx.chaotic.cx-1:HfnXSw4pj95iI/n17rIDy40agHj12WfF+Gqk6SonIT8=" ]; }; };