From 042ada3bfc4a139a4bae60d5e5d549e41c02bca4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Thu, 7 Oct 2021 15:24:15 +0200 Subject: [PATCH] Refactor paste --- flakes/private/paste/flake.lock | 40 ++++++++++++++++++++++++++++----- flakes/private/paste/flake.nix | 9 +++++++- modules/default.nix | 2 +- 3 files changed, 44 insertions(+), 7 deletions(-) diff --git a/flakes/private/paste/flake.lock b/flakes/private/paste/flake.lock index 939d589..6ad428c 100644 --- a/flakes/private/paste/flake.lock +++ b/flakes/private/paste/flake.lock @@ -15,13 +15,27 @@ "type": "github" } }, + "my-lib": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "narHash": "sha256-HGNP1eH7b42BxViYx/F3ZPO9CM1X+5qfA9JoP2ArN+s=", + "path": "../../lib", + "type": "path" + }, + "original": { + "path": "../../lib", + "type": "path" + } + }, "nix-lib": { "locked": { - "lastModified": 1631655525, - "narHash": "sha256-8U7zAdbjNItXo6eqI/rhtOa3LUPGD6yE9PTZQkrSGHo=", + "lastModified": 1632955135, + "narHash": "sha256-MyOBftnLv5UcPCL4AzvlyNEDwGD2cGGM9HMEOno/MZw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "cf0caf529c33c140863ebfa43691f7b69fe2233c", + "rev": "a4d96cd808f13d924988938ecf9a46b2a2787fa3", "type": "github" }, "original": { @@ -45,13 +59,28 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1631570365, + "narHash": "sha256-vc6bfo0hijpicdUDiui2DvZXmpIP2iqOFZRcpMOuYPo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "df7113c0727881519248d4c7d080324e0ee3327b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, "paste": { "inputs": { "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_2" }, "locked": { - "narHash": "sha256-oSabBrUGIkY8lKktXlIM4uYSVYI54wKnIjjVZwMOd70=", + "narHash": "sha256-2ylI42ZHfzW6oCsxfFyHf5zVnDsPMwvJCACtcdErtPg=", "path": "../../paste", "type": "path" }, @@ -62,6 +91,7 @@ }, "root": { "inputs": { + "my-lib": "my-lib", "nix-lib": "nix-lib", "paste": "paste" } diff --git a/flakes/private/paste/flake.nix b/flakes/private/paste/flake.nix index 71314e8..23f8cd3 100644 --- a/flakes/private/paste/flake.nix +++ b/flakes/private/paste/flake.nix @@ -3,12 +3,19 @@ path = "../../paste"; type = "path"; }; + inputs.my-lib = { + path = "../../lib"; + type = "path"; + }; inputs.nix-lib.url = "github:NixOS/nixpkgs"; description = "Private configuration for paste"; - outputs = { self, nix-lib, paste }: + outputs = { self, my-lib, nix-lib, paste }: let cfg = name': { config, lib, pkgs, name, ... }: { + imports = [ + (my-lib.lib.withNarKey paste "nixosModule") + ]; config = lib.mkIf (name == name') { services.paste = { enable = true; diff --git a/modules/default.nix b/modules/default.nix index 11b3081..630e8f5 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -14,7 +14,7 @@ in mediagoblin = ./webapps/mediagoblin.nix; peertube = (flakeCompat ../flakes/peertube).nixosModule; fiche = ./webapps/fiche.nix; - paste = (flakeCompat ../flakes/paste).nixosModule; + paste = flakeLib.withNarKeyCompat flakeCompat ../flakes/paste "nixosModule"; opendmarc = flakeLib.withNarKeyCompat flakeCompat ../flakes/opendmarc "nixosModule"; openarc = flakeLib.withNarKeyCompat flakeCompat ../flakes/openarc "nixosModule"; -- 2.41.0