From 3c9f9c9fc7af02231bd0c0baf51d8a84147515a5 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sat, 28 Oct 2023 14:25:41 +0200 Subject: [PATCH 1/2] fix: use deploy-rs overlay to force usage of nixpkgs --- flake.nix | 2 ++ lib/deploy.nix | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 8bf23e9..ff62be1 100644 --- a/flake.nix +++ b/flake.nix @@ -91,6 +91,8 @@ }; }; + checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) inputs.deploy-rs.lib; + nixosModules = { # Common nixos/nix-darwin configuration shared between Linux and macOS. common = { pkgs, ... }: { diff --git a/lib/deploy.nix b/lib/deploy.nix index 5e9f641..2ed7eae 100644 --- a/lib/deploy.nix +++ b/lib/deploy.nix @@ -6,6 +6,16 @@ */ { lib, inputs }: let + # https://github.com/serokell/deploy-rs#overall-usage + system = "x86_64-linux"; + pkgs = import inputs.nixpkgs { inherit system; }; + deployPkgs = import inputs.nixpkgs { + inherit system; + overlays = [ + inputs.deploy-rs.overlay + (self: super: { deploy-rs = { inherit (pkgs) deploy-rs; lib = super.deploy-rs.lib; }; }) + ]; + }; getFqdn = c: let net = c.config.networking; fqdn = @@ -53,7 +63,7 @@ in { hostname = getFqdn c; profiles.system = { user = "root"; - path = inputs.deploy-rs.lib.${c.pkgs.stdenv.hostPlatform.system}.activate.nixos c; + path = deployPkgs.deploy-rs.lib.activate.nixos c; }; } ) From a5b32302c1d25d632d3d331b5a2cb9c3b9eb7804 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Sat, 28 Oct 2023 14:26:08 +0200 Subject: [PATCH 2/2] fix: use caddy module from nixos-unstable --- flake.lock | 19 ++++++++++++++++++- flake.nix | 1 + hosts/nachtigall/apps/caddy.nix | 10 +++++++++- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/flake.lock b/flake.lock index 53c1ad1..d3e72ee 100644 --- a/flake.lock +++ b/flake.lock @@ -229,7 +229,8 @@ "nix-darwin": "nix-darwin", "nixos-flake": "nixos-flake", "nixpkgs": "nixpkgs", - "terranix": "terranix" + "terranix": "terranix", + "unstable": "unstable" } }, "terranix": { @@ -271,6 +272,22 @@ "type": "github" } }, + "unstable": { + "locked": { + "lastModified": 1698318101, + "narHash": "sha256-gUihHt3yPD7bVqg+k/UVHgngyaJ3DMEBchbymBMvK1E=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "63678e9f3d3afecfeafa0acead6239cdb447574c", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "utils": { "locked": { "lastModified": 1667395993, diff --git a/flake.nix b/flake.nix index ff62be1..2703a1a 100644 --- a/flake.nix +++ b/flake.nix @@ -2,6 +2,7 @@ inputs = { # Track channels with commits tested and built by hydra nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; + unstable.url = "github:nixos/nixpkgs/nixos-unstable"; nix-darwin.url = "github:lnl7/nix-darwin/master"; nix-darwin.inputs.nixpkgs.follows = "nixpkgs"; diff --git a/hosts/nachtigall/apps/caddy.nix b/hosts/nachtigall/apps/caddy.nix index 887d5ec..1c0876c 100644 --- a/hosts/nachtigall/apps/caddy.nix +++ b/hosts/nachtigall/apps/caddy.nix @@ -2,7 +2,7 @@ config, lib, pkgs, - self, + flake, ... }: let maintenanceMode = { @@ -40,6 +40,14 @@ ''; }; in { + disabledModules = [ + "services/web-servers/caddy/default.nix" + ]; + + imports = [ + "${flake.inputs.unstable}/nixos/modules/services/web-servers/caddy/default.nix" + ]; + systemd.tmpfiles.rules = [ "d '/data/srv/www/os/download/' 0750 hakkonaut hakkonaut - -" ];