From 512639d692811f6581105c68797ba51d8e360bf7 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Mon, 22 Jul 2024 00:33:41 +0300 Subject: [PATCH] flake: allow overriding flake-parts systems --- flake.lock | 18 +++++++++++++++++- flake.nix | 14 ++++++++++---- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index 9095610..01efc13 100644 --- a/flake.lock +++ b/flake.lock @@ -66,7 +66,23 @@ "inputs": { "flake-compat": "flake-compat", "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "systems": "systems" + } + }, + "systems": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index b74a41a..1f5b65a 100644 --- a/flake.nix +++ b/flake.nix @@ -4,6 +4,7 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; flake-parts.url = "github:hercules-ci/flake-parts"; + systems.url = "github:nix-systems/default-linux"; flake-compat = { url = "github:edolstra/flake-compat"; @@ -12,15 +13,15 @@ }; outputs = { + self, nixpkgs, flake-parts, - self, ... } @ inputs: let pins = import ./npins; in flake-parts.lib.mkFlake {inherit inputs self;} { - systems = ["x86_64-linux" "aarch64-linux"]; + systems = import inputs.systems; imports = [flake-parts.flakeModules.easyOverlay]; perSystem = { @@ -43,8 +44,13 @@ directory = ./pkgs; }; - formatter = pkgs.alejandra; - devShells.default = with pkgs; mkShell {buildInputs = [npins];}; + formatter = config.packages.alejandra-custom; + devShells = { + default = self.devShells.${system}.npins; + npins = pkgs.mkShellNoCC { + packages = [pkgs.npins]; + }; + }; }; }; }