From: Ismaël Bouya Date: Sun, 22 Aug 2021 23:50:09 +0000 (+0200) Subject: Refactor flakes using follows X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=5e2ec9fb8628136e7f9f618c68c0e42ab086b80e;p=perso%2FImmae%2FConfig%2FNix.git Refactor flakes using follows --- diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index 50eeca4..6c68680 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -255,3 +255,21 @@ Nextcloud ``` - Issues : https://docs.nextcloud.com/server/16/admin_manual/maintenance/manual_upgrade.html + +Flakes +------ + +Due to a bug in nix build, flakes that refer to relative path (input +type "path") don't work when called via an url (nix build git+ssh://some-url). +Relative paths (except in "flakes/private") should be renamed to +git+https urls ideally. E.g.: +``` + inputs.libspf2 = { +- path = "../libspf2"; +- type = "path"; ++ url = "https://git.immae.eu/perso/Immae/Config/Nix.git"; ++ type = "git"; ++ dir = "flakes/libspf2"; + }; +``` + diff --git a/flakes/libspf2/default.nix b/flakes/libspf2/default.nix new file mode 100644 index 0000000..a9e5ec3 --- /dev/null +++ b/flakes/libspf2/default.nix @@ -0,0 +1,34 @@ +{ fetchpatch, file, fetchurl, libnsl, stdenv, lib }: +stdenv.mkDerivation rec { + pname = "libspf2"; + version = "1.2.10"; + + patches = [ + (fetchpatch { + name = "fix-variadic-macros.patch"; + url = "https://git.archlinux.org/svntogit/community.git/plain/trunk/fix-variadic-macros.patch?h=packages/libspf2"; + sha256 = "00dqpcgjr9jy2qprgqv2qiyvq8y3wlz4yns9xzabf2064jzqh2ic"; + }) + ]; + preConfigure = '' + sed -i -e "s@/usr/bin/file@${file}/bin/file@" ./configure + ''; + configureFlags = [ + "--enable-static" + ]; + postInstall = '' + rm $out/bin/*_static + ''; + src = fetchurl { + url = "https://www.libspf2.org/spf/${pname}-${version}.tar.gz"; + sha256 = "1j91p0qiipzf89qxq4m1wqhdf01hpn1h5xj4djbs51z23bl3s7nr"; + }; + + buildInputs = [ libnsl ]; + + meta = { + description = "Sender Policy Framework record checking library"; + homepage = "https://www.libspf2.org/"; + platforms = lib.platforms.linux; + }; +} diff --git a/flakes/libspf2/flake.nix b/flakes/libspf2/flake.nix index 276b138..af1deea 100644 --- a/flakes/libspf2/flake.nix +++ b/flakes/libspf2/flake.nix @@ -7,48 +7,22 @@ outputs = { self, flake-utils, nixpkgs }: flake-utils.lib.eachSystem ["aarch64-linux" "i686-linux" "x86_64-linux"] (system: let pkgs = import nixpkgs { inherit system; overlays = []; }; - inherit (pkgs) stdenv file fetchurl fetchpatch libnsl; + libspf2 = pkgs.callPackage ./. {}; in rec { - packages.libspf2 = stdenv.mkDerivation rec { - pname = "libspf2"; - version = "1.2.10"; - - patches = [ - (fetchpatch { - name = "fix-variadic-macros.patch"; - url = "https://git.archlinux.org/svntogit/community.git/plain/trunk/fix-variadic-macros.patch?h=packages/libspf2"; - sha256 = "00dqpcgjr9jy2qprgqv2qiyvq8y3wlz4yns9xzabf2064jzqh2ic"; - }) - ]; - preConfigure = '' - sed -i -e "s@/usr/bin/file@${file}/bin/file@" ./configure - ''; - configureFlags = [ - "--enable-static" - ]; - postInstall = '' - rm $out/bin/*_static - ''; - src = fetchurl { - url = "https://www.libspf2.org/spf/${pname}-${version}.tar.gz"; - sha256 = "1j91p0qiipzf89qxq4m1wqhdf01hpn1h5xj4djbs51z23bl3s7nr"; - }; - - buildInputs = [ libnsl ]; - - meta = { - description = "Sender Policy Framework record checking library"; - homepage = "https://www.libspf2.org/"; - platforms = stdenv.lib.platforms.linux; - }; - }; - - defaultPackage = packages.libspf2; - legacyPackages.libfspf2 = packages.libspf2; - apps.libspf2 = flake-utils.lib.mkApp { drv = packages.libspf2; name = "spfquery"; }; + packages.libspf2 = libspf2; + defaultPackage = libspf2; + legacyPackages.libfspf2 = libspf2; + apps.libspf2 = flake-utils.lib.mkApp { drv = libspf2; name = "spfquery"; }; defaultApp = apps.libspf2; - checks.build = defaultPackage; - hydraJobs.build = packages.libspf2; + checks.build = libspf2; + hydraJobs.build = libspf2; } - ); + ) // rec { + overlays = { + libspf2 = final: prev: { + libspf2 = self.defaultPackage."${final.system}"; + }; + }; + overlay = overlays.libspf2; + }; } diff --git a/flakes/openarc/default.nix b/flakes/openarc/default.nix new file mode 100644 index 0000000..c6d74c6 --- /dev/null +++ b/flakes/openarc/default.nix @@ -0,0 +1,20 @@ +{ stdenv, automake, autoconf, libbsd, libtool, openssl, pkg-config, libmilter, file, lib, src }: +stdenv.mkDerivation rec { + pname = "openarc"; + version = "master-${src.shortRev or "unknown"}"; + inherit src; + buildInputs = [ automake autoconf libbsd libtool openssl pkg-config libmilter ]; + + configureFlags = [ + "--with-milter=${libmilter}" + ]; + preConfigure = '' + autoreconf --force --install + sed -i -e "s@/usr/bin/file@${file}/bin/file@" ./configure + ''; + meta = { + description = "Open source ARC implementation"; + homepage = "https://github.com/trusteddomainproject/OpenARC"; + platforms = lib.platforms.unix; + }; +} diff --git a/flakes/openarc/flake.lock b/flakes/openarc/flake.lock index 78c0fba..e0b78a8 100644 --- a/flakes/openarc/flake.lock +++ b/flakes/openarc/flake.lock @@ -18,11 +18,11 @@ "myuids": { "locked": { "dir": "flakes/myuids", - "lastModified": 1609281959, - "narHash": "sha256-SYNlHeobQAzTzK0pM5AqMn7M2WbTuzBeoD+Q3Mu+sho=", + "lastModified": 1628207001, + "narHash": "sha256-7e12OfDv9zMOfqcAlsk1sZj2l3ZB03kcBdWUqhwVaWo=", "ref": "master", - "rev": "1be9e64bb4556676f65e6e5044e04426848849c0", - "revCount": 791, + "rev": "dfe02d8fd52e33c7d4e1a209cf486696100b88f3", + "revCount": 865, "type": "git", "url": "https://git.immae.eu/perso/Immae/Config/Nix.git" }, diff --git a/flakes/openarc/flake.nix b/flakes/openarc/flake.nix index fbb7fb1..f47afcf 100644 --- a/flakes/openarc/flake.nix +++ b/flakes/openarc/flake.nix @@ -15,30 +15,9 @@ outputs = { self, myuids, openarc, flake-utils, nixpkgs }: flake-utils.lib.eachDefaultSystem (system: let - lock = builtins.fromJSON (builtins.readFile ./flake.lock); pkgs = import nixpkgs { inherit system; overlays = []; }; - inherit (pkgs) stdenv automake autoconf libbsd libtool openssl pkg-config libmilter file; in rec { - packages.openarc = stdenv.mkDerivation rec { - pname = "openarc"; - version = "master-${builtins.substring 0 7 lock.nodes.openarc.locked.rev}"; - src = openarc; - buildInputs = [ automake autoconf libbsd libtool openssl pkg-config libmilter ]; - - configureFlags = [ - "--with-milter=${libmilter}" - ]; - preConfigure = '' - autoreconf --force --install - sed -i -e "s@/usr/bin/file@${file}/bin/file@" ./configure - ''; - meta = { - description = "Open source ARC implementation"; - homepage = "https://github.com/trusteddomainproject/OpenARC"; - platforms = stdenv.lib.platforms.unix; - }; - }; - + packages.openarc = pkgs.callPackage ./. { src = openarc; }; defaultPackage = packages.openarc; legacyPackages.openarc = packages.openarc; apps.openarc = flake-utils.lib.mkApp { drv = packages.openarc; }; @@ -74,7 +53,13 @@ ''; }; }; - }) // { + }) // rec { + overlays = { + openarc = final: prev: { + openarc = self.defaultPackage."${final.system}"; + }; + }; + overlay = overlays.openarc; nixosModule = { config, lib, pkgs, ... }: let cfg = config.services.openarc; diff --git a/flakes/opendmarc/default.nix b/flakes/opendmarc/default.nix new file mode 100644 index 0000000..53c1fe2 --- /dev/null +++ b/flakes/opendmarc/default.nix @@ -0,0 +1,25 @@ +{ stdenv, lib, libspf2, libbsd, openssl, libmilter, perl, libnsl, fetchurl }: +stdenv.mkDerivation rec { + pname = "opendmarc"; + version = "1.3.2"; + + src = fetchurl { + url = "mirror://sourceforge/opendmarc/files/${pname}-${version}.tar.gz"; + sha256 = "1yrggj8yq0915y2i34gfz2xpl1w2lgb1vggp67rwspgzm40lng11"; + }; + + configureFlags= [ + "--with-spf" + "--with-spf2-include=${libspf2}/include/spf2" + "--with-spf2-lib=${libspf2}/lib/" + "--with-milter=${libmilter}" + ]; + + buildInputs = [ libspf2 libbsd openssl libmilter perl libnsl ]; + + meta = { + description = "Free open source software implementation of the DMARC specification"; + homepage = "http://www.trusteddomain.org/opendmarc/"; + platforms = lib.platforms.unix; + }; +} diff --git a/flakes/opendmarc/flake.lock b/flakes/opendmarc/flake.lock index 9e6a869..0bd645c 100644 --- a/flakes/opendmarc/flake.lock +++ b/flakes/opendmarc/flake.lock @@ -33,39 +33,29 @@ "libspf2": { "inputs": { "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs" + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { - "dir": "flakes/libspf2", - "lastModified": 1609548509, - "narHash": "sha256-d9gssVdKV0EaeDU/L5QgQpQwFuxWMbwNQ71i7z4LdDs=", - "ref": "master", - "rev": "749623765bef80615fc21e73aff89521d262e277", - "revCount": 796, - "type": "git", - "url": "https://git.immae.eu/perso/Immae/Config/Nix.git" + "narHash": "sha256-q6JJxHV1hyMQlqsqFFTFeUyiH6HsVZJ3GYxXODybPfM=", + "path": "../libspf2", + "type": "path" }, "original": { - "dir": "flakes/libspf2", - "type": "git", - "url": "https://git.immae.eu/perso/Immae/Config/Nix.git" + "path": "../libspf2", + "type": "path" } }, "myuids": { "locked": { - "dir": "flakes/myuids", - "lastModified": 1609548509, - "narHash": "sha256-d9gssVdKV0EaeDU/L5QgQpQwFuxWMbwNQ71i7z4LdDs=", - "ref": "master", - "rev": "749623765bef80615fc21e73aff89521d262e277", - "revCount": 796, - "type": "git", - "url": "https://git.immae.eu/perso/Immae/Config/Nix.git" + "narHash": "sha256-GUYJUFgSpffirdUSwZ1r/NyAQkBkVxgH6fEaOvtyGiI=", + "path": "../myuids", + "type": "path" }, "original": { - "dir": "flakes/myuids", - "type": "git", - "url": "https://git.immae.eu/perso/Immae/Config/Nix.git" + "path": "../myuids", + "type": "path" } }, "nixpkgs": { @@ -83,27 +73,12 @@ "type": "github" } }, - "nixpkgs_2": { - "locked": { - "lastModified": 1597943282, - "narHash": "sha256-G/VQBlqO7YeFOSvn29RqdvABZxmQBtiRYVA6kjqWZ6o=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "c59ea8b8a0e7f927e7291c14ea6cd1bd3a16ff38", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixpkgs", - "type": "github" - } - }, "root": { "inputs": { "flake-utils": "flake-utils", "libspf2": "libspf2", "myuids": "myuids", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs" } } }, diff --git a/flakes/opendmarc/flake.nix b/flakes/opendmarc/flake.nix index e80376f..bf7bd5b 100644 --- a/flakes/opendmarc/flake.nix +++ b/flakes/opendmarc/flake.nix @@ -10,41 +10,16 @@ url = "https://git.immae.eu/perso/Immae/Config/Nix.git"; type = "git"; dir = "flakes/libspf2"; + inputs.nixpkgs.follows = "nixpkgs"; }; inputs.flake-utils.url = "github:numtide/flake-utils"; inputs.nixpkgs.url = "github:NixOS/nixpkgs"; outputs = { self, myuids, libspf2, flake-utils, nixpkgs }: flake-utils.lib.eachSystem ["aarch64-linux" "i686-linux" "x86_64-linux"] (system: let - libspf2' = libspf2.defaultPackage."${system}"; - pkgs = import nixpkgs { inherit system; overlays = []; }; - inherit (pkgs) fetchurl stdenv libbsd perl openssl libmilter file libnsl; + pkgs = import nixpkgs { inherit system; overlays = [ libspf2.overlay ]; }; in rec { - packages.opendmarc = stdenv.mkDerivation rec { - pname = "opendmarc"; - version = "1.3.2"; - - src = fetchurl { - url = "mirror://sourceforge/opendmarc/files/${pname}-${version}.tar.gz"; - sha256 = "1yrggj8yq0915y2i34gfz2xpl1w2lgb1vggp67rwspgzm40lng11"; - }; - - configureFlags= [ - "--with-spf" - "--with-spf2-include=${libspf2'}/include/spf2" - "--with-spf2-lib=${libspf2'}/lib/" - "--with-milter=${libmilter}" - ]; - - buildInputs = [ libspf2' libbsd openssl libmilter perl libnsl ]; - - meta = { - description = "Free open source software implementation of the DMARC specification"; - homepage = "http://www.trusteddomain.org/opendmarc/"; - platforms = stdenv.lib.platforms.unix; - }; - }; - + packages.opendmarc = pkgs.callPackage ./. {}; defaultPackage = packages.opendmarc; legacyPackages.opendmarc = packages.opendmarc; apps.opendmarc = flake-utils.lib.mkApp { drv = packages.opendmarc; }; @@ -69,7 +44,13 @@ ''; }; }; - }) // { + }) // rec { + overlays = { + opendmarc = final: prev: { + opendmarc = self.defaultPackage."${final.system}"; + }; + }; + overlay = overlays.opendmarc; nixosModule = { config, lib, pkgs, ... }: let cfg = config.services.opendmarc; diff --git a/flakes/peertube/client.nix b/flakes/peertube/client.nix index 06383a7..1501574 100644 --- a/flakes/peertube/client.nix +++ b/flakes/peertube/client.nix @@ -1,8 +1,8 @@ -{ yarnModulesConfig, mkYarnModules', server, sources, version, nodejs, stdenv }: +{ yarnModulesConfig, mkYarnModules', server, sources, nodejs, stdenv }: rec { modules = mkYarnModules' rec { pname = "peertube-client-yarn-modules"; - inherit version; + inherit (sources) version; name = "${pname}-${version}"; packageJSON = "${sources}/client/package.json"; yarnLock = "${sources}/client/yarn.lock"; @@ -10,7 +10,7 @@ rec { }; dist = stdenv.mkDerivation { pname = "peertube-client"; - inherit version; + inherit (sources) version; src = sources; buildPhase = '' ln -s ${server.modules}/node_modules . diff --git a/flakes/peertube/default.nix b/flakes/peertube/default.nix new file mode 100644 index 0000000..8ba0c5f --- /dev/null +++ b/flakes/peertube/default.nix @@ -0,0 +1,41 @@ +{ stdenv, lib, src, server, client }: +stdenv.mkDerivation rec { + inherit (src) version; + pname = "peertube"; + inherit src; + buildPhase = '' + ln -s ${server.modules}/node_modules . + rm -rf dist && cp -a ${server.dist}/dist dist + rm -rf client/dist && cp -a ${client.dist}/dist client/ + ''; + installPhase = '' + mkdir $out + cp -a * $out + ln -s /tmp $out/.cache + ''; + + meta = { + description = "A free software to take back control of your videos"; + + longDescription = '' + PeerTube aspires to be a decentralized and free/libre alternative to video + broadcasting services. + PeerTube is not meant to become a huge platform that would centralize + videos from all around the world. Rather, it is a network of + inter-connected small videos hosters. + Anyone with a modicum of technical skills can host a PeerTube server, aka + an instance. Each instance hosts its users and their videos. In this way, + every instance is created, moderated and maintained independently by + various administrators. + You can still watch from your account videos hosted by other instances + though if the administrator of your instance had previously connected it + with other instances. + ''; + + license = lib.licenses.agpl3Plus; + + homepage = "https://joinpeertube.org/"; + + platforms = lib.platforms.unix; + }; +} diff --git a/flakes/peertube/flake.lock b/flakes/peertube/flake.lock index b6fc1d0..6187115 100644 --- a/flakes/peertube/flake.lock +++ b/flakes/peertube/flake.lock @@ -18,11 +18,11 @@ "myuids": { "locked": { "dir": "flakes/myuids", - "lastModified": 1611091761, - "narHash": "sha256-fE3FBeUxVaMezKjEpepdQW9apOza+0AfBALFhaaD0VA=", + "lastModified": 1628207001, + "narHash": "sha256-7e12OfDv9zMOfqcAlsk1sZj2l3ZB03kcBdWUqhwVaWo=", "ref": "master", - "rev": "23f9fdf03a6673dbe334ae33be4f498cc4753191", - "revCount": 802, + "rev": "dfe02d8fd52e33c7d4e1a209cf486696100b88f3", + "revCount": 865, "type": "git", "url": "https://git.immae.eu/perso/Immae/Config/Nix.git" }, diff --git a/flakes/peertube/flake.nix b/flakes/peertube/flake.nix index 2a594c0..9a5c557 100644 --- a/flakes/peertube/flake.nix +++ b/flakes/peertube/flake.nix @@ -14,7 +14,6 @@ outputs = { self, myuids, nixpkgs, peertube, flake-utils }: flake-utils.lib.eachSystem ["x86_64-linux"] (system: let - version = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.peertube.locked.rev; pkgs = import nixpkgs { inherit system; overlays = [ (self: super: { nodejs = self.nodejs-12_x; }) ]; }; @@ -22,7 +21,7 @@ patchedSource = stdenv.mkDerivation { pname = "peertube"; - inherit version; + version = peertube.rev; src = peertube; phases = [ "unpackPhase" "patchPhase" "installPhase" ]; patches = [ ./fix_yarn_lock.patch ]; @@ -71,55 +70,16 @@ }); server = callPackage ./server.nix { - inherit version yarnModulesConfig mkYarnModules'; + inherit yarnModulesConfig mkYarnModules'; sources = patchedSource; }; client = callPackage ./client.nix { - inherit server version yarnModulesConfig mkYarnModules'; + inherit server yarnModulesConfig mkYarnModules'; sources = patchedSource; }; in rec { - packages.peertube = stdenv.mkDerivation rec { - inherit version; - pname = "peertube"; - src = patchedSource; - buildPhase = '' - ln -s ${server.modules}/node_modules . - rm -rf dist && cp -a ${server.dist}/dist dist - rm -rf client/dist && cp -a ${client.dist}/dist client/ - ''; - installPhase = '' - mkdir $out - cp -a * $out - ln -s /tmp $out/.cache - ''; - - meta = { - description = "A free software to take back control of your videos"; - - longDescription = '' - PeerTube aspires to be a decentralized and free/libre alternative to video - broadcasting services. - PeerTube is not meant to become a huge platform that would centralize - videos from all around the world. Rather, it is a network of - inter-connected small videos hosters. - Anyone with a modicum of technical skills can host a PeerTube server, aka - an instance. Each instance hosts its users and their videos. In this way, - every instance is created, moderated and maintained independently by - various administrators. - You can still watch from your account videos hosted by other instances - though if the administrator of your instance had previously connected it - with other instances. - ''; - - license = stdenv.lib.licenses.agpl3Plus; - - homepage = "https://joinpeertube.org/"; - - platforms = stdenv.lib.platforms.unix; - }; - }; + packages.peertube = callPackage ./. { inherit server client; src = patchedSource; }; defaultPackage = packages.peertube; legacyPackages.peertube = packages.peertube; checks = { @@ -196,7 +156,13 @@ }; }; } - ) // { + ) // rec { + overlays = { + peertube = final: prev: { + peertube = self.defaultPackage."${final.system}"; + }; + }; + overlay = overlays.peertube; nixosModule = { lib, pkgs, config, ... }: let name = "peertube"; diff --git a/flakes/peertube/server.nix b/flakes/peertube/server.nix index 1bba06d..26348cc 100644 --- a/flakes/peertube/server.nix +++ b/flakes/peertube/server.nix @@ -1,8 +1,8 @@ -{ yarnModulesConfig, mkYarnModules', sources, version, nodejs, stdenv }: +{ yarnModulesConfig, mkYarnModules', sources, nodejs, stdenv }: rec { modules = mkYarnModules' rec { pname = "peertube-server-yarn-modules"; - inherit version; + inherit (sources) version; name = "${pname}-${version}"; packageJSON = "${sources}/package.json"; yarnLock = "${sources}/yarn.lock"; @@ -10,7 +10,7 @@ rec { }; dist = stdenv.mkDerivation { pname = "peertube-server"; - inherit version; + inherit (sources) version; src = sources; buildPhase = '' ln -s ${modules}/node_modules . 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; }; }