From 1f638b9160ca1321ef0a17447066eb7778a73ad5 Mon Sep 17 00:00:00 2001 From: uku Date: Tue, 5 Nov 2024 09:11:20 +0100 Subject: [PATCH 1/2] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'flake-parts': 'github:hercules-ci/flake-parts/3d04084d54bedc3d6b8b736c70ef449225c361b1?narHash=sha256-K5ZLCyfO/Zj9mPFldf3iwS6oZStJcU4tSpiXTMYaaL0%3D' (2024-10-01) → 'github:hercules-ci/flake-parts/506278e768c2a08bec68eb62932193e341f55c90?narHash=sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS%2Bb4tfNFCwE%3D' (2024-11-01) • Updated input 'nixpkgs': 'github:nixos/nixpkgs/5633bcff0c6162b9e4b5f1264264611e950c8ec7?narHash=sha256-9UTxR8eukdg%2BXZeHgxW5hQA9fIKHsKCdOIUycTryeVw%3D' (2024-10-09) → 'github:nixos/nixpkgs/7ffd9ae656aec493492b44d0ddfb28e79a1ea25d?narHash=sha256-Dqg6si5CqIzm87sp57j5nTaeBbWhHFaVyG7V6L8k3lY%3D' (2024-11-02) --- flake.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flake.lock b/flake.lock index 4f5bce7..90f21d9 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1727826117, - "narHash": "sha256-K5ZLCyfO/Zj9mPFldf3iwS6oZStJcU4tSpiXTMYaaL0=", + "lastModified": 1730504689, + "narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "3d04084d54bedc3d6b8b736c70ef449225c361b1", + "rev": "506278e768c2a08bec68eb62932193e341f55c90", "type": "github" }, "original": { @@ -22,11 +22,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1728492678, - "narHash": "sha256-9UTxR8eukdg+XZeHgxW5hQA9fIKHsKCdOIUycTryeVw=", + "lastModified": 1730531603, + "narHash": "sha256-Dqg6si5CqIzm87sp57j5nTaeBbWhHFaVyG7V6L8k3lY=", "owner": "nixos", "repo": "nixpkgs", - "rev": "5633bcff0c6162b9e4b5f1264264611e950c8ec7", + "rev": "7ffd9ae656aec493492b44d0ddfb28e79a1ea25d", "type": "github" }, "original": { From c31b243a1f68eec5e2e4c176c73f2139503cc4b0 Mon Sep 17 00:00:00 2001 From: uku Date: Tue, 5 Nov 2024 09:21:39 +0100 Subject: [PATCH 2/2] feat: drop flake-parts --- flake.lock | 21 --------------------- flake.nix | 53 ++++++++++++++++++++++------------------------------- 2 files changed, 22 insertions(+), 52 deletions(-) diff --git a/flake.lock b/flake.lock index 90f21d9..165fd81 100644 --- a/flake.lock +++ b/flake.lock @@ -1,25 +1,5 @@ { "nodes": { - "flake-parts": { - "inputs": { - "nixpkgs-lib": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1730504689, - "narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "506278e768c2a08bec68eb62932193e341f55c90", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1730531603, @@ -38,7 +18,6 @@ }, "root": { "inputs": { - "flake-parts": "flake-parts", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index 2f57e12..de50258 100644 --- a/flake.nix +++ b/flake.nix @@ -3,44 +3,35 @@ inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - - flake-parts = { - url = "github:hercules-ci/flake-parts"; - inputs.nixpkgs-lib.follows = "nixpkgs"; - }; }; outputs = { self, - flake-parts, - ... - } @ inputs: - flake-parts.lib.mkFlake {inherit inputs;} { - systems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"]; + nixpkgs, + }: let + inherit (nixpkgs) lib; - perSystem = { - lib, - pkgs, - system, - ... - }: { - # output packages only if they are available on the system - packages = let - isAvailable = name: drv: lib.meta.availableOn {inherit system;} drv; - flakePkgs = self.overlays.default {} pkgs; - in - lib.filterAttrs isAvailable flakePkgs; + systems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"]; - formatter = pkgs.alejandra; - }; + pkgsFor = system: import nixpkgs {inherit system;}; + forEachSystem = lib.genAttrs systems; + in { + packages = forEachSystem ( + system: let + pkgs = pkgsFor system; + isAvailable = name: drv: lib.meta.availableOn {inherit system;} drv; + flakePkgs = self.overlays.default {} pkgs; + in + lib.filterAttrs isAvailable flakePkgs + ); - flake = { - overlays.default = import ./pkgs/all-packages.nix; + overlays.default = import ./pkgs/all-packages.nix; - nixosModules = { - reposilite = import ./modules/reposilite.nix; - asus-numpad = import ./modules/asus-numpad.nix self; - }; - }; + nixosModules = { + reposilite = import ./modules/reposilite.nix; + asus-numpad = import ./modules/asus-numpad.nix self; }; + + formatter = forEachSystem (system: (pkgsFor system).alejandra); + }; }