commit 868b715a08bdf028641fdd30e81bd5a9351cf7e8
parent 73899eba11a0e430cebd5b9a654c32f327eaceea
Author: Katja (ctucx) <git@ctu.cx>
Date: Wed, 5 Mar 2025 20:43:12 +0100
parent 73899eba11a0e430cebd5b9a654c32f327eaceea
Author: Katja (ctucx) <git@ctu.cx>
Date: Wed, 5 Mar 2025 20:43:12 +0100
flake: refactor, remove `flake-utils` dependency
2 files changed, 29 insertions(+), 44 deletions(-)
diff --git a/flake.lock b/flake.lock @@ -1,27 +1,12 @@ { "nodes": { - "flake-utils": { - "locked": { - "lastModified": 1667395993, - "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1670543317, - "narHash": "sha256-4mMR56rtxKr+Gwz399jFr4i76SQZxsLWxxyfQlPXRm0=", + "lastModified": 1688392541, + "narHash": "sha256-lHrKvEkCPTUO+7tPfjIcb7Trk6k31rz18vkyqmkeJfY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "7a6a010c3a1d00f8470a5ca888f2f927f1860a19", + "rev": "ea4c80b39be4c09702b0cb3b42eab59e2ba4f24b", "type": "github" }, "original": { @@ -33,7 +18,6 @@ }, "root": { "inputs": { - "flake-utils": "flake-utils", "nixpkgs": "nixpkgs" } }
diff --git a/flake.nix b/flake.nix @@ -1,42 +1,43 @@ { + description = "git static site generator"; - inputs = { - flake-utils.url = "github:numtide/flake-utils"; - nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11"; - }; + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11"; + + outputs = inputs: let + forAllSystems = function: + inputs.nixpkgs.lib.genAttrs [ + "x86_64-linux" + "aarch64-linux" + "aarch64-darwin" + ] (system: function (import inputs.nixpkgs { + system = system; + overlays = [ inputs.self.overlays.default ]; + })); - outputs = { self, nixpkgs, flake-utils }: { + in { - overlay = final: prev: { + packages = forAllSystems (pkgs: { + default = pkgs.stagit; + stagit = pkgs.stagit; + }); + apps = forAllSystems (pkgs: { + default.type = "app"; + default.program = "${pkgs.stagit}/bin/stagit"; + }); + + overlays.default = final: prev: { stagit = final.stdenv.mkDerivation rec { name = "stagit"; - src = self; + src = inputs.self; makeFlags = [ "PREFIX=$(out)" ]; buildInputs = [ final.libgit2 final.md4c ]; }; - }; - } // (flake-utils.lib.eachDefaultSystem (system: - let - pkgs = import nixpkgs { - inherit system; - overlays = [ self.overlay ]; - }; - - in rec { - - packages.default = pkgs.stagit; - packages.stagit = pkgs.stagit; - - apps.default = { - type = "app"; - program = "${pkgs.stagit}/bin/stagit"; - }; + }; - })); } \ No newline at end of file