From ba617d429b8fccbafc29712466467e7f780144ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tristan=20Dani=C3=ABl=20Maat?= Date: Thu, 20 Nov 2025 14:20:46 +0800 Subject: [PATCH 1/4] chore(flake): Bump to new sonnenshift version with better flake --- flake.lock | 83 ++++++++++++++++++++++-------------------------------- flake.nix | 9 +----- 2 files changed, 34 insertions(+), 58 deletions(-) diff --git a/flake.lock b/flake.lock index ad4903f..207a0b0 100644 --- a/flake.lock +++ b/flake.lock @@ -10,17 +10,21 @@ "sonnenshift", "crate2nix" ], - "git-hooks": "git-hooks", "nixpkgs": [ + "sonnenshift", "nixpkgs" + ], + "pre-commit-hooks": [ + "sonnenshift", + "crate2nix" ] }, "locked": { - "lastModified": 1760971495, - "narHash": "sha256-IwnNtbNVrlZIHh7h4Wz6VP0Furxg9Hh0ycighvL5cZc=", + "lastModified": 1709700175, + "narHash": "sha256-A0/6ZjLmT9qdYzKHmevnEIC7G+GiZ4UCr8v0poRPzds=", "owner": "cachix", "repo": "cachix", - "rev": "c5bfd933d1033672f51a863c47303fc0e093c2d2", + "rev": "be97b37989f11b724197b5f4c7ffd78f12c8c4bf", "type": "github" }, "original": { @@ -45,6 +49,7 @@ "flake-parts": "flake-parts", "nix-test-runner": "nix-test-runner", "nixpkgs": [ + "sonnenshift", "nixpkgs" ], "pre-commit-hooks": "pre-commit-hooks" @@ -87,6 +92,10 @@ }, "devshell": { "inputs": { + "flake-utils": [ + "deploy-rs", + "utils" + ], "nixpkgs": [ "sonnenshift", "crate2nix", @@ -94,11 +103,11 @@ ] }, "locked": { - "lastModified": 1762521437, - "narHash": "sha256-RXN+lcx4DEn3ZS+LqEJSUu/HH+dwGvy0syN7hTo/Chg=", + "lastModified": 1711099426, + "narHash": "sha256-HzpgM/wc3aqpnHJJ2oDqPBkNsqWbW0WfWUO8lKu8nGk=", "owner": "numtide", "repo": "devshell", - "rev": "07bacc9531f5f4df6657c0a02a806443685f384a", + "rev": "2d45b54ca4a183f2fdcf4b19c895b64fbf620ee8", "type": "github" }, "original": { @@ -249,43 +258,12 @@ "type": "github" } }, - "git-hooks": { - "inputs": { - "flake-compat": [ - "sonnenshift", - "crate2nix", - "cachix", - "flake-compat" - ], - "gitignore": "gitignore", - "nixpkgs": [ - "sonnenshift", - "crate2nix", - "cachix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1762868777, - "narHash": "sha256-QqS72GvguP56oKDNUckWUPNJHjsdeuXh5RyoKz0wJ+E=", - "owner": "cachix", - "repo": "git-hooks.nix", - "rev": "c5c3147730384576196fb5da048a6e45dee10d56", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "git-hooks.nix", - "type": "github" - } - }, "gitignore": { "inputs": { "nixpkgs": [ "sonnenshift", "crate2nix", - "cachix", - "git-hooks", + "pre-commit-hooks", "nixpkgs" ] }, @@ -342,25 +320,30 @@ "crate2nix", "flake-compat" ], - "gitignore": [ + "flake-utils": [ "sonnenshift", "crate2nix", - "cachix", - "git-hooks", - "gitignore" + "devshell", + "flake-utils" ], + "gitignore": "gitignore", "nixpkgs": [ "sonnenshift", "crate2nix", "nixpkgs" + ], + "nixpkgs-stable": [ + "sonnenshift", + "crate2nix", + "nixpkgs" ] }, "locked": { - "lastModified": 1763319842, - "narHash": "sha256-YG19IyrTdnVn0l3DvcUYm85u3PaqBt6tI6VvolcuHnA=", + "lastModified": 1712055707, + "narHash": "sha256-4XLvuSIDZJGS17xEwSrNuJLL7UjDYKGJSbK1WWX2AK8=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "7275fa67fbbb75891c16d9dee7d88e58aea2d761", + "rev": "e35aed5fda3cc79f88ed7f1795021e559582093a", "type": "github" }, "original": { @@ -478,11 +461,11 @@ ] }, "locked": { - "lastModified": 1748144928, - "narHash": "sha256-OPdi6AjrWWwZlukNwDHDWAf1CCFkHsf8JbA3rJoibXM=", + "lastModified": 1763619077, + "narHash": "sha256-dlfamaoIzFEgwgtzPJuw5Tl5SqjbWcV8CsbP2hVBeuI=", "ref": "refs/heads/main", - "rev": "429036aa8630d2325f8a9f067cc041d628279a8e", - "revCount": 24, + "rev": "64a2c8a3743ea6897ecac6692fba8aebc3389fca", + "revCount": 26, "type": "git", "url": "ssh://git@github.com/sonnenshift/battery-manager" }, diff --git a/flake.nix b/flake.nix index 386de98..334f73c 100644 --- a/flake.nix +++ b/flake.nix @@ -50,16 +50,9 @@ url = "git+ssh://git@github.com/sonnenshift/battery-manager"; inputs = { nixpkgs.follows = "nixpkgs"; - crate2nix.inputs = { - nixpkgs.follows = "nixpkgs"; flake-compat.follows = "deploy-rs/flake-compat"; - cachix.inputs.nixpkgs.follows = "nixpkgs"; - pre-commit-hooks.inputs.gitignore.follows = "sonnenshift/crate2nix/cachix/git-hooks/gitignore"; - - # Yes, they do this insanity: - # https://github.com/nix-community/crate2nix/issues/371 - crate2nix_stable.follows = "sonnenshift/crate2nix"; + devshell.inputs.flake-utils.follows = "deploy-rs/utils"; }; }; }; -- 2.51.2 From 92b257e1af1f81bf00d560f80110d4de397dc5ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tristan=20Dani=C3=ABl=20Maat?= Date: Thu, 20 Nov 2025 14:39:29 +0800 Subject: [PATCH 2/4] chore(devshell): Use deploy-rs from nixpkgs for binary caching --- flake.nix | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 334f73c..989ae71 100644 --- a/flake.nix +++ b/flake.nix @@ -63,7 +63,6 @@ self, nixpkgs, sops-nix, - deploy-rs, ... }@inputs: let @@ -78,6 +77,25 @@ ./configuration/hardware-specific/vm.nix ]; }; + + # deploy-rs unfortunately uses an `import nixpkgs`, and its + # library functions depend on an instantiated nixpkgs, so we + # can't get around multi-nixpkgs-eval. + inherit + (import nixpkgs { + inherit system; + overlays = [ + inputs.deploy-rs.overlays.default + (_: prev: { + deploy-rs = { + inherit (nixpkgs.legacyPackages.${system}) deploy-rs; + inherit (prev.deploy-rs) lib; + }; + }) + ]; + }) + deploy-rs + ; in { ################## @@ -105,7 +123,7 @@ profiles.system = { user = "root"; - path = deploy-rs.lib.${system}.activate.nixos self.nixosConfigurations.hetzner-1; + path = deploy-rs.lib.activate.nixos self.nixosConfigurations.hetzner-1; }; sshUser = "tlater"; @@ -159,7 +177,7 @@ packages = nixpkgs.lib.attrValues { inherit (sops-nix.packages.${system}) sops-import-keys-hook sops-init-gpg-key; - inherit (deploy-rs.packages.${system}) default; + inherit (deploy-rs) deploy-rs; }; }; -- 2.51.2 From 016ae5ec54f762d152c2075bc8c41be453e12587 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tristan=20Dani=C3=ABl=20Maat?= Date: Thu, 20 Nov 2025 14:40:50 +0800 Subject: [PATCH 3/4] chore(flake): Switch to channel tarball for nixpkgs input --- flake.lock | 17 +++++++---------- flake.nix | 2 +- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/flake.lock b/flake.lock index 207a0b0..6c5d414 100644 --- a/flake.lock +++ b/flake.lock @@ -299,18 +299,15 @@ }, "nixpkgs": { "locked": { - "lastModified": 1760782625, - "narHash": "sha256-qeSmHF66cMiHObiBhm8IngmqDBEcqNdBSSoAjuE6tTw=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "f2ee78c4eb601be36a277e1779a7a87655419dad", - "type": "github" + "lastModified": 1763509821, + "narHash": "sha256-ibZr0ONEUA1W2WAdTzgm9/6jBE+tM20j1YW2FK4RZ/k=", + "rev": "659aa6fa27619d04de231b4cc0c938905dfa01e9", + "type": "tarball", + "url": "https://releases.nixos.org/nixos/25.05-small/nixos-25.05.812929.659aa6fa2761/nixexprs.tar.xz?lastModified=1763509821&rev=659aa6fa27619d04de231b4cc0c938905dfa01e9" }, "original": { - "owner": "nixos", - "ref": "nixos-25.05-small", - "repo": "nixpkgs", - "type": "github" + "type": "tarball", + "url": "https://channels.nixos.org/nixos-25.05-small/nixexprs.tar.xz" } }, "pre-commit-hooks": { diff --git a/flake.nix b/flake.nix index 989ae71..029fd9a 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "tlater.net host configuration"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05-small"; + nixpkgs.url = "https://channels.nixos.org/nixos-25.05-small/nixexprs.tar.xz"; ## Nix/OS utilities -- 2.51.2 From 324d2d94f3cbe99951626eb4d9b2b323ccd98d25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tristan=20Dani=C3=ABl=20Maat?= Date: Thu, 20 Nov 2025 14:49:28 +0800 Subject: [PATCH 4/4] update: Update flake inputs --- flake.lock | 55 +++++++++++++++++++++++++----------------------------- 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/flake.lock b/flake.lock index 6c5d414..05a6a5b 100644 --- a/flake.lock +++ b/flake.lock @@ -77,11 +77,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1756719547, - "narHash": "sha256-N9gBKUmjwRKPxAafXEk1EGadfk2qDZPBQp4vXWPHINQ=", + "lastModified": 1762286984, + "narHash": "sha256-9I2H9x5We6Pl+DBYHjR1s3UT8wgwcpAH03kn9CqtdQc=", "owner": "serokell", "repo": "deploy-rs", - "rev": "125ae9e3ecf62fb2c0fd4f2d894eb971f1ecaed2", + "rev": "9c870f63e28ec1e83305f7f6cb73c941e699f74f", "type": "github" }, "original": { @@ -123,11 +123,11 @@ ] }, "locked": { - "lastModified": 1760701190, - "narHash": "sha256-y7UhnWlER8r776JsySqsbTUh2Txf7K30smfHlqdaIQw=", + "lastModified": 1762276996, + "narHash": "sha256-TtcPgPmp2f0FAnc+DMEw4ardEgv1SGNR3/WFGH0N19M=", "owner": "nix-community", "repo": "disko", - "rev": "3a9450b26e69dcb6f8de6e2b07b3fc1c288d85f5", + "rev": "af087d076d3860760b3323f6b583f4d828c1ac17", "type": "github" }, "original": { @@ -145,11 +145,11 @@ "pyproject-nix": "pyproject-nix" }, "locked": { - "lastModified": 1763413832, - "narHash": "sha256-dkqBwDXiv8MPoFyIvOuC4bVubAP+TlVZUkVMB78TTSg=", + "lastModified": 1735160684, + "narHash": "sha256-n5CwhmqKxifuD4Sq4WuRP/h5LO6f23cGnSAuJemnd/4=", "owner": "nix-community", "repo": "dream2nix", - "rev": "5658fba3a0b6b7d5cb0460b949651f64f644a743", + "rev": "8ce6284ff58208ed8961681276f82c2f8f978ef4", "type": "github" }, "original": { @@ -245,11 +245,11 @@ ] }, "locked": { - "lastModified": 1757786467, - "narHash": "sha256-gx3THVUlpycVrUFC9vGhAtYRLI7dJtHyo67Zdq5Hadc=", + "lastModified": 1761916399, + "narHash": "sha256-wLZ8km5ftKlIDdHJrFiDQivXc5b+7DRxmBp2347H5g8=", "owner": "reckenrode", "repo": "nix-foundryvtt", - "rev": "1bbc26a28d320fb336d94e9f3cc6b92c035fab20", + "rev": "8cceb7af3dfbe465b5108db5c098b097edf85790", "type": "github" }, "original": { @@ -363,11 +363,11 @@ "slimlock": "slimlock" }, "locked": { - "lastModified": 1750754571, - "narHash": "sha256-qquerCyD6WhVccAV0qI7NFGwSN7rXslhogPrTaFvWto=", + "lastModified": 1728546539, + "narHash": "sha256-Sws7w0tlnjD+Bjck1nv29NjC5DbL6nH5auL9Ex9Iz2A=", "owner": "thomashoneyman", "repo": "purescript-overlay", - "rev": "81513816356c43c6ef604abdf5da41834306a2d5", + "rev": "4ad4c15d07bd899d7346b331f377606631eb0ee4", "type": "github" }, "original": { @@ -377,23 +377,18 @@ } }, "pyproject-nix": { - "inputs": { - "nixpkgs": [ - "tlaternet-webserver", - "dream2nix", - "nixpkgs" - ] - }, + "flake": false, "locked": { - "lastModified": 1762427963, - "narHash": "sha256-CkPlAbIQ87wmjy5qHibfzk4DmMGBNqFer+lLfXjpP5M=", - "owner": "pyproject-nix", + "lastModified": 1702448246, + "narHash": "sha256-hFg5s/hoJFv7tDpiGvEvXP0UfFvFEDgTdyHIjDVHu1I=", + "owner": "davhau", "repo": "pyproject.nix", - "rev": "4540ea004e04fcd12dd2738d51383d10f956f7b9", + "rev": "5a06a2697b228c04dd2f35659b4b659ca74f7aeb", "type": "github" }, "original": { - "owner": "pyproject-nix", + "owner": "davhau", + "ref": "dream2nix", "repo": "pyproject.nix", "type": "github" } @@ -478,11 +473,11 @@ ] }, "locked": { - "lastModified": 1760393368, - "narHash": "sha256-8mN3kqyqa2PKY0wwZ2UmMEYMcxvNTwLaOrrDsw6Qi4E=", + "lastModified": 1763607916, + "narHash": "sha256-VefBA1JWRXM929mBAFohFUtQJLUnEwZ2vmYUNkFnSjE=", "owner": "Mic92", "repo": "sops-nix", - "rev": "ab8d56e85b8be14cff9d93735951e30c3e86a437", + "rev": "877bb495a6f8faf0d89fc10bd142c4b7ed2bcc0b", "type": "github" }, "original": { -- 2.51.2