diff --git a/hosts/i001/impermanence-tools.nix b/hosts/i001/impermanence-tools.nix index 2e57465c..cf6a9467 100644 --- a/hosts/i001/impermanence-tools.nix +++ b/hosts/i001/impermanence-tools.nix @@ -10,7 +10,6 @@ let bcacheImpermanenceBin = pkgs.writeShellScriptBin "bcache-impermanence" ( builtins.readFile ./impermanence-tools.sh ); - in { options.impermanence.tools = { diff --git a/utilities/nixos-installers/examples/test/flake.lock b/hosts/juni/flake.lock similarity index 68% rename from utilities/nixos-installers/examples/test/flake.lock rename to hosts/juni/flake.lock index c6e8b971..a4aaa437 100644 --- a/utilities/nixos-installers/examples/test/flake.lock +++ b/hosts/juni/flake.lock @@ -1,13 +1,74 @@ { "nodes": { + "agenix": { + "inputs": { + "darwin": "darwin", + "home-manager": "home-manager_3", + "nixpkgs": [ + "secrets", + "ragenix", + "nixpkgs" + ], + "systems": "systems" + }, + "locked": { + "lastModified": 1761656077, + "narHash": "sha256-lsNWuj4Z+pE7s0bd2OKicOFq9bK86JE0ZGeKJbNqb94=", + "owner": "ryantm", + "repo": "agenix", + "rev": "9ba0d85de3eaa7afeab493fed622008b6e4924f5", + "type": "github" + }, + "original": { + "owner": "ryantm", + "repo": "agenix", + "type": "github" + } + }, + "beszel": { + "inputs": { + "beszel-nixpkgs": "beszel-nixpkgs" + }, + "locked": { + "dir": "flakes/beszel", + "lastModified": 1767048390, + "narHash": "sha256-JfSMqK2Q2FimYf+0p39q/NZ7RLKQ5FeMZa9qM0xZ4t8=", + "ref": "refs/heads/master", + "rev": "a27c00c6ff082321526e3809a60ce3ead2abee95", + "revCount": 999, + "type": "git", + "url": "https://git.joshuabell.xyz/ringofstorms/dotfiles" + }, + "original": { + "dir": "flakes/beszel", + "type": "git", + "url": "https://git.joshuabell.xyz/ringofstorms/dotfiles" + } + }, + "beszel-nixpkgs": { + "locked": { + "lastModified": 1765472234, + "narHash": "sha256-9VvC20PJPsleGMewwcWYKGzDIyjckEz8uWmT0vCDYK0=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "2fbfb1d73d239d2402a8fe03963e37aab15abe8b", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "common": { "locked": { "dir": "flakes/common", - "lastModified": 1764738806, - "narHash": "sha256-CRXCWZDrgy31TH+pnUZMIXS0wosRLI/wxaG0s3S01Ks=", + "lastModified": 1767048390, + "narHash": "sha256-JfSMqK2Q2FimYf+0p39q/NZ7RLKQ5FeMZa9qM0xZ4t8=", "ref": "refs/heads/master", - "rev": "0ba6c5ccecd24e04ff8f45c4ed144c4a8b6b4f7e", - "revCount": 836, + "rev": "a27c00c6ff082321526e3809a60ce3ead2abee95", + "revCount": 999, "type": "git", "url": "https://git.joshuabell.xyz/ringofstorms/dotfiles" }, @@ -17,17 +78,56 @@ "url": "https://git.joshuabell.xyz/ringofstorms/dotfiles" } }, + "crane": { + "locked": { + "lastModified": 1760924934, + "narHash": "sha256-tuuqY5aU7cUkR71sO2TraVKK2boYrdW3gCSXUkF4i44=", + "owner": "ipetkov", + "repo": "crane", + "rev": "c6b4d5308293d0d04fcfeee92705017537cad02f", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, + "darwin": { + "inputs": { + "nixpkgs": [ + "secrets", + "ragenix", + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1744478979, + "narHash": "sha256-dyN+teG9G82G+m+PX/aSAagkC+vUv0SgUw3XkPhQodQ=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "43975d782b418ebf4969e9ccba82466728c2851b", + "type": "github" + }, + "original": { + "owner": "lnl7", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, "de_plasma": { "inputs": { "plasma-manager": "plasma-manager" }, "locked": { "dir": "flakes/de_plasma", - "lastModified": 1764738806, - "narHash": "sha256-CRXCWZDrgy31TH+pnUZMIXS0wosRLI/wxaG0s3S01Ks=", + "lastModified": 1767048390, + "narHash": "sha256-JfSMqK2Q2FimYf+0p39q/NZ7RLKQ5FeMZa9qM0xZ4t8=", "ref": "refs/heads/master", - "rev": "0ba6c5ccecd24e04ff8f45c4ed144c4a8b6b4f7e", - "revCount": 836, + "rev": "a27c00c6ff082321526e3809a60ce3ead2abee95", + "revCount": 999, "type": "git", "url": "https://git.joshuabell.xyz/ringofstorms/dotfiles" }, @@ -37,6 +137,44 @@ "url": "https://git.joshuabell.xyz/ringofstorms/dotfiles" } }, + "flake-utils": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flatpaks": { + "inputs": { + "nix-flatpak": "nix-flatpak" + }, + "locked": { + "dir": "flakes/flatpaks", + "lastModified": 1767048390, + "narHash": "sha256-JfSMqK2Q2FimYf+0p39q/NZ7RLKQ5FeMZa9qM0xZ4t8=", + "ref": "refs/heads/master", + "rev": "a27c00c6ff082321526e3809a60ce3ead2abee95", + "revCount": 999, + "type": "git", + "url": "https://git.joshuabell.xyz/ringofstorms/dotfiles" + }, + "original": { + "dir": "flakes/flatpaks", + "type": "git", + "url": "https://git.joshuabell.xyz/ringofstorms/dotfiles" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -64,11 +202,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1764736872, - "narHash": "sha256-4mqLegNQeD54X7enm6EI9aNWl6CaIfyhl5PaYoGYwqk=", + "lastModified": 1767024057, + "narHash": "sha256-B1aycRjMRvb6QOGbnqDhiDzZwMebj5jxZ5qyJzaKvpI=", "owner": "rycee", "repo": "home-manager", - "rev": "3366918730bb6b699395a9d237397f1d710a94b3", + "rev": "34578a2fdfce4257ce5f5baf6e7efbd4e4e252b1", "type": "github" }, "original": { @@ -78,6 +216,29 @@ "type": "github" } }, + "home-manager_3": { + "inputs": { + "nixpkgs": [ + "secrets", + "ragenix", + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1745494811, + "narHash": "sha256-YZCh2o9Ua1n9uCvrvi5pRxtuVNml8X2a03qIFfRKpFs=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "abfad3d2958c9e6300a883bd443512c55dfeb1be", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, "impermanence": { "locked": { "lastModified": 1737831083, @@ -93,6 +254,38 @@ "type": "github" } }, + "nix-flatpak": { + "locked": { + "lastModified": 1739444422, + "narHash": "sha256-iAVVHi7X3kWORftY+LVbRiStRnQEob2TULWyjMS6dWg=", + "owner": "gmodena", + "repo": "nix-flatpak", + "rev": "5e54c3ca05a7c7d968ae1ddeabe01d2a9bc1e177", + "type": "github" + }, + "original": { + "owner": "gmodena", + "ref": "latest", + "repo": "nix-flatpak", + "type": "github" + } + }, + "nixos-hardware": { + "locked": { + "lastModified": 1767068707, + "narHash": "sha256-+DDBd5UX7jTwiPdPfbcK0lM+qTxHsLY6z6tq9riiC7Y=", + "owner": "NixOS", + "repo": "nixos-hardware", + "rev": "7a9a613a3e457bfd3dcf16f1f9ea1a9b138b992d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "master", + "repo": "nixos-hardware", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1756542300, @@ -109,13 +302,29 @@ "type": "github" } }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1766902085, + "narHash": "sha256-coBu0ONtFzlwwVBzmjacUQwj3G+lybcZ1oeNSQkgC0M=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "c0b0e0fddf73fd517c3471e546c0df87a42d53f4", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { "locked": { - "lastModified": 1764522689, - "narHash": "sha256-SqUuBFjhl/kpDiVaKLQBoD8TLD+/cTUzzgVFoaHrkqY=", + "lastModified": 1766736597, + "narHash": "sha256-BASnpCLodmgiVn0M1MU2Pqyoz0aHwar/0qLkp7CjvSQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8bb5646e0bed5dbd3ab08c7a7cc15b75ab4e1d0f", + "rev": "f560ccec6b1116b22e6ed15f4c510997d99d5852", "type": "github" }, "original": { @@ -127,11 +336,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1764522689, - "narHash": "sha256-SqUuBFjhl/kpDiVaKLQBoD8TLD+/cTUzzgVFoaHrkqY=", + "lastModified": 1766885793, + "narHash": "sha256-P6RVkrM9JLCW6xBjSwHfgTOQ1JwBUma5xe5LI8xAPC0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "8bb5646e0bed5dbd3ab08c7a7cc15b75ab4e1d0f", + "rev": "9ef261221d1e72399f2036786498d78c38185c46", "type": "github" }, "original": { @@ -143,15 +352,48 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1764040936, - "narHash": "sha256-d1NFBVGQZ/Xb0pMviuzenqrfXymJs0m/pKrEg1tDGsE=", + "lastModified": 1766870016, + "narHash": "sha256-fHmxAesa6XNqnIkcS6+nIHuEmgd/iZSP/VXxweiEuQw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5c2bc52fb9f8c264ed6c93bd20afa2ff5e763dce", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_5": { + "locked": { + "lastModified": 1766309749, + "narHash": "sha256-3xY8CZ4rSnQ0NqGhMKAy5vgC+2IVK0NoVEzDoOh4DA4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "b9491974f02dadeb5acca22649ccbd89a6a81afb", + "rev": "a6531044f6d0bef691ea18d4d4ce44d0daa6e816", "type": "github" }, "original": { "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_6": { + "locked": { + "lastModified": 1761672384, + "narHash": "sha256-o9KF3DJL7g7iYMZq9SWgfS1BFlNbsm6xplRjVlOCkXI=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "08dacfca559e1d7da38f3cf05f1f45ee9bfd213c", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -175,11 +417,11 @@ "nvim_plugin-CopilotC-Nvim/CopilotChat.nvim": { "flake": false, "locked": { - "lastModified": 1763599441, - "narHash": "sha256-RwCQQfgQIQITVSJSX+QOSIOChT7E2AXdIwfU07S9GaU=", + "lastModified": 1766398838, + "narHash": "sha256-pO+bnwywDmhEpmU3Zw2VCAT8uLEgRlpHcAfW9NwqWis=", "owner": "CopilotC-Nvim", "repo": "CopilotChat.nvim", - "rev": "df5376c132382dd47e3e552612940cbf25b3580c", + "rev": "ed94e56ee8292f5df351e17709ff4b178ca84200", "type": "github" }, "original": { @@ -223,11 +465,11 @@ "nvim_plugin-MeanderingProgrammer/render-markdown.nvim": { "flake": false, "locked": { - "lastModified": 1763430554, - "narHash": "sha256-0DwPuzqR+7R4lJFQ9f2xN26YhdQKg85Hw6+bPvloZoc=", + "lastModified": 1765914395, + "narHash": "sha256-A7pm8sBQWsZl3Kc7JBh3gBUyKb6GfJ5J0zfn3mSGjKs=", "owner": "MeanderingProgrammer", "repo": "render-markdown.nvim", - "rev": "6e0e8902dac70fecbdd8ce557d142062a621ec38", + "rev": "07d088bf8bdadd159eb807b90eaee86a4778383f", "type": "github" }, "original": { @@ -303,11 +545,11 @@ "nvim_plugin-b0o/schemastore.nvim": { "flake": false, "locked": { - "lastModified": 1763748041, - "narHash": "sha256-4KKj1zp+5Z2zbC31hpvw73BIuf4dW7rimepGOggmUp4=", + "lastModified": 1766167236, + "narHash": "sha256-+Z1foMyKMxyMmYqmyu1KWiyL4Fc0Zm2SYV7RoZ9Ut2I=", "owner": "b0o", "repo": "schemastore.nvim", - "rev": "aa25399c48236b77af71d4b64cdf157d2ba4e990", + "rev": "8b92ea89835b8e5dbc779a675ebb0e5fcb9a1993", "type": "github" }, "original": { @@ -319,11 +561,11 @@ "nvim_plugin-catppuccin/nvim": { "flake": false, "locked": { - "lastModified": 1763995197, - "narHash": "sha256-i4WmQzSNWeR5rh61yonzR55yyklJ3xOL8D/XyEnDa+E=", + "lastModified": 1765701669, + "narHash": "sha256-8GKpGGdeBwxuMrheojyl162CzUntRcq9AktQVmKbpuI=", "owner": "catppuccin", "repo": "nvim", - "rev": "180e0435707cf1fed09a98a9739e5807d92b69be", + "rev": "ce8d176faa4643e026e597ae3c31db59b63cef09", "type": "github" }, "original": { @@ -335,11 +577,11 @@ "nvim_plugin-chrisgrieser/nvim-early-retirement": { "flake": false, "locked": { - "lastModified": 1764013541, - "narHash": "sha256-Mzz1y7YYTYUWv9S/Yr26to7AuDCZ+9asHa3qzDz06D0=", + "lastModified": 1766186911, + "narHash": "sha256-COYpFOZTMGpZVfSJFMix/6TM5Eeemngcx1iukMa2nDE=", "owner": "chrisgrieser", "repo": "nvim-early-retirement", - "rev": "6fb7d87a965e439cfb4e04a5c0e5038010fc015b", + "rev": "86edd80026e4eea2cef7d1e5dadcf34432e6098d", "type": "github" }, "original": { @@ -367,11 +609,11 @@ "nvim_plugin-folke/lazy.nvim": { "flake": false, "locked": { - "lastModified": 1762421181, - "narHash": "sha256-h5404njTAfqMJFQ3MAr2PWSbV81eS4aIs0cxAXkT0EM=", + "lastModified": 1765971162, + "narHash": "sha256-5A4kducPwKb5fKX4oSUFvo898P0dqfsqqLxFaXBsbQY=", "owner": "folke", "repo": "lazy.nvim", - "rev": "85c7ff3711b730b4030d03144f6db6375044ae82", + "rev": "306a05526ada86a7b30af95c5cc81ffba93fef97", "type": "github" }, "original": { @@ -479,11 +721,11 @@ "nvim_plugin-j-hui/fidget.nvim": { "flake": false, "locked": { - "lastModified": 1761243883, - "narHash": "sha256-XXTeJweQRIsC/WFhFxFbepOETV8e5Wfmh513su2Wve0=", + "lastModified": 1766143069, + "narHash": "sha256-uy2Z6vn9UYDN7Dr7iuiTrualRQdmUT0dwHP/eZXA/uA=", "owner": "j-hui", "repo": "fidget.nvim", - "rev": "e32b672d8fd343f9d6a76944fedb8c61d7d8111a", + "rev": "64463022a1f2ff1318ab22a2ea4125ed9313a483", "type": "github" }, "original": { @@ -511,11 +753,11 @@ "nvim_plugin-lewis6991/gitsigns.nvim": { "flake": false, "locked": { - "lastModified": 1763280728, - "narHash": "sha256-w2/osNJwbtmUxxQIXBsyqMYrvyNUaVzXrUNGYqGmzi4=", + "lastModified": 1764322768, + "narHash": "sha256-w3Q7nMFEbcjP6RmSTONg2Nw1dBXDEHnjQ69FuAPJRD8=", "owner": "lewis6991", "repo": "gitsigns.nvim", - "rev": "cdafc320f03f2572c40ab93a4eecb733d4016d07", + "rev": "5813e4878748805f1518cee7abb50fd7205a3a48", "type": "github" }, "original": { @@ -591,11 +833,11 @@ "nvim_plugin-mfussenegger/nvim-lint": { "flake": false, "locked": { - "lastModified": 1763729870, - "narHash": "sha256-9fIZPUZhnQEHJtvboCs+A2QXo4UMTFejuHNagDkfkRk=", + "lastModified": 1766127989, + "narHash": "sha256-ysIoJ8uMAHu/OCemQ3yUYMhKIVnSDLQCvJH0SaGIOK4=", "owner": "mfussenegger", "repo": "nvim-lint", - "rev": "d1118791070d090777398792a73032a0ca5c79ff", + "rev": "7a64f4067065c16a355d40d0d599b8ca6b25de6d", "type": "github" }, "original": { @@ -607,11 +849,11 @@ "nvim_plugin-mrcjkb/rustaceanvim": { "flake": false, "locked": { - "lastModified": 1763539887, - "narHash": "sha256-aMyjQEEY6MlTBMMxjR6NxNhdbWmvRhOcfpgE1w712nE=", + "lastModified": 1766276825, + "narHash": "sha256-dcXnh5SYPh1VRctTuCnuVPKFQuAI4XEvQasolCOv+Xw=", "owner": "mrcjkb", "repo": "rustaceanvim", - "rev": "6b7e0e18ad8fa0598bc038aef7bb6bba288adbad", + "rev": "0fa0462a2d6c9629e0bd03d1902e6a1472ceac3e", "type": "github" }, "original": { @@ -623,11 +865,11 @@ "nvim_plugin-neovim/nvim-lspconfig": { "flake": false, "locked": { - "lastModified": 1763880753, - "narHash": "sha256-huuWVUKo6CmxjXYRnGv8tUs+7bo85gNyL8vVnreiTAU=", + "lastModified": 1766443238, + "narHash": "sha256-P95gPOwJ+rRofLb8iV5UOnh26to1I3sFrWGlGxHyz1M=", "owner": "neovim", "repo": "nvim-lspconfig", - "rev": "30a2b191bccf541ce1797946324c9329e90ec448", + "rev": "b34c08e0ea22bac67798f00238318fd16bd99b7c", "type": "github" }, "original": { @@ -735,11 +977,11 @@ "nvim_plugin-nvim-telescope/telescope.nvim": { "flake": false, "locked": { - "lastModified": 1763414201, - "narHash": "sha256-6hrylUCc6KlcbnMgcJNJhbX2Cgu0YHKoMPOqpaKRljE=", + "lastModified": 1766268405, + "narHash": "sha256-O1rUiVKpDSvKMkZMFaEd8/ACcSgO/lfa1+Hc8uHbFOI=", "owner": "nvim-telescope", "repo": "telescope.nvim", - "rev": "83a3a713d6b2d2a408491a1b959e55a7fa8678e8", + "rev": "e709d31454ee6e6157f0537f861f797bd44c0bad", "type": "github" }, "original": { @@ -751,11 +993,11 @@ "nvim_plugin-nvim-tree/nvim-tree.lua": { "flake": false, "locked": { - "lastModified": 1763712665, - "narHash": "sha256-YwaWMPQ3IC+z/utnkZ1Tfs5tZFex9Gdf/vS9sUaMDCA=", + "lastModified": 1766192360, + "narHash": "sha256-Br+r9f/2o0AkewnGm7kFNfl3uYm1Akkklof0Sm5AL2M=", "owner": "nvim-tree", "repo": "nvim-tree.lua", - "rev": "3fb91e18a727ecc0385637895ec397dea90be42a", + "rev": "b8b44b6a2494d086a9177251a119f9daec6cace8", "type": "github" }, "original": { @@ -767,11 +1009,11 @@ "nvim_plugin-nvim-tree/nvim-web-devicons": { "flake": false, "locked": { - "lastModified": 1761440007, - "narHash": "sha256-klBjUtj0AvarN5a6O8Hh2t5BuOTe/m3ps2cHnlxVJvE=", + "lastModified": 1766287594, + "narHash": "sha256-ZdFRd0//C0Lle4cYIoAHBdz/yvQqmeylLNwvSifaWm4=", "owner": "nvim-tree", "repo": "nvim-web-devicons", - "rev": "8dcb311b0c92d460fac00eac706abd43d94d68af", + "rev": "6788013bb9cb784e606ada44206b0e755e4323d7", "type": "github" }, "original": { @@ -783,11 +1025,11 @@ "nvim_plugin-nvim-treesitter/nvim-treesitter-context": { "flake": false, "locked": { - "lastModified": 1762769683, - "narHash": "sha256-ICwAUXKngSPsJ6VV+84KUPqtAwlGPrm4FIf9ioisiz8=", + "lastModified": 1765030629, + "narHash": "sha256-3NtwOA9d2ezLoo7qnzKAr6gwEdcpUqLc7ou4QI+9rDY=", "owner": "nvim-treesitter", "repo": "nvim-treesitter-context", - "rev": "660861b1849256398f70450afdf93908d28dc945", + "rev": "64dd4cf3f6fd0ab17622c5ce15c91fc539c3f24a", "type": "github" }, "original": { @@ -895,11 +1137,11 @@ "nvim_plugin-stevearc/conform.nvim": { "flake": false, "locked": { - "lastModified": 1763939276, - "narHash": "sha256-2TLMJdbSbMbdGn6zhZwNSUZnxVGu+Y0ZYhTjinTc7Hs=", + "lastModified": 1766346125, + "narHash": "sha256-Pp4bGTlZEqxHoHqVCEekDdg2jvNayxAuBReK4HJ6yGg=", "owner": "stevearc", "repo": "conform.nvim", - "rev": "6208aefd675939cc7c8f1a57176135974dad269f", + "rev": "5420c4b5ea0aeb99c09cfbd4fd0b70d257b44f25", "type": "github" }, "original": { @@ -1007,11 +1249,11 @@ "nvim_plugin-zbirenbaum/copilot.lua": { "flake": false, "locked": { - "lastModified": 1763512274, - "narHash": "sha256-NMIXOb/20aEmXvPgSDPzVuRIV+OUnJyfXVaVEuVAaTM=", + "lastModified": 1766207702, + "narHash": "sha256-879050VUJpWBrHxUA3hRpcYbn3KgBGpVpKLdSVOwbIA=", "owner": "zbirenbaum", "repo": "copilot.lua", - "rev": "4383e05a47493d7ff77b058c0548129eb38ec7fb", + "rev": "e78d1ffebdf6ccb6fd8be4e6898030c1cf5f9b64", "type": "github" }, "original": { @@ -1020,6 +1262,44 @@ "type": "github" } }, + "opencode": { + "inputs": { + "opencode": "opencode_2" + }, + "locked": { + "dir": "flakes/opencode", + "lastModified": 1767048390, + "narHash": "sha256-JfSMqK2Q2FimYf+0p39q/NZ7RLKQ5FeMZa9qM0xZ4t8=", + "ref": "refs/heads/master", + "rev": "a27c00c6ff082321526e3809a60ce3ead2abee95", + "revCount": 999, + "type": "git", + "url": "https://git.joshuabell.xyz/ringofstorms/dotfiles" + }, + "original": { + "dir": "flakes/opencode", + "type": "git", + "url": "https://git.joshuabell.xyz/ringofstorms/dotfiles" + } + }, + "opencode_2": { + "inputs": { + "nixpkgs": "nixpkgs_4" + }, + "locked": { + "lastModified": 1767028968, + "narHash": "sha256-Z6Jk9Ee3+KHaQf7V/zbHHgotZ0gQA5Mtqpzs8PAQmBY=", + "owner": "sst", + "repo": "opencode", + "rev": "b7ce46f7a12e68283d6588c33aaf972426ddd65e", + "type": "github" + }, + "original": { + "owner": "sst", + "repo": "opencode", + "type": "github" + } + }, "plasma-manager": { "inputs": { "home-manager": "home-manager", @@ -1039,19 +1319,47 @@ "type": "github" } }, + "ragenix": { + "inputs": { + "agenix": "agenix", + "crane": "crane", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs_6", + "rust-overlay": "rust-overlay_2" + }, + "locked": { + "lastModified": 1761832913, + "narHash": "sha256-VCNVjjuRvrKPiYYwqhE3BAKIaReiKXGpxGp27lZ0MFM=", + "owner": "yaxitech", + "repo": "ragenix", + "rev": "83bccfdea758241999f32869fb6b36f7ac72f1ac", + "type": "github" + }, + "original": { + "owner": "yaxitech", + "repo": "ragenix", + "type": "github" + } + }, "root": { "inputs": { + "beszel": "beszel", "common": "common", "de_plasma": "de_plasma", + "flatpaks": "flatpaks", "home-manager": "home-manager_2", "impermanence": "impermanence", + "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs_3", - "ros_neovim": "ros_neovim" + "nixpkgs-unstable": "nixpkgs-unstable", + "opencode": "opencode", + "ros_neovim": "ros_neovim", + "secrets": "secrets" } }, "ros_neovim": { "inputs": { - "nixpkgs": "nixpkgs_4", + "nixpkgs": "nixpkgs_5", "nvim_plugin-Almo7aya/openingh.nvim": "nvim_plugin-Almo7aya/openingh.nvim", "nvim_plugin-CopilotC-Nvim/CopilotChat.nvim": "nvim_plugin-CopilotC-Nvim/CopilotChat.nvim", "nvim_plugin-JoosepAlviste/nvim-ts-context-commentstring": "nvim_plugin-JoosepAlviste/nvim-ts-context-commentstring", @@ -1109,11 +1417,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1764112623, - "narHash": "sha256-IBjor1S6fq2nwmzi7sRwJg6mRFlO9qwA1OhJhyHvwlw=", + "lastModified": 1766468664, + "narHash": "sha256-QfAZCWfwIDiOvikyMb9Tsg2X0n659zd6DxDT88ILE4I=", "ref": "refs/heads/master", - "rev": "d85f1e831e400b2d1ea574fe6e40deba39d4d750", - "revCount": 323, + "rev": "99a57f25b959d7226d68f1b53ff60f0c4cc5b210", + "revCount": 326, "type": "git", "url": "https://git.joshuabell.xyz/ringofstorms/nvim" }, @@ -1130,11 +1438,11 @@ ] }, "locked": { - "lastModified": 1764038373, - "narHash": "sha256-M6w2wNBRelcavoDAyFL2iO4NeWknD40ASkH1S3C0YGM=", + "lastModified": 1766457837, + "narHash": "sha256-aeBbkQ0HPFNOIsUeEsXmZHXbYq4bG8ipT9JRlCcKHgU=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "ab3536fe850211a96673c6ffb2cb88aab8071cc9", + "rev": "2c7510a559416d07242621d036847152d970612b", "type": "github" }, "original": { @@ -1142,6 +1450,78 @@ "repo": "rust-overlay", "type": "github" } + }, + "rust-overlay_2": { + "inputs": { + "nixpkgs": [ + "secrets", + "ragenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1761791894, + "narHash": "sha256-myRIDh+PxaREz+z9LzbqBJF+SnTFJwkthKDX9zMyddY=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "59c45eb69d9222a4362673141e00ff77842cd219", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "secrets": { + "inputs": { + "ragenix": "ragenix" + }, + "locked": { + "dir": "flakes/secrets", + "lastModified": 1767048390, + "narHash": "sha256-JfSMqK2Q2FimYf+0p39q/NZ7RLKQ5FeMZa9qM0xZ4t8=", + "ref": "refs/heads/master", + "rev": "a27c00c6ff082321526e3809a60ce3ead2abee95", + "revCount": 999, + "type": "git", + "url": "https://git.joshuabell.xyz/ringofstorms/dotfiles" + }, + "original": { + "dir": "flakes/secrets", + "type": "git", + "url": "https://git.joshuabell.xyz/ringofstorms/dotfiles" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/hosts/juni/flake.nix b/hosts/juni/flake.nix index 59e38f16..01393e51 100644 --- a/hosts/juni/flake.nix +++ b/hosts/juni/flake.nix @@ -5,9 +5,12 @@ nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; + nixos-hardware.url = "github:NixOS/nixos-hardware/master"; + impermanence.url = "github:nix-community/impermanence"; + # Use relative to get current version for testin - # inputs.common.url = "path:../../flakes/common"; - inputs.common.url = "git+https://git.joshuabell.xyz/ringofstorms/dotfiles?dir=flakes/common"; + # common.url = "path:../../flakes/common"; + common.url = "git+https://git.joshuabell.xyz/ringofstorms/dotfiles?dir=flakes/common"; # secrets.url = "path:../../flakes/secrets"; secrets.url = "git+https://git.joshuabell.xyz/ringofstorms/dotfiles?dir=flakes/secrets"; # flatpaks.url = "path:../../flakes/flatpaks"; @@ -40,6 +43,8 @@ "${configuration_name}" = ( lib.nixosSystem { modules = [ + inputs.nixos-hardware.nixosModules.framework-12-13th-gen-intel + inputs.impermanence.nixosModules.impermanence ({ nixpkgs.overlays = [ (final: prev: { @@ -55,10 +60,11 @@ ({ ringofstorms.dePlasma = { enable = true; - gpu.amd.enable = true; + gpu.intel.enable = true; sddm.autologinUser = "josh"; }; }) + inputs.common.nixosModules.jetbrains_font # secrets.nixosModules.default inputs.ros_neovim.nixosModules.default @@ -69,17 +75,16 @@ inputs.flatpaks.nixosModules.default + inputs.common.nixosModules.boot_systemd inputs.common.nixosModules.essentials inputs.common.nixosModules.git inputs.common.nixosModules.tmux - inputs.common.nixosModules.boot_systemd inputs.common.nixosModules.hardening - inputs.common.nixosModules.jetbrains_font inputs.common.nixosModules.nix_options - # inputs.common.nixosModules.tailnet inputs.common.nixosModules.timezone_auto inputs.common.nixosModules.tty_caps_esc inputs.common.nixosModules.zsh + # inputs.common.nixosModules.tailnet # beszel.nixosModules.agent # ({ @@ -89,8 +94,10 @@ # } # ) - ./configuration.nix ./hardware-configuration.nix + ./hardware-mounts.nix + ./impermanence-tools.nix + (import ./impermanence.nix { inherit primaryUser; }) ( { config, pkgs, ... }: rec { @@ -112,10 +119,10 @@ inputs.common.homeManagerModules.kitty inputs.common.homeManagerModules.git inputs.common.homeManagerModules.postgres_cli_options - inputs.common.homeManagerModules.ssh inputs.common.homeManagerModules.starship inputs.common.homeManagerModules.zoxide inputs.common.homeManagerModules.zsh + # inputs.common.homeManagerModules.ssh ( { ... }: { diff --git a/hosts/juni/hardware-configuration.nix b/hosts/juni/hardware-configuration.nix new file mode 100644 index 00000000..b3a41c05 --- /dev/null +++ b/hosts/juni/hardware-configuration.nix @@ -0,0 +1,25 @@ +{ + config, + lib, + modulesPath, + ... +}: +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ + "xhci_pci" + "nvme" + "usbhid" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/juni/hardware-mounts.nix b/hosts/juni/hardware-mounts.nix new file mode 100644 index 00000000..8079d01f --- /dev/null +++ b/hosts/juni/hardware-mounts.nix @@ -0,0 +1,253 @@ +{ + config, + utils, + pkgs, + lib, + ... +}: +let + BOOT = "/dev/disk/by-uuid/F5C0-5585"; + PRIMARY = "/dev/disk/by-uuid/3bfd6e57-5e0f-4742-99e3-e69891ae2431"; + + SWAP = "/dev/disk/by-uuid/ad0311e2-7eb1-47af-bc4b-6311968cbccf"; + + USB_KEY = null; + + IMPERMANENCE = true; + + primaryDeviceUnit = "${utils.escapeSystemdPath PRIMARY}.device"; +in +lib.mkMerge [ + # Main filesystems + { + # BOOT + fileSystems."/boot" = { + device = BOOT; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; + + # PRIMARY + fileSystems."/" = { + device = PRIMARY; + fsType = "bcachefs"; + options = [ + "X-mount.subdir=@root" + ]; + }; + fileSystems."/nix" = { + device = PRIMARY; + fsType = "bcachefs"; + options = [ + "X-mount.mkdir" + "X-mount.subdir=@nix" + "relatime" + ]; + }; + fileSystems."/.snapshots" = { + device = PRIMARY; + fsType = "bcachefs"; + options = [ + "X-mount.mkdir" + "X-mount.subdir=@snapshots" + "relatime" + ]; + }; + fileSystems."/persist" = lib.mkIf IMPERMANENCE { + device = PRIMARY; + fsType = "bcachefs"; + options = [ + "X-mount.mkdir" + "X-mount.subdir=@persist" + ]; + neededForBoot = true; # NOTE for impermanence only + }; + } + (lib.mkIf (SWAP != null) { swapDevices = [ { device = SWAP; } ]; }) + # Disable bcachefs built in password prompts for all mounts (which asks for every single subdir mount above + ( + let + disableFs = fs: { + name = "unlock-bcachefs-${utils.escapeSystemdPath fs.mountPoint}"; + value = { + enable = false; + }; + }; + in + { + boot.initrd.systemd.enable = true; + systemd.services = + let + isSystemdNonBootBcache = fs: (fs.fsType == "bcachefs") && (!utils.fsNeededForBoot fs); + bcacheNonBoots = lib.filterAttrs (k: fs: isSystemdNonBootBcache fs) config.fileSystems; + in + (lib.mapAttrs' (k: disableFs) bcacheNonBoots); + boot.initrd.systemd.services = + let + isSystemdBootBcache = fs: (fs.fsType == "bcachefs") && (utils.fsNeededForBoot fs); + bcacheBoots = lib.filterAttrs (k: fs: isSystemdBootBcache fs) config.fileSystems; + in + (lib.mapAttrs' (k: disableFs) bcacheBoots); + } + ) + { + # Impermanence fix for working with custom unlock and reset with root bcache + boot.initrd.systemd.services.create-needed-for-boot-dirs = { + after = [ + "unlock-bcachefs-custom.service" + "bcachefs-reset-root.service" + ]; + requires = [ + "unlock-bcachefs-custom.service" + "bcachefs-reset-root.service" + ]; + serviceConfig.KeyringMode = "shared"; + }; + } + # Bcachefs auto decryption + (lib.mkIf (USB_KEY != null) { + boot.supportedFilesystems = [ + "bcachefs" + ]; + + boot.initrd.systemd.services.unlock-bcachefs-custom = { + description = "Custom single bcachefs unlock for all subvolumes"; + + wantedBy = [ + "persist.mount" + "sysroot.mount" + "initrd-root-fs.target" + ]; + before = [ + "persist.mount" + "sysroot.mount" + "initrd-root-fs.target" + ]; + + after = [ + "initrd-root-device.target" + ]; + requires = [ + "initrd-root-device.target" + primaryDeviceUnit + ]; + + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + KeyringMode = lib.mkIf IMPERMANENCE "shared"; + }; + + script = '' + echo "Searching for USB Unlock Key..." + KEY_FOUND=0 + # 4 second search + for i in {1..40}; do + if [ -e "${USB_KEY}" ]; then + KEY_FOUND=1 + break + fi + sleep 0.1 + done + + if [ "$KEY_FOUND" -eq 1 ]; then + echo "USB Key found at ${USB_KEY}. Attempting unlock..." + mkdir -p /tmp/usb_key_mount + + # Mount read-only + if mount -t bcachefs -o ro "${USB_KEY}" /tmp/usb_key_mount; then + # Attempt unlock + ${pkgs.bcachefs-tools}/bin/bcachefs unlock -f /tmp/usb_key_mount/key "${PRIMARY}" + UNLOCK_STATUS=$? + + # Cleanup + umount /tmp/usb_key_mount + + if [ $UNLOCK_STATUS -eq 0 ]; then + echo "Bcachefs unlock successful!" + exit 0 + else + echo "Failed to unlock with USB key." + fi + else + echo "Failed to mount USB key device." + fi + else + echo "USB Key not found within timeout." + fi + + # 3. Fallback + echo "Proceeding to standard mount (password prompt will appear if still locked)..." + exit 0 + ''; + }; + }) + (lib.mkIf IMPERMANENCE { + boot.initrd.systemd.services.bcachefs-reset-root = { + description = "Reset bcachefs root subvolume before pivot"; + + after = [ + "initrd-root-device.target" + "cryptsetup.target" + "unlock-bcachefs-custom.service" + ]; + requires = [ + primaryDeviceUnit + "unlock-bcachefs-custom.service" + ]; + + before = [ + "sysroot.mount" + ]; + wantedBy = [ + "initrd-root-fs.target" + "sysroot.mount" + "initrd.target" + ]; + + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + KeyringMode = "shared"; + }; + + script = '' + cleanup() { + if [[ ! -e /primary_tmp/@root ]]; then + echo "Cleanup: Creating new @root" + bcachefs subvolume create /primary_tmp/@root + fi + echo "Cleanup: Unmounting /primary_tmp" + umount /primary_tmp || true + } + trap cleanup EXIT + + mkdir -p /primary_tmp + + echo "Mounting ${PRIMARY}..." + if ! mount "${PRIMARY}" /primary_tmp; then + echo "Mount failed. Cannot reset root." + exit 1 + fi + + if [[ -e /primary_tmp/@root ]]; then + mkdir -p /primary_tmp/@snapshots/old_roots + + # Use safe timestamp format (dashes instead of colons) + timestamp=$(date "+%Y-%m-%d_%H-%M-%S") + snap="/primary_tmp/@snapshots/old_roots/$timestamp" + echo "Snapshotting @root to $snap" + bcachefs subvolume snapshot /primary_tmp/@root "$snap" + + echo "Deleting current @root" + bcachefs subvolume delete /primary_tmp/@root + fi + + # Trap handles creating new root and unmount + ''; + }; + }) +] diff --git a/hosts/juni/impermanence-tools.nix b/hosts/juni/impermanence-tools.nix new file mode 100644 index 00000000..cf6a9467 --- /dev/null +++ b/hosts/juni/impermanence-tools.nix @@ -0,0 +1,78 @@ +{ + config, + lib, + pkgs, + ... +}: +let + cfg = config.impermanence.tools; + + bcacheImpermanenceBin = pkgs.writeShellScriptBin "bcache-impermanence" ( + builtins.readFile ./impermanence-tools.sh + ); +in +{ + options.impermanence.tools = { + # enable = lib.mkEnableOption "bcachefs impermanence tools (GC + CLI)"; + + snapshotRoot = lib.mkOption { + type = lib.types.str; + default = "/.snapshots/old_roots"; + description = "Root directory containing old root snapshots."; + }; + + gc = { + enable = lib.mkOption { + type = lib.types.bool; + default = true; + description = "Enable garbage collection of old root snapshots."; + }; + + keepPerMonth = lib.mkOption { + type = lib.types.int; + default = 1; + description = "Keep at least this many snapshots per calendar month (latest ones)."; + }; + + keepRecentWeeks = lib.mkOption { + type = lib.types.int; + default = 4; + description = "Keep at least one snapshot per ISO week within this many recent weeks."; + }; + + keepRecentCount = lib.mkOption { + type = lib.types.int; + default = 5; + description = "Always keep at least this many most recent snapshots overall."; + }; + }; + }; + + config = { + # config = lib.mkIf cfg.enable { + environment.systemPackages = [ + bcacheImpermanenceBin + pkgs.coreutils + pkgs.findutils + pkgs.diffutils + pkgs.bcachefs-tools + pkgs.fzf + ]; + + systemd.services."bcache-impermanence-gc" = lib.mkIf cfg.gc.enable { + description = "Garbage collect bcachefs impermanence snapshots"; + wantedBy = [ "multi-user.target" ]; + after = [ "multi-user.target" ]; + serviceConfig = { + Type = "oneshot"; + }; + script = '' + exec ${bcacheImpermanenceBin}/bin/bcache-impermanence gc \ + --snapshot-root ${cfg.snapshotRoot} \ + --keep-per-month ${toString cfg.gc.keepPerMonth} \ + --keep-recent-weeks ${toString cfg.gc.keepRecentWeeks} \ + --keep-recent-count ${toString cfg.gc.keepRecentCount} + ''; + }; + }; +} diff --git a/hosts/juni/impermanence-tools.sh b/hosts/juni/impermanence-tools.sh new file mode 100644 index 00000000..bd6d293a --- /dev/null +++ b/hosts/juni/impermanence-tools.sh @@ -0,0 +1,625 @@ +#!/usr/bin/env bash +set -eu + +SNAPSHOT_ROOT="/.snapshots/old_roots" +KEEP_PER_MONTH=1 +KEEP_RECENT_WEEKS=4 +KEEP_RECENT_COUNT=5 +DRY_RUN=0 +DIFF_MAX_DEPTH=0 + +usage() { + cat <&2; exit 1; } + SNAPSHOT_ROOT="$1" + ;; + --help|-h) + echo "Usage: bcache-impermanence ls [-nN] [--snapshot-root DIR]" >&2 + exit 0 + ;; + *) + echo "Unknown ls option: $1" >&2 + exit 1 + ;; + esac + shift + done + + local snaps + snaps=$(list_snapshots_desc) + + if [ -z "$snaps" ]; then + echo "No snapshots found in $SNAPSHOT_ROOT" >&2 + exit 1 + fi + + if [ "$count" -gt 0 ] 2>/dev/null; then + printf '%s\n' "$snaps" | head -n "$count" + else + printf '%s\n' "$snaps" + fi +} + +build_keep_set() { + # Prints snapshot names to keep, one per line, based on policies. + local now + now=$(date +%s) + + local snaps + snaps=$(list_snapshots_desc) + + if [ -z "$snaps" ]; then + return 0 + fi + + local tmpdir + tmpdir=$(mktemp -d) + + # Always keep newest KEEP_RECENT_COUNT snapshots. + if [ "$KEEP_RECENT_COUNT" -gt 0 ]; then + printf '%s\n' "$snaps" | head -n "$KEEP_RECENT_COUNT" >"$tmpdir/keep_recent" + fi + + # Per-month: keep up to KEEP_PER_MONTH newest per month. + if [ "$KEEP_PER_MONTH" -gt 0 ]; then + while read -r snap; do + [ -n "$snap" ] || continue + local month + month=${snap%_*} # YYYY-MM-DD + month=${month%-*} # YYYY-MM + local month_file="$tmpdir/month_$month" + local count=0 + if [ -f "$month_file" ]; then + count=$(wc -l <"$month_file") + fi + if [ "$count" -lt "$KEEP_PER_MONTH" ]; then + echo "$snap" >>"$month_file" + fi + done </dev/null || true) + [ -n "$ts" ] || continue + local age + age=$(( now - ts )) + if [ "$age" -gt "$max_age" ]; then + continue + fi + local week + week=$(date -d "${snap%_*} ${snap#*_}" +"%G-%V" 2>/dev/null || true) + [ -n "$week" ] || continue + local week_file="$tmpdir/week_$week" + if [ ! -f "$week_file" ]; then + echo "$snap" >"$week_file" + fi + done <&2; exit 1; } + SNAPSHOT_ROOT="$1" + ;; + --keep-per-month) + shift + [ "$#" -gt 0 ] || { echo "--keep-per-month requires a value" >&2; exit 1; } + KEEP_PER_MONTH="$1" + ;; + --keep-recent-weeks) + shift + [ "$#" -gt 0 ] || { echo "--keep-recent-weeks requires a value" >&2; exit 1; } + KEEP_RECENT_WEEKS="$1" + ;; + --keep-recent-count) + shift + [ "$#" -gt 0 ] || { echo "--keep-recent-count requires a value" >&2; exit 1; } + KEEP_RECENT_COUNT="$1" + ;; + --dry-run) + DRY_RUN=1 + ;; + --help|-h) + echo "Usage: bcache-impermanence gc [--snapshot-root DIR] [--keep-per-month N] [--keep-recent-weeks N] [--keep-recent-count N] [--dry-run]" >&2 + exit 0 + ;; + *) + echo "Unknown gc option: $1" >&2 + exit 1 + ;; + esac + shift + done + + if [ ! -d "$SNAPSHOT_ROOT" ]; then + echo "Snapshot root $SNAPSHOT_ROOT does not exist; nothing to do" >&2 + exit 0 + fi + + local snaps + snaps=$(list_snapshots_desc) + if [ -z "$snaps" ]; then + echo "No snapshots to process" >&2 + exit 0 + fi + + local keep + keep=$(build_keep_set) + + local tmpkeep + tmpkeep=$(mktemp -d) + while read -r k; do + [ -n "$k" ] || continue + : >"$tmpkeep/$k" + done <&2 + else + deleted=$((deleted + 1)) + fi + fi + done <"$children" + fi + + # Build immediate children under current_prefix. + while read -r st rel; do + [ -n "$rel" ] || continue + local sub + if [ -n "$current_prefix" ]; then + case "$rel" in + "$current_prefix") + # Exact match at this level; treat as leaf, not a separate child. + continue + ;; + "$current_prefix"/*) + sub="${rel#"$current_prefix"/}" + ;; + *) + continue + ;; + esac + else + sub="$rel" + fi + + [ -n "$sub" ] || continue + + local child + child="${sub%%/*}" + local child_rel + if [ -n "$current_prefix" ]; then + child_rel="$current_prefix/$child" + else + child_rel="$child" + fi + + if grep -qx "$child_rel" "$seen" 2>/dev/null; then + continue + fi + + echo "$st $child_rel" >>"$children" + echo "$child_rel" >>"$seen" + done <"$diff_list" + + rm -f "$seen" + + if [ ! -s "$children" ]; then + echo "No further differences under ${current_prefix:-/}" >&2 + rm -f "$children" + break + fi + + if ! command -v fzf >/dev/null 2>&1; then + echo "fzf is required for diff browsing" >&2 + rm -f "$children" + break + fi + + local preview_cmd + preview_cmd='sel_rel=$(printf "%s\n" {} | cut -d" " -f2-) +if [ "$sel_rel" = ".." ]; then + echo "[UP] .." + exit 0 +fi +snap_dir="'"$snapshot_dir"'" +a_path="$snap_dir/$sel_rel" +b_path="/$sel_rel" + +if [ ! -e "$a_path" ] && [ -e "$b_path" ]; then + echo "[ADDED] /$sel_rel"; echo + if [ -d "$b_path" ]; then + (cd / && find "$sel_rel" -maxdepth 3 -print 2>/dev/null || true) + else + diff -u /dev/null "$b_path" 2>/dev/null || cat "$b_path" 2>/dev/null || true + fi +elif [ -e "$a_path" ] && [ ! -e "$b_path" ]; then + echo "[REMOVED] /$sel_rel"; echo + if [ -d "$a_path" ]; then + (cd "$snap_dir" && find "$sel_rel" -maxdepth 3 -print 2>/dev/null || true) + else + diff -u "$a_path" /dev/null 2>/dev/null || cat "$a_path" 2>/dev/null || true + fi +else + if [ -d "$a_path" ] && [ -d "$b_path" ]; then + echo "[CHANGED DIR] /$sel_rel"; echo + diff -ru "$a_path" "$b_path" 2>/dev/null || true + else + echo "[CHANGED] /$sel_rel"; echo + diff -u "$a_path" "$b_path" 2>/dev/null || true + fi +fi +' + + local selection + selection=$(FZF_DEFAULT_OPTS="${FZF_DEFAULT_OPTS:-} --ansi --preview-window=right:70%:wrap" \ + fzf --prompt="[bcache-impermanence diff ${current_prefix:-/}] " \ + --preview "$preview_cmd" <"$children") || { + rm -f "$children" + break + } + + rm -f "$children" + + local sel_rel + sel_rel=$(printf "%s\n" "$selection" | cut -d" " -f2-) + + if [ "$sel_rel" = ".." ]; then + if [ -z "$current_prefix" ]; then + break + fi + if printf "%s" "$current_prefix" | grep -q '/'; then + current_prefix="${current_prefix%/*}" + else + current_prefix="" + fi + continue + fi + + # If this selection has descendants, drill down; otherwise treat as leaf and exit. + if grep -q " $sel_rel/" "$diff_list"; then + current_prefix="$sel_rel" + continue + else + # Leaf: user already saw diff in preview; exit. + break + fi + done +} + +cmd_diff() { + local snapshot_name="" + + while [ "$#" -gt 0 ]; do + case "$1" in + -s) + shift + [ "$#" -gt 0 ] || { echo "-s requires a snapshot name" >&2; exit 1; } + snapshot_name="$1" + ;; + --snapshot-root) + shift + [ "$#" -gt 0 ] || { echo "--snapshot-root requires a value" >&2; exit 1; } + SNAPSHOT_ROOT="$1" + ;; + --max-depth) + shift + [ "$#" -gt 0 ] || { echo "--max-depth requires a value" >&2; exit 1; } + DIFF_MAX_DEPTH="$1" + ;; + --help|-h) + echo "Usage: bcache-impermanence diff [-s SNAPSHOT] [--snapshot-root DIR] [--max-depth N] [PATH_PREFIX...]" >&2 + exit 0 + ;; + --*) + echo "Unknown diff option: $1" >&2 + exit 1 + ;; + *) + break + ;; + esac + shift + done + + if [ -z "$snapshot_name" ]; then + snapshot_name=$(latest_snapshot_name || true) + fi + + if [ -z "$snapshot_name" ]; then + echo "No snapshots found for diff" >&2 + exit 1 + fi + + local snapshot_dir + snapshot_dir="$SNAPSHOT_ROOT/$snapshot_name" + + if [ ! -d "$snapshot_dir" ]; then + echo "Snapshot directory $snapshot_dir does not exist" >&2 + exit 1 + fi + + if [ "$#" -eq 0 ]; then + set -- / + fi + + if ! command -v fzf >/dev/null 2>&1; then + echo "fzf is required for diff browsing" >&2 + exit 1 + fi + + # Build list of bind mounts backed by /persist so we can filter them out. + local persist_mounts + persist_mounts=$(awk '$2 ~ "^/persist(/|$)" { print $2 }' /proc/self/mounts || true) + + is_persist_backed() { + local p + p="$1" + if [ -z "$p" ]; then + return 1 + fi + if [ -z "$persist_mounts" ]; then + return 1 + fi + local m + for m in $persist_mounts; do + case "$p" in + "$m"|"$m"/*) return 0 ;; + esac + done + return 1 + } + + local prefixes + prefixes=("$@") + + local tmp + tmp=$(mktemp) + + for prefix in "${prefixes[@]}"; do + case "$prefix" in + /*) : ;; + *) + echo "Path prefix must be absolute: $prefix" >&2 + continue + ;; + esac + + # Skip prefixes that are themselves backed by /persist. + if is_persist_backed "$prefix"; then + continue + fi + + local rel + rel="${prefix#/}" + [ -z "$rel" ] && rel="." + + if [ "$DIFF_MAX_DEPTH" -gt 0 ] 2>/dev/null; then + ( + cd "$snapshot_dir" && find "$rel" -mindepth 1 -maxdepth "$DIFF_MAX_DEPTH" -print 2>/dev/null || true + ) | sed "s/^/A /" >>"$tmp" + + ( + cd / && find "$rel" -mindepth 1 -maxdepth "$DIFF_MAX_DEPTH" -print 2>/dev/null || true + ) | sed "s/^/B /" >>"$tmp" + else + ( + cd "$snapshot_dir" && find "$rel" -mindepth 1 -print 2>/dev/null || true + ) | sed "s/^/A /" >>"$tmp" + + ( + cd / && find "$rel" -mindepth 1 -print 2>/dev/null || true + ) | sed "s/^/B /" >>"$tmp" + fi + done + + if [ ! -s "$tmp" ]; then + echo "No files found under specified prefixes" >&2 + rm -f "$tmp" + exit 1 + fi + + local paths + paths=$(cut -d' ' -f2- "$tmp" | sort -u) + + local diff_list + diff_list=$(mktemp) + + while read -r rel; do + [ -n "$rel" ] || continue + local a_path b_path + a_path="$snapshot_dir/$rel" + b_path="/$rel" + + # Skip paths that reside under a /persist-backed mount in the live system. + if is_persist_backed "$b_path"; then + continue + fi + + local status + if [ ! -e "$a_path" ] && [ -e "$b_path" ]; then + status="added" + elif [ -e "$a_path" ] && [ ! -e "$b_path" ]; then + status="removed" + else + if [ -d "$a_path" ] && [ -d "$b_path" ]; then + if ! diff -rq "$a_path" "$b_path" >/dev/null 2>&1; then + status="changed-dir" + else + continue + fi + else + if ! diff -q "$a_path" "$b_path" >/dev/null 2>/dev/null; then + status="changed" + else + continue + fi + fi + fi + + echo "$status $rel" >>"$diff_list" + done <<<"$paths" + + rm -f "$tmp" + + if [ ! -s "$diff_list" ]; then + echo "No differences found between snapshot $snapshot_name and current system" >&2 + rm -f "$diff_list" + exit 0 + fi + + local initial_prefix="" + if [ "$#" -eq 1 ]; then + initial_prefix="${1#/}" + fi + + browse_diff_tree "$snapshot_name" "$snapshot_dir" "$diff_list" "$initial_prefix" + rm -f "$diff_list" +} + +main() { + if [ "$#" -lt 1 ]; then + usage + exit 1 + fi + + local cmd + cmd="$1" + shift || true + + case "$cmd" in + gc) + cmd_gc "$@" + ;; + ls) + cmd_ls "$@" + ;; + diff) + cmd_diff "$@" + ;; + --help|-h|help) + usage + ;; + *) + echo "Unknown subcommand: $cmd" >&2 + usage + exit 1 + ;; + esac +} + +main "$@" diff --git a/utilities/nixos-installers/examples/test/impermanence.nix b/hosts/juni/impermanence.nix similarity index 75% rename from utilities/nixos-installers/examples/test/impermanence.nix rename to hosts/juni/impermanence.nix index c621b069..d30d8473 100644 --- a/utilities/nixos-installers/examples/test/impermanence.nix +++ b/hosts/juni/impermanence.nix @@ -1,3 +1,4 @@ +{ primaryUser }: { ... }: { environment.persistence."/persist" = { @@ -14,13 +15,18 @@ "/etc/NetworkManager/system-connections" "/var/lib/bluetooth" + "/var/lib/NetworkManager" + "/var/lib/iwd" "/var/lib/fail2ban" ]; files = [ "/etc/machine-id" ]; - users.luser = { + users."${primaryUser}" = { directories = [ + ".ssh" + ".gnupg" + "projects" ".config/nixos-config" @@ -29,9 +35,13 @@ ".local/share/zoxide" - # KDE connect specific + # KDE ".config/kdeconnect" + # Chrome + ".config/google-chrome" + + # neovim ros_neovim ".local/state/nvim_ringofstorms_helium" ]; files = [ diff --git a/utilities/nixos-installers/examples/test/flake.nix b/utilities/nixos-installers/examples/test/flake.nix deleted file mode 100644 index 69fab485..00000000 --- a/utilities/nixos-installers/examples/test/flake.nix +++ /dev/null @@ -1,133 +0,0 @@ -{ - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11"; - home-manager.url = "github:rycee/home-manager/release-25.11"; - - common.url = "git+https://git.joshuabell.xyz/ringofstorms/dotfiles?dir=flakes/common"; - # de_plasma.url = "path:../../../../flakes/de_plasma"; - de_plasma.url = "git+https://git.joshuabell.xyz/ringofstorms/dotfiles?dir=flakes/de_plasma"; - ros_neovim.url = "git+https://git.joshuabell.xyz/ringofstorms/nvim"; - - impermanence.url = "github:nix-community/impermanence"; - }; - - outputs = - { - ... - }@inputs: - let - configurationName = "testbed"; - system = "x86_64-linux"; - primaryUser = "luser"; - configLocation = "/home/${primaryUser}/.config/nixos-config/utilities/nixos-installers/examples/${configurationName}"; - # configLocation = "/home/${primaryUser}/.config/nixos-config/hosts/${configurationName}"; - lib = inputs.nixpkgs.lib; - in - { - nixosConfigurations = { - "${configurationName}" = ( - lib.nixosSystem { - inherit system; - specialArgs = { - inherit inputs; - }; - modules = [ - inputs.impermanence.nixosModules.impermanence - inputs.home-manager.nixosModules.default - - inputs.ros_neovim.nixosModules.default - ( - { ... }: - { - ringofstorms-nvim.includeAllRuntimeDependencies = true; - } - ) - - inputs.de_plasma.nixosModules.default - - inputs.common.nixosModules.essentials - inputs.common.nixosModules.git - inputs.common.nixosModules.tmux - inputs.common.nixosModules.boot_systemd - inputs.common.nixosModules.hardening - inputs.common.nixosModules.jetbrains_font - inputs.common.nixosModules.nix_options - inputs.common.nixosModules.no_sleep - inputs.common.nixosModules.timezone_auto - inputs.common.nixosModules.tty_caps_esc - inputs.common.nixosModules.zsh - - ./hardware-configuration.nix - ./impermanence.nix - ./test.nix - ( - { - config, - pkgs, - upkgs, - lib, - ... - }: - rec { - system.stateVersion = "25.05"; - services.openssh.settings.PasswordAuthentication = lib.mkForce true; - - ringofstorms.dePlasma = { - enable = true; - gpu.intel.enable = true; - sddm.autologinUser = "luser"; - }; - - # Home Manager - home-manager = { - useUserPackages = true; - useGlobalPkgs = true; - backupFileExtension = "bak"; - # add all normal users to home manager so it applies to them - users = lib.mapAttrs (name: user: { - home.stateVersion = "25.05"; - programs.home-manager.enable = true; - }) (lib.filterAttrs (name: user: user.isNormalUser or false) users.users); - - sharedModules = [ - inputs.common.homeManagerModules.tmux - inputs.common.homeManagerModules.atuin - inputs.common.homeManagerModules.direnv - inputs.common.homeManagerModules.git - inputs.common.homeManagerModules.postgres_cli_options - inputs.common.homeManagerModules.starship - inputs.common.homeManagerModules.zoxide - inputs.common.homeManagerModules.zsh - ]; - - extraSpecialArgs = { - inherit inputs; - inherit upkgs; - }; - }; - - # System configuration - networking.hostName = configurationName; - programs.nh.flake = configLocation; - nixpkgs.config.allowUnfree = true; - users.mutableUsers = false; - users.users = { - "${primaryUser}" = { - isNormalUser = true; - hashedPassword = "$y$j9T$v1QhXiZMRY1pFkPmkLkdp0$451GvQt.XFU2qCAi4EQNd1BEqjM/CH6awU8gjcULps6"; # "test" password - extraGroups = [ - "wheel" - "networkmanager" - ]; - openssh.authorizedKeys.keys = [ - ]; - }; - }; - } - ) - ]; - } - ); - }; - }; -} diff --git a/utilities/nixos-installers/examples/test/hardware-configuration.nix b/utilities/nixos-installers/examples/test/hardware-configuration.nix deleted file mode 100644 index 865dc023..00000000 --- a/utilities/nixos-installers/examples/test/hardware-configuration.nix +++ /dev/null @@ -1,120 +0,0 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: -let - NIXBOOT = "/dev/disk/by-uuid/641A-6BDB"; - NIXROOT ="/dev/disk/by-uuid/ae94db42-ec46-4e2f-a98a-118359428a68"; - cryptroot = "/dev/disk/by-uuid/49f11bf1-d4b7-4188-9203-4d7a42569afa"; - - USB_KEY = "/dev/disk/by-uuid/9985-EBD1"; -in -{ - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "sdhci_pci" "ehci_pci" "uas" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/boot" = - { device = NIXBOOT; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; - - boot.initrd.luks.devices."cryptroot" = { - device = NIXROOT; - - # Auto decrypt - keyFile = USB_KEY; - keyFileSize = 5000; - keyFileOffset = 5443; - - tryEmptyPassphrase = true; - fallbackToPassword = true; - crypttabExtraOpts = [ "tries=2" ]; - }; - - fileSystems."/" = - { device = cryptroot; - fsType = "btrfs"; - options = [ "subvol=@root" "compress=zstd" ]; - }; - - fileSystems."/nix" = - { device = cryptroot; - fsType = "btrfs"; - options = [ "subvol=@nix" "compress=zstd" "noatime" ]; - }; - - fileSystems."/persist" = - { device = cryptroot; - neededForBoot = true; - fsType = "btrfs"; - options = [ "subvol=@persist" "compress=zstd" ]; - }; - - fileSystems."/.swap" = - { device = cryptroot; - fsType = "btrfs"; - options = [ "subvol=@swap" "noatime" ]; - }; - - fileSystems."/.snapshots" = - { device = cryptroot; - fsType = "btrfs"; - options = [ "subvol=@snapshots" "compress=zstd" "noatime"]; - }; - - services.btrfs.autoScrub = { - enable = true; - # syntax as defined by https://www.freedesktop.org/software/systemd/man/systemd.time.html#Calendar%20Event s - interval = "monthly"; - fileSystems = ["/"]; - }; - - swapDevices = [{ - device = "/.swap/swapfile"; - size = 8*1024; # Creates an 8GB swap file - }]; - - boot.initrd.postResumeCommands = lib.mkAfter '' - mkdir /btrfs_tmp - mount ${cryptroot} /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 - ''; - - # Enables DHCP on each ethernet and wireless interface. In case of scripted networking - # (the default) this is the recommended approach. When using systemd-networkd it's - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp1s0.useDHCP = lib.mkDefault true; - # networking.interfaces.enp3s0.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/utilities/nixos-installers/examples/test/test.nix b/utilities/nixos-installers/examples/test/test.nix deleted file mode 100644 index ed15a31c..00000000 --- a/utilities/nixos-installers/examples/test/test.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - powerMangement.enable = true; - # powerManagement.powertop.enable = true; - powerMangement.cpuFreqGovernor = "performance"; -} diff --git a/utilities/nixos-installers/flake.lock b/utilities/nixos-installers/flake.lock index 4f045245..cad2ef1b 100644 --- a/utilities/nixos-installers/flake.lock +++ b/utilities/nixos-installers/flake.lock @@ -2,15 +2,16 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1764776358, - "narHash": "sha256-MxXSCRiV7DI5U3Ra1UxVJTTUyKsONAE8+8QdSXsGIhA=", + "lastModified": 1766309749, + "narHash": "sha256-3xY8CZ4rSnQ0NqGhMKAy5vgC+2IVK0NoVEzDoOh4DA4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "0b8cec1eb2241336971009cdd4af641b930d0d97", + "rev": "a6531044f6d0bef691ea18d4d4ce44d0daa6e816", "type": "github" }, "original": { "owner": "nixos", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -34,11 +35,11 @@ "nvim_plugin-CopilotC-Nvim/CopilotChat.nvim": { "flake": false, "locked": { - "lastModified": 1763599441, - "narHash": "sha256-RwCQQfgQIQITVSJSX+QOSIOChT7E2AXdIwfU07S9GaU=", + "lastModified": 1766398838, + "narHash": "sha256-pO+bnwywDmhEpmU3Zw2VCAT8uLEgRlpHcAfW9NwqWis=", "owner": "CopilotC-Nvim", "repo": "CopilotChat.nvim", - "rev": "df5376c132382dd47e3e552612940cbf25b3580c", + "rev": "ed94e56ee8292f5df351e17709ff4b178ca84200", "type": "github" }, "original": { @@ -82,11 +83,11 @@ "nvim_plugin-MeanderingProgrammer/render-markdown.nvim": { "flake": false, "locked": { - "lastModified": 1764732647, - "narHash": "sha256-jya61X22LbcT4hpeio3qE/oOI/lvqKpf09oGEHHvQdA=", + "lastModified": 1765914395, + "narHash": "sha256-A7pm8sBQWsZl3Kc7JBh3gBUyKb6GfJ5J0zfn3mSGjKs=", "owner": "MeanderingProgrammer", "repo": "render-markdown.nvim", - "rev": "b2b135347e299ffbf7f4123fb7811899b0c9f4b8", + "rev": "07d088bf8bdadd159eb807b90eaee86a4778383f", "type": "github" }, "original": { @@ -162,11 +163,11 @@ "nvim_plugin-b0o/schemastore.nvim": { "flake": false, "locked": { - "lastModified": 1764655248, - "narHash": "sha256-9nUBzwbMkzLySMW/Y0EkFpvFgHeW5YDQ3J3moVQarjQ=", + "lastModified": 1766167236, + "narHash": "sha256-+Z1foMyKMxyMmYqmyu1KWiyL4Fc0Zm2SYV7RoZ9Ut2I=", "owner": "b0o", "repo": "schemastore.nvim", - "rev": "e9c00ea7813006dfa29f35c174f83f0184d45a93", + "rev": "8b92ea89835b8e5dbc779a675ebb0e5fcb9a1993", "type": "github" }, "original": { @@ -178,11 +179,11 @@ "nvim_plugin-catppuccin/nvim": { "flake": false, "locked": { - "lastModified": 1764084803, - "narHash": "sha256-ds+Rm9H00s++RC1dH4OQpCg1FXSm4HuwDGzr4ah0YBU=", + "lastModified": 1765701669, + "narHash": "sha256-8GKpGGdeBwxuMrheojyl162CzUntRcq9AktQVmKbpuI=", "owner": "catppuccin", "repo": "nvim", - "rev": "ce4a8e0d5267e67056f9f4dcf6cb1d0933c8ca00", + "rev": "ce8d176faa4643e026e597ae3c31db59b63cef09", "type": "github" }, "original": { @@ -194,11 +195,11 @@ "nvim_plugin-chrisgrieser/nvim-early-retirement": { "flake": false, "locked": { - "lastModified": 1764104935, - "narHash": "sha256-mvs0uIoxidy3jfC6oymwhaZVRbJrW+/kuMcIpR8TI6M=", + "lastModified": 1766186911, + "narHash": "sha256-COYpFOZTMGpZVfSJFMix/6TM5Eeemngcx1iukMa2nDE=", "owner": "chrisgrieser", "repo": "nvim-early-retirement", - "rev": "cd29cf40af7473530a8598245ba1d348fd5e1fa0", + "rev": "86edd80026e4eea2cef7d1e5dadcf34432e6098d", "type": "github" }, "original": { @@ -226,11 +227,11 @@ "nvim_plugin-folke/lazy.nvim": { "flake": false, "locked": { - "lastModified": 1762421181, - "narHash": "sha256-h5404njTAfqMJFQ3MAr2PWSbV81eS4aIs0cxAXkT0EM=", + "lastModified": 1765971162, + "narHash": "sha256-5A4kducPwKb5fKX4oSUFvo898P0dqfsqqLxFaXBsbQY=", "owner": "folke", "repo": "lazy.nvim", - "rev": "85c7ff3711b730b4030d03144f6db6375044ae82", + "rev": "306a05526ada86a7b30af95c5cc81ffba93fef97", "type": "github" }, "original": { @@ -338,11 +339,11 @@ "nvim_plugin-j-hui/fidget.nvim": { "flake": false, "locked": { - "lastModified": 1761243883, - "narHash": "sha256-XXTeJweQRIsC/WFhFxFbepOETV8e5Wfmh513su2Wve0=", + "lastModified": 1766143069, + "narHash": "sha256-uy2Z6vn9UYDN7Dr7iuiTrualRQdmUT0dwHP/eZXA/uA=", "owner": "j-hui", "repo": "fidget.nvim", - "rev": "e32b672d8fd343f9d6a76944fedb8c61d7d8111a", + "rev": "64463022a1f2ff1318ab22a2ea4125ed9313a483", "type": "github" }, "original": { @@ -450,11 +451,11 @@ "nvim_plugin-mfussenegger/nvim-lint": { "flake": false, "locked": { - "lastModified": 1763729870, - "narHash": "sha256-9fIZPUZhnQEHJtvboCs+A2QXo4UMTFejuHNagDkfkRk=", + "lastModified": 1766127989, + "narHash": "sha256-ysIoJ8uMAHu/OCemQ3yUYMhKIVnSDLQCvJH0SaGIOK4=", "owner": "mfussenegger", "repo": "nvim-lint", - "rev": "d1118791070d090777398792a73032a0ca5c79ff", + "rev": "7a64f4067065c16a355d40d0d599b8ca6b25de6d", "type": "github" }, "original": { @@ -466,11 +467,11 @@ "nvim_plugin-mrcjkb/rustaceanvim": { "flake": false, "locked": { - "lastModified": 1764542305, - "narHash": "sha256-t7xAQ9sczLyA1zODmD+nEuWuLnhrfSOoPu/4G/YTGdU=", + "lastModified": 1766276825, + "narHash": "sha256-dcXnh5SYPh1VRctTuCnuVPKFQuAI4XEvQasolCOv+Xw=", "owner": "mrcjkb", "repo": "rustaceanvim", - "rev": "6c3785d6a230bec63f70c98bf8e2842bed924245", + "rev": "0fa0462a2d6c9629e0bd03d1902e6a1472ceac3e", "type": "github" }, "original": { @@ -482,11 +483,11 @@ "nvim_plugin-neovim/nvim-lspconfig": { "flake": false, "locked": { - "lastModified": 1764477618, - "narHash": "sha256-IpVDEOr//Jy+r3Z5Qo8nxDa3fNO+BTBKzAmbqvxtCQE=", + "lastModified": 1766443238, + "narHash": "sha256-P95gPOwJ+rRofLb8iV5UOnh26to1I3sFrWGlGxHyz1M=", "owner": "neovim", "repo": "nvim-lspconfig", - "rev": "effe4bf2e1afb881ea67291c648b68dd3dfc927a", + "rev": "b34c08e0ea22bac67798f00238318fd16bd99b7c", "type": "github" }, "original": { @@ -594,11 +595,11 @@ "nvim_plugin-nvim-telescope/telescope.nvim": { "flake": false, "locked": { - "lastModified": 1764418954, - "narHash": "sha256-e6XSJRv4KB0z+nzGWmlV/YZNwWsyrrpQTloePRKWmw4=", + "lastModified": 1766268405, + "narHash": "sha256-O1rUiVKpDSvKMkZMFaEd8/ACcSgO/lfa1+Hc8uHbFOI=", "owner": "nvim-telescope", "repo": "telescope.nvim", - "rev": "e69b434b968a33815e2f02a5c7bd7b8dd4c7d4b2", + "rev": "e709d31454ee6e6157f0537f861f797bd44c0bad", "type": "github" }, "original": { @@ -610,11 +611,11 @@ "nvim_plugin-nvim-tree/nvim-tree.lua": { "flake": false, "locked": { - "lastModified": 1764713359, - "narHash": "sha256-dSaO5esPKj1y4vNyLb3AK9egmFJsmWxkGOT+etJsbRA=", + "lastModified": 1766192360, + "narHash": "sha256-Br+r9f/2o0AkewnGm7kFNfl3uYm1Akkklof0Sm5AL2M=", "owner": "nvim-tree", "repo": "nvim-tree.lua", - "rev": "59088b96a32ea47caf4976e164dbd88b86447fb7", + "rev": "b8b44b6a2494d086a9177251a119f9daec6cace8", "type": "github" }, "original": { @@ -626,11 +627,11 @@ "nvim_plugin-nvim-tree/nvim-web-devicons": { "flake": false, "locked": { - "lastModified": 1761440007, - "narHash": "sha256-klBjUtj0AvarN5a6O8Hh2t5BuOTe/m3ps2cHnlxVJvE=", + "lastModified": 1766287594, + "narHash": "sha256-ZdFRd0//C0Lle4cYIoAHBdz/yvQqmeylLNwvSifaWm4=", "owner": "nvim-tree", "repo": "nvim-web-devicons", - "rev": "8dcb311b0c92d460fac00eac706abd43d94d68af", + "rev": "6788013bb9cb784e606ada44206b0e755e4323d7", "type": "github" }, "original": { @@ -642,11 +643,11 @@ "nvim_plugin-nvim-treesitter/nvim-treesitter-context": { "flake": false, "locked": { - "lastModified": 1762769683, - "narHash": "sha256-ICwAUXKngSPsJ6VV+84KUPqtAwlGPrm4FIf9ioisiz8=", + "lastModified": 1765030629, + "narHash": "sha256-3NtwOA9d2ezLoo7qnzKAr6gwEdcpUqLc7ou4QI+9rDY=", "owner": "nvim-treesitter", "repo": "nvim-treesitter-context", - "rev": "660861b1849256398f70450afdf93908d28dc945", + "rev": "64dd4cf3f6fd0ab17622c5ce15c91fc539c3f24a", "type": "github" }, "original": { @@ -754,11 +755,11 @@ "nvim_plugin-stevearc/conform.nvim": { "flake": false, "locked": { - "lastModified": 1764743081, - "narHash": "sha256-qCjrMt3fsRbLr/iM7nFHG7oKtyTTGcse4/cJbm3odJE=", + "lastModified": 1766346125, + "narHash": "sha256-Pp4bGTlZEqxHoHqVCEekDdg2jvNayxAuBReK4HJ6yGg=", "owner": "stevearc", "repo": "conform.nvim", - "rev": "ffe26e8df8115c9665d24231f8a49fadb2d611ce", + "rev": "5420c4b5ea0aeb99c09cfbd4fd0b70d257b44f25", "type": "github" }, "original": { @@ -866,11 +867,11 @@ "nvim_plugin-zbirenbaum/copilot.lua": { "flake": false, "locked": { - "lastModified": 1764638966, - "narHash": "sha256-wQ6SfAunVMd5tNeM7RMvrfPC2ELRibyEQboVQlU/fBs=", + "lastModified": 1766207702, + "narHash": "sha256-879050VUJpWBrHxUA3hRpcYbn3KgBGpVpKLdSVOwbIA=", "owner": "zbirenbaum", "repo": "copilot.lua", - "rev": "881f99b827d65b41f522eecc21b112cf518028ac", + "rev": "e78d1ffebdf6ccb6fd8be4e6898030c1cf5f9b64", "type": "github" }, "original": { @@ -946,11 +947,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1764777428, - "narHash": "sha256-wFfPnXo1P+NwSK+Y7xYVwt0mbYhe9uBrf80T5KpBV5Q=", + "lastModified": 1766468664, + "narHash": "sha256-QfAZCWfwIDiOvikyMb9Tsg2X0n659zd6DxDT88ILE4I=", "ref": "refs/heads/master", - "rev": "ee642c429fced7d51c5f9c9694034f6222a1186f", - "revCount": 324, + "rev": "99a57f25b959d7226d68f1b53ff60f0c4cc5b210", + "revCount": 326, "type": "git", "url": "https://git.joshuabell.xyz/ringofstorms/nvim" }, @@ -967,11 +968,11 @@ ] }, "locked": { - "lastModified": 1764729618, - "narHash": "sha256-z4RA80HCWv2los1KD346c+PwNPzMl79qgl7bCVgz8X0=", + "lastModified": 1766457837, + "narHash": "sha256-aeBbkQ0HPFNOIsUeEsXmZHXbYq4bG8ipT9JRlCcKHgU=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "52764074a85145d5001bf0aa30cb71936e9ad5b8", + "rev": "2c7510a559416d07242621d036847152d970612b", "type": "github" }, "original": { @@ -982,11 +983,11 @@ }, "stable": { "locked": { - "lastModified": 1765838191, - "narHash": "sha256-m5KWt1nOm76ILk/JSCxBM4MfK3rYY7Wq9/TZIIeGnT8=", + "lastModified": 1766885793, + "narHash": "sha256-P6RVkrM9JLCW6xBjSwHfgTOQ1JwBUma5xe5LI8xAPC0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "c6f52ebd45e5925c188d1a20119978aa4ffd5ef6", + "rev": "9ef261221d1e72399f2036786498d78c38185c46", "type": "github" }, "original": { @@ -998,11 +999,11 @@ }, "unstable": { "locked": { - "lastModified": 1765186076, - "narHash": "sha256-hM20uyap1a0M9d344I692r+ik4gTMyj60cQWO+hAYP8=", + "lastModified": 1766902085, + "narHash": "sha256-coBu0ONtFzlwwVBzmjacUQwj3G+lybcZ1oeNSQkgC0M=", "owner": "nixos", "repo": "nixpkgs", - "rev": "addf7cf5f383a3101ecfba091b98d0a1263dc9b8", + "rev": "c0b0e0fddf73fd517c3471e546c0df87a42d53f4", "type": "github" }, "original": { diff --git a/utilities/nixos-installers/install_bcachefs.md b/utilities/nixos-installers/install_bcachefs.md index a99449ee..c61ad71e 100644 --- a/utilities/nixos-installers/install_bcachefs.md +++ b/utilities/nixos-installers/install_bcachefs.md @@ -37,6 +37,9 @@ mkswap /dev/$SWAP swapon /dev/$SWAP ``` +> TIP: Save encryption password in password manager + +> Copy the External/Internal/Magic number output UUIDS + ### Setup subvolumes ```sh @@ -64,6 +67,7 @@ umount /mnt ```sh DEV_B="/dev/disk/by-uuid/"$(lsblk -o name,uuid | grep $BOOT | awk '{print $2}') DEV_P="/dev/disk/by-uuid/"$(lsblk -o name,uuid | grep $PRIMARY | awk '{print $2}') +echo $DEV_B && echo $DEV_P mount -t bcachefs -o X-mount.subdir=@root $DEV_P /mnt mount -t vfat $DEV_B /mnt/boot --mkdir mount -t bcachefs -o X-mount.mkdir,X-mount.subdir=@nix,relatime $DEV_P /mnt/nix @@ -78,14 +82,24 @@ nixos-generate-config --root /mnt ``` - Copy useful bits out into real config in repo (primarily swap/kernel modules) +- Decide on SWAP, USB key unlock, impermanence + - Use i001 as an example install with this setup - Run nixos-install ```sh -# If setup remotely we can install remotely as well like this -nixos-install --flake "git+https://git.joshuabell.xyz/ringofstorms/dotfiles?dir=hosts/i001#i001" -nixos-install --flake "git+https://git.joshuabell.xyz/ringofstorms/dotfiles?dir=hosts/h002#h002" -# or push from more powerful machine -# TODO how do I do this for initial install? nixos-anywhere? +# If setup remotely we can install from pushed up flake like so from the target host +HOST=i001 +nixos-install --flake "git+https://git.joshuabell.xyz/ringofstorms/dotfiles?dir=hosts/$HOST#$HOST" + +# NOTE not sure if this works very well, seems to be partially +# or push from more powerful machine that can build faster, on host +HOST=juni +cd hosts/$HOST && nixos-rebuild build --flake ".#$HOST" +NIX_SSHOPTS="-i /run/agenix/nix2nix" nix-copy-closure --to $HOST --use-substitutes --gzip result +CLOSURE=$(readlink -f result) +echo $CLOSURE +# on target +nixos-install --system $CLOSURE ``` - After boot