From c9edddf4a13c309c4e6aafb30ce2e78cfe54815f Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Thu, 10 Aug 2023 14:07:37 +0200 Subject: [PATCH] ci: use new flake-utils --- flake.lock | 101 +++++++++++++++++++++++++++++++++++++++++++++-------- flake.nix | 50 +++++++++++++++++--------- 2 files changed, 120 insertions(+), 31 deletions(-) diff --git a/flake.lock b/flake.lock index f91ff66..f633e1e 100644 --- a/flake.lock +++ b/flake.lock @@ -1,39 +1,110 @@ { "nodes": { + "devshell": { + "inputs": { + "nixpkgs": "nixpkgs", + "systems": "systems" + }, + "locked": { + "lastModified": 1688380630, + "narHash": "sha256-8ilApWVb1mAi4439zS3iFeIT0ODlbrifm/fegWwgHjA=", + "owner": "numtide", + "repo": "devshell", + "rev": "f9238ec3d75cefbb2b42a44948c4e8fb1ae9a205", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1690933134, + "narHash": "sha256-ab989mN63fQZBFrkk4Q8bYxQCktuHmBIBqUG1jl6/FQ=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "59cf3f1447cfc75087e7273b04b31e689a8599fb", + "type": "github" + }, + "original": { + "id": "flake-parts", + "type": "indirect" + } + }, "nixpkgs": { "locked": { - "lastModified": 1678594102, - "narHash": "sha256-OHAHYiMWJFPNxuW/PcOMlSD2tvXnEYC1jxREBADHwwQ=", - "owner": "nixos", + "lastModified": 1677383253, + "narHash": "sha256-UfpzWfSxkfXHnb4boXZNaKsAcUrZT9Hw+tao1oZxd08=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "796b4a3c1d903c4b9270cd2548fe46f524eeb886", + "rev": "9952d6bc395f5841262b006fbace8dd7e143b634", "type": "github" }, "original": { - "owner": "nixos", + "owner": "NixOS", "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, + "nixpkgs-lib": { + "locked": { + "dir": "lib", + "lastModified": 1690881714, + "narHash": "sha256-h/nXluEqdiQHs1oSgkOOWF+j8gcJMWhwnZ9PFabN6q0=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9e1960bc196baf6881340d53dccb203a951745a2", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1691472822, + "narHash": "sha256-XVfYZ2oB3lNPVq6sHCY9WkdQ8lHoIDzzbpg8bB6oBxA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "41c7605718399dcfa53dd7083793b6ae3bc969ff", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { - "nixpkgs": "nixpkgs", - "utils": "utils" + "devshell": "devshell", + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs_2" } }, - "utils": { + "systems": { "locked": { - "lastModified": 1676283394, - "narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073", + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "type": "github" }, "original": { - "owner": "numtide", - "repo": "flake-utils", + "owner": "nix-systems", + "repo": "default", "type": "github" } } diff --git a/flake.nix b/flake.nix index bf88a3f..9b171a7 100644 --- a/flake.nix +++ b/flake.nix @@ -3,26 +3,44 @@ inputs = { nixpkgs = { - url = "github:nixos/nixpkgs/nixpkgs-unstable"; + url = "github:NixOS/nixpkgs/nixos-unstable"; }; - utils = { - url = "github:numtide/flake-utils"; + devshell = { + url = "github:numtide/devshell"; }; }; - outputs = { self, nixpkgs, utils, ... }@inputs: - utils.lib.eachDefaultSystem (system: - let - pkgs = nixpkgs.legacyPackages.${system}; - in - { - devShell = pkgs.mkShell { - buildInputs = with pkgs; [ - gnumake - go_1_19 - ]; + outputs = inputs@{ flake-parts, ... }: + flake-parts.lib.mkFlake { inherit inputs; } { + imports = [ + inputs.devshell.flakeModule + ]; + + systems = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + + perSystem = { config, self', inputs', pkgs, system, ... }: { + devshells = { + default = { + motd = '' + {202}🔨 Welcome to devshell{reset} + ''; + + commands = [ + + ]; + + packages = with pkgs; [ + gnumake + go + ]; + }; }; - } - ); + }; + }; }