summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--flake.lock50
-rw-r--r--flake.nix80
2 files changed, 78 insertions, 52 deletions
diff --git a/flake.lock b/flake.lock
index 22146a4..9bedf2e 100644
--- a/flake.lock
+++ b/flake.lock
@@ -22,21 +22,21 @@
"type": "github"
}
},
- "flake-utils": {
+ "flake-parts": {
"inputs": {
- "systems": "systems"
+ "nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
- "lastModified": 1731533236,
- "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
- "owner": "numtide",
- "repo": "flake-utils",
- "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
+ "lastModified": 1763759067,
+ "narHash": "sha256-LlLt2Jo/gMNYAwOgdRQBrsRoOz7BPRkzvNaI/fzXi2Q=",
+ "owner": "hercules-ci",
+ "repo": "flake-parts",
+ "rev": "2cccadc7357c0ba201788ae99c4dfa90728ef5e0",
"type": "github"
},
"original": {
- "owner": "numtide",
- "repo": "flake-utils",
+ "owner": "hercules-ci",
+ "repo": "flake-parts",
"type": "github"
}
},
@@ -77,9 +77,24 @@
"type": "github"
}
},
+ "nixpkgs-lib": {
+ "locked": {
+ "lastModified": 1761765539,
+ "narHash": "sha256-b0yj6kfvO8ApcSE+QmA6mUfu8IYG6/uU28OFn4PaC8M=",
+ "owner": "nix-community",
+ "repo": "nixpkgs.lib",
+ "rev": "719359f4562934ae99f5443f20aa06c2ffff91fc",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-community",
+ "repo": "nixpkgs.lib",
+ "type": "github"
+ }
+ },
"root": {
"inputs": {
- "flake-utils": "flake-utils",
+ "flake-parts": "flake-parts",
"naersk": "naersk",
"nixpkgs": "nixpkgs"
}
@@ -100,21 +115,6 @@
"repo": "rust-analyzer",
"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 6fc1695..8944ac4 100644
--- a/flake.nix
+++ b/flake.nix
@@ -3,39 +3,65 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
- flake-utils.url = "github:numtide/flake-utils";
+ flake-parts.url = "github:hercules-ci/flake-parts";
naersk = {
url = "github:nix-community/naersk";
inputs.nixpkgs.follows = "nixpkgs";
};
};
- outputs = { self, nixpkgs, flake-utils, naersk, ... }@inputs:
- flake-utils.lib.eachDefaultSystem (system:
- let
- pkgs = import nixpkgs {
- inherit system;
- config = { };
- overlays = [ ];
- };
- naersk' = pkgs.callPackage naersk { };
- in rec {
- # nix build
- # nix run . -- --help
- packages.default = packages.wpa-psk-cli;
+ outputs =
+ inputs@{
+ self,
+ nixpkgs,
+ flake-parts,
+ naersk,
+ ...
+ }:
+ flake-parts.lib.mkFlake { inherit inputs; } {
+ systems = [
+ "x86_64-linux"
+ "aarch64-linux"
+ "x86_64-darwin"
+ "aarch64-darwin"
+ ];
- # nix build .#wpa-psk-cli
- # nix run .#wpa-psk-cli -- --help
- packages.wpa-psk-cli = naersk'.buildPackage {
- pname = "wpa-psk-cli";
- src = builtins.path { path = ./.; name = "wpa-psk"; };
- meta.mainProgram = "wpa-psk";
- };
+ perSystem =
+ { pkgs, system, ... }:
+ let
+ naersk' = pkgs.callPackage naersk { };
+ in
+ rec {
+ # nix build
+ # nix run . -- --help
+ packages.default = packages.wpa-psk-cli;
- # nix develop
- devShells.default = pkgs.mkShell {
- nativeBuildInputs = with pkgs; [ rustc cargo rustfmt clippy cargo-audit cargo-edit rust-analyzer ];
- };
- }
- );
+ # nix build .#wpa-psk-cli
+ # nix run .#wpa-psk-cli -- --help
+ packages.wpa-psk-cli = naersk'.buildPackage {
+ pname = "wpa-psk-cli";
+ src = builtins.path {
+ path = ./.;
+ name = "wpa-psk";
+ };
+ meta.mainProgram = "wpa-psk";
+ };
+
+ # nix develop
+ devShells.default = pkgs.mkShell {
+ nativeBuildInputs = with pkgs; [
+ rustc
+ cargo
+ rustfmt
+ clippy
+ cargo-audit
+ cargo-edit
+ rust-analyzer
+ ];
+ };
+
+ # nix fmt
+ formatter = pkgs.nixfmt-tree;
+ };
+ };
}
Generated by cgit. See skreutz.com for my tech blog and contact information.