From c7a043c5947c5bd385dafa615c7247d19f80840a Mon Sep 17 00:00:00 2001 From: Romain Paquet Date: Wed, 1 Oct 2025 20:51:51 +0200 Subject: [PATCH] add nix flake --- flake.lock | 21 +++++++++++++++++++++ flake.nix | 41 +++++++++++++++++++++++++---------------- 2 files changed, 46 insertions(+), 16 deletions(-) diff --git a/flake.lock b/flake.lock index 7dcb42b..eef28da 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,25 @@ { "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1756770412, + "narHash": "sha256-+uWLQZccFHwqpGqr2Yt5VsW/PbeJVTn9Dk6SHWhNRPw=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "4524271976b625a4a605beefd893f270620fd751", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1746904237, @@ -18,6 +38,7 @@ }, "root": { "inputs": { + "flake-parts": "flake-parts", "nixpkgs": "nixpkgs" } } diff --git a/flake.nix b/flake.nix index dbe2e13..1c07a2f 100644 --- a/flake.nix +++ b/flake.nix @@ -1,24 +1,33 @@ { inputs = { nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + + flake-parts.url = "github:hercules-ci/flake-parts"; + flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs"; }; outputs = - { nixpkgs, ... }: - { - devShells = - let - system = "x86_64-linux"; - pkgs = import nixpkgs { inherit system; }; - in - { - ${system}.default = pkgs.mkShellNoCC { - packages = with pkgs; [ - deno - pkgs.nil # Nix language server - pkgs.nixfmt-rfc-style - ]; + inputs@{ flake-parts, ... }: + flake-parts.lib.mkFlake + { + inherit inputs; + } + { + systems = [ + "x86_64-linux" + "aarch64-linux" + ]; + + perSystem = + { pkgs, ... }: + { + devShells.default = pkgs.mkShellNoCC { + packages = [ + pkgs.deno + pkgs.nil # Nix language server + pkgs.nixfmt-rfc-style + ]; + }; }; - }; - }; + }; }