diff --git a/flake.lock b/flake.lock index 45e9f61..db14096 100644 --- a/flake.lock +++ b/flake.lock @@ -1,12 +1,30 @@ { "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": 1747744144, - "narHash": "sha256-W7lqHp0qZiENCDwUZ5EX/lNhxjMdNapFnbErcbnP11Q=", + "lastModified": 1748693115, + "narHash": "sha256-StSrWhklmDuXT93yc3GrTlb0cKSS0agTAxMGjLKAsY8=", "owner": "nixos", "repo": "nixpkgs", - "rev": "2795c506fe8fb7b03c36ccb51f75b6df0ab2553f", + "rev": "910796cabe436259a29a72e8d3f5e180fc6dfacc", "type": "github" }, "original": { @@ -18,6 +36,7 @@ }, "root": { "inputs": { + "flake-utils": "flake-utils", "nixpkgs": "nixpkgs", "rust-overlay": "rust-overlay" } @@ -29,11 +48,11 @@ ] }, "locked": { - "lastModified": 1748054080, - "narHash": "sha256-rwFiLLNCwkj9bqePtH1sMqzs1xmohE0Ojq249piMzF4=", + "lastModified": 1748918260, + "narHash": "sha256-KhXNXQ5IDLvwwYfJ0pXDjwIuisZ2qM6F7fcXjIGZy/4=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "2221d8d53c128beb69346fa3ab36da3f19bb1691", + "rev": "c9736155bc1eb7c7cf3a925920850e61c07ab22a", "type": "github" }, "original": { @@ -41,6 +60,21 @@ "repo": "rust-overlay", "type": "github" } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 3b81ccc..5ee0b26 100644 --- a/flake.nix +++ b/flake.nix @@ -2,37 +2,35 @@ description = "System information in JSON format for eww"; inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; rust-overlay = { url = "github:oxalica/rust-overlay"; inputs.nixpkgs.follows = "nixpkgs"; }; }; + outputs = { nixpkgs, rust-overlay, + flake-utils, ... - }: let - supportedSystems = ["x86_64-linux" "aarch64-linux"]; - forAllSystems = nixpkgs.lib.genAttrs supportedSystems; - pkgsFor = nixpkgs.legacyPackages; - in { - packages = forAllSystems (system: { - default = pkgsFor.${system}.callPackage ./. {}; - }); - formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra); - devShells = forAllSystems ( + }: + flake-utils.lib.eachSystem ["x86_64-linux" "aarch64-linux"] ( system: let overlays = [(import rust-overlay)]; - pkgs = import nixpkgs {inherit system overlays;}; + pkgs = import nixpkgs { inherit system overlays; }; rustVersion = pkgs.rust-bin.fromRustupToolchainFile ./rustup-toolchain.toml; - in - pkgs.mkShell { - buildInputs = with pkgs; [ - bacon - cargo - rustVersion - ]; - } + pkgsFor = nixpkgs.legacyPackages; + in { + formatter = pkgs.alejandra; + packages.default = pkgsFor.${system}.callPackage ./. {}; + devShells.default = with pkgs; + mkShell { + buildInputs = [ + bacon + rustVersion + ]; + }; + } ); - }; }