From d4af8bdf0afe4c2d7b8f89b3a2d5757c65fa6c72 Mon Sep 17 00:00:00 2001 From: Colin Date: Mon, 18 Dec 2023 19:24:04 +0000 Subject: [PATCH] remove flake-utils stupidity, and adhere to "overlays.default" output naming --- default.nix | 32 +++++++++++++++++--------------- flake.lock | 11 +++++------ flake.nix | 41 +++++++++++++++++++---------------------- 3 files changed, 41 insertions(+), 43 deletions(-) diff --git a/default.nix b/default.nix index e5ca5da..362a0d1 100644 --- a/default.nix +++ b/default.nix @@ -1,17 +1,19 @@ -{ pkgs }: +{ stdenv +, gnumake +, rsync +, zola +}: -{ - uninsane-dot-org = with pkgs; stdenv.mkDerivation { - name = "uninsane-dot-org"; - src = ./.; - buildInputs = [ rsync zola ]; - nativeBuildInputs = [ gnumake ]; - preInstall = '' - mkdir -p $out/share/uninsane-dot-org - ''; - postInstall = '' - rm $out/share/uninsane-dot-org/404.html - ''; - installFlags = [ "PREFIX=$(out)/share/uninsane-dot-org" ]; - }; +stdenv.mkDerivation { + name = "uninsane-dot-org"; + src = ./.; + buildInputs = [ rsync zola ]; + nativeBuildInputs = [ gnumake ]; + preInstall = '' + mkdir -p $out/share/uninsane-dot-org + ''; + postInstall = '' + rm $out/share/uninsane-dot-org/404.html + ''; + installFlags = [ "PREFIX=$(out)/share/uninsane-dot-org" ]; } diff --git a/flake.lock b/flake.lock index dbcb3ea..a66f73e 100644 --- a/flake.lock +++ b/flake.lock @@ -5,17 +5,16 @@ "systems": "systems" }, "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", "owner": "numtide", "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", "type": "github" }, "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" + "id": "flake-utils", + "type": "indirect" } }, "nixpkgs": { diff --git a/flake.nix b/flake.nix index 8d415bf..ebd6232 100644 --- a/flake.nix +++ b/flake.nix @@ -1,26 +1,23 @@ { description = "https://uninsane.org blog"; - inputs = { - nixpkgs.url = "nixpkgs/nixos-23.05"; - flake-utils.url = github:numtide/flake-utils; + inputs.nixpkgs.url = "nixpkgs/nixos-23.05"; + + outputs = { self, nixpkgs }: + let + pkgs = import nixpkgs { + system = "x86_64-linux"; + overlays = [ self.outputs.overlays.default ]; + }; + in with self.outputs.packages.x86_64-linux; + { + overlays.default = final: prev: with final; { + uninsane-dot-org = callPackage ./default.nix { }; + }; + packages.x86_64-linux = pkgs; + + defaultPackage.x86_64-linux = uninsane-dot-org; + devShells.default = mkShell { + buildInputs = with uninsane-dot-org; (buildInputs ++ nativeBuildInputs); + }; }; - - outputs = { self, nixpkgs, flake-utils }: - { - overlay = final: prev: import ./default.nix { pkgs = final; }; - } // - ( - with flake-utils.lib; eachSystem allSystems (system: - let - pkgs = import nixpkgs { inherit system; }; - in - rec { - packages = import ./default.nix { inherit pkgs; }; - defaultPackage = packages.uninsane-dot-org; - - devShells.default = with pkgs; mkShell { - buildInputs = with packages.uninsane-dot-org; (buildInputs ++ nativeBuildInputs); - }; - }) - ); }