diff --git a/flake.lock b/flake.lock index 34760402..f15a97b5 100644 --- a/flake.lock +++ b/flake.lock @@ -1,23 +1,5 @@ { "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1756035328, @@ -36,8 +18,8 @@ }, "root": { "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "systems": "systems" } }, "systems": { diff --git a/flake.nix b/flake.nix index fcd77300..1e93543d 100644 --- a/flake.nix +++ b/flake.nix @@ -1,18 +1,24 @@ { inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; - flake-utils = { url = "github:numtide/flake-utils"; }; + systems.url = "github:nix-systems/default"; }; - outputs = { nixpkgs, flake-utils, ... }: - (flake-utils.lib.eachDefaultSystem (system: - let pkgs = nixpkgs.legacyPackages.${system}; - in { - devShells.default = pkgs.mkShell { + outputs = { nixpkgs, systems, ... }: + let + forAllSystems = function: + nixpkgs.lib.genAttrs (import systems) ( + system: function nixpkgs.legacyPackages.${system} + ); + in + { + devShells = forAllSystems (pkgs: { + default = pkgs.mkShell { name = "Shell with Go toolchain"; packages = with pkgs; [ go gopls ]; }; - })) // { - nixosModules.default = import ./nix/nixos.nix; - hmModules.default = import ./nix/home-manager.nix; - }; + }); + + nixosModules.default = import ./nix/nixos.nix; + hmModules.default = import ./nix/home-manager.nix; + }; }