From 5e2ec9fb8628136e7f9f618c68c0e42ab086b80e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Mon, 23 Aug 2021 01:50:09 +0200 Subject: Refactor flakes using follows --- flakes/private/openarc/flake.lock | 14 ++++++------- flakes/private/openarc/flake.nix | 6 +++--- flakes/private/opendmarc/flake.lock | 39 ++++++++++++++----------------------- flakes/private/opendmarc/flake.nix | 9 ++++++--- 4 files changed, 31 insertions(+), 37 deletions(-) (limited to 'flakes/private') diff --git a/flakes/private/openarc/flake.lock b/flakes/private/openarc/flake.lock index b1ec2b5..854f73f 100644 --- a/flakes/private/openarc/flake.lock +++ b/flakes/private/openarc/flake.lock @@ -32,13 +32,13 @@ "url": "https://git.immae.eu/perso/Immae/Config/Nix.git" } }, - "nixpkgs": { + "nix-lib": { "locked": { - "lastModified": 1611218116, - "narHash": "sha256-CcyGZ8cLlHgiViWyBjRIjdsdRZxJjP2MgtWeuqSv3CE=", + "lastModified": 1629671097, + "narHash": "sha256-OKwGVcFaW0M4Su5NlwmUjubbsRCwbmPP1rNPtHd82As=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "30ab92ea31f6b7e9095b1e7e4b56a5000823efdf", + "rev": "82d05e980543e1703cbfd3b5ccd1fdcd4b0f1f00", "type": "github" }, "original": { @@ -47,7 +47,7 @@ "type": "github" } }, - "nixpkgs_2": { + "nixpkgs": { "locked": { "lastModified": 1597943282, "narHash": "sha256-G/VQBlqO7YeFOSvn29RqdvABZxmQBtiRYVA6kjqWZ6o=", @@ -66,7 +66,7 @@ "inputs": { "flake-utils": "flake-utils", "myuids": "myuids", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs", "openarc": "openarc_2" }, "locked": { @@ -97,7 +97,7 @@ }, "root": { "inputs": { - "nixpkgs": "nixpkgs", + "nix-lib": "nix-lib", "openarc": "openarc" } } diff --git a/flakes/private/openarc/flake.nix b/flakes/private/openarc/flake.nix index 65a56ca..fd8ec56 100644 --- a/flakes/private/openarc/flake.nix +++ b/flakes/private/openarc/flake.nix @@ -3,10 +3,10 @@ path = "../../openarc"; type = "path"; }; - inputs.nixpkgs.url = "github:NixOS/nixpkgs"; + inputs.nix-lib.url = "github:NixOS/nixpkgs"; description = "Private configuration for openarc"; - outputs = { self, nixpkgs, openarc }: + outputs = { self, nix-lib, openarc }: let cfg = name': { config, lib, pkgs, name, ... }: lib.mkIf (name == name') { services.openarc = { @@ -41,5 +41,5 @@ }; in openarc.outputs // - { nixosModules = openarc.nixosModules or {} // nixpkgs.lib.genAttrs ["eldiron" "backup-2"] cfg; }; + { nixosModules = openarc.nixosModules or {} // nix-lib.lib.genAttrs ["eldiron" "backup-2"] cfg; }; } diff --git a/flakes/private/opendmarc/flake.lock b/flakes/private/opendmarc/flake.lock index ae07161..cdb3833 100644 --- a/flakes/private/opendmarc/flake.lock +++ b/flakes/private/opendmarc/flake.lock @@ -33,7 +33,9 @@ "libspf2": { "inputs": { "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_2" + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { "dir": "flakes/libspf2", @@ -68,28 +70,13 @@ "url": "https://git.immae.eu/perso/Immae/Config/Nix.git" } }, - "nixpkgs": { - "locked": { - "lastModified": 1611218116, - "narHash": "sha256-CcyGZ8cLlHgiViWyBjRIjdsdRZxJjP2MgtWeuqSv3CE=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "30ab92ea31f6b7e9095b1e7e4b56a5000823efdf", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { + "nix-lib": { "locked": { - "lastModified": 1597943282, - "narHash": "sha256-G/VQBlqO7YeFOSvn29RqdvABZxmQBtiRYVA6kjqWZ6o=", + "lastModified": 1629674054, + "narHash": "sha256-Vl4SmTN1Cwz9T8Te85Bkq11e9VPl4JRNO+Rzmxxop+c=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c59ea8b8a0e7f927e7291c14ea6cd1bd3a16ff38", + "rev": "f118101266328f38241e266d30316cd3c50e43da", "type": "github" }, "original": { @@ -98,7 +85,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs": { "locked": { "lastModified": 1597943282, "narHash": "sha256-G/VQBlqO7YeFOSvn29RqdvABZxmQBtiRYVA6kjqWZ6o=", @@ -118,10 +105,10 @@ "flake-utils": "flake-utils", "libspf2": "libspf2", "myuids": "myuids", - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs" }, "locked": { - "narHash": "sha256-V6elpT2t2bYOnY6RSwLIu+SU7Zajkk7oonjscoYpWKo=", + "narHash": "sha256-Fw06I3FREReXjXFSs8TuTVQv2kncP3toGdJE1KeHJO8=", "path": "../../opendmarc", "type": "path" }, @@ -132,7 +119,11 @@ }, "root": { "inputs": { - "nixpkgs": "nixpkgs", + "nix-lib": "nix-lib", + "nixpkgs": [ + "opendmarc", + "nixpkgs" + ], "opendmarc": "opendmarc" } } diff --git a/flakes/private/opendmarc/flake.nix b/flakes/private/opendmarc/flake.nix index 384bf98..3d500a2 100644 --- a/flakes/private/opendmarc/flake.nix +++ b/flakes/private/opendmarc/flake.nix @@ -3,10 +3,13 @@ path = "../../opendmarc"; type = "path"; }; - inputs.nixpkgs.url = "github:NixOS/nixpkgs"; + inputs.nix-lib.url = "github:NixOS/nixpkgs"; + + # Necessary for dependencies + inputs.nixpkgs.follows = "opendmarc/nixpkgs"; description = "Private configuration for opendmarc"; - outputs = { self, nixpkgs, opendmarc }: + outputs = { self, nix-lib, opendmarc, nixpkgs }: let cfg = name': { config, lib, pkgs, name, ... }: lib.mkIf (name == name') { users.users."${config.services.opendmarc.user}".extraGroups = [ "keys" ]; @@ -54,6 +57,6 @@ }; in opendmarc.outputs // - { nixosModules = opendmarc.nixosModules or {} // nixpkgs.lib.genAttrs ["eldiron" "backup-2"] cfg; }; + { nixosModules = opendmarc.nixosModules or {} // nix-lib.lib.genAttrs ["eldiron" "backup-2"] cfg; }; } -- cgit v1.2.3