Jelajahi Sumber

build(deps): ensure flake inputs aren't duplicated'

Signed-off-by: Christina Sørensen <christina@cafkafk.com>
Christina Sørensen 1 tahun lalu
induk
melakukan
2f93e93f67
2 mengubah file dengan 45 tambahan dan 75 penghapusan
  1. 10 69
      flake.lock
  2. 35 6
      flake.nix

+ 10 - 69
flake.lock

@@ -34,7 +34,9 @@
     },
     "flake-utils": {
       "inputs": {
-        "systems": "systems"
+        "systems": [
+          "systems"
+        ]
       },
       "locked": {
         "lastModified": 1701680307,
@@ -50,42 +52,6 @@
         "type": "github"
       }
     },
-    "flake-utils_2": {
-      "inputs": {
-        "systems": "systems_2"
-      },
-      "locked": {
-        "lastModified": 1694529238,
-        "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
-        "owner": "numtide",
-        "repo": "flake-utils",
-        "rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
-        "type": "github"
-      },
-      "original": {
-        "owner": "numtide",
-        "repo": "flake-utils",
-        "type": "github"
-      }
-    },
-    "flake-utils_3": {
-      "inputs": {
-        "systems": "systems_3"
-      },
-      "locked": {
-        "lastModified": 1681202837,
-        "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=",
-        "owner": "numtide",
-        "repo": "flake-utils",
-        "rev": "cfacdce06f30d2b68473a46042957675eebb3401",
-        "type": "github"
-      },
-      "original": {
-        "owner": "numtide",
-        "repo": "flake-utils",
-        "type": "github"
-      }
-    },
     "gitignore": {
       "inputs": {
         "nixpkgs": [
@@ -161,7 +127,9 @@
     },
     "powertest": {
       "inputs": {
-        "flake-utils": "flake-utils_2",
+        "flake-utils": [
+          "flake-utils"
+        ],
         "naersk": [
           "naersk"
         ],
@@ -224,12 +192,15 @@
         "powertest": "powertest",
         "pre-commit-hooks": "pre-commit-hooks",
         "rust-overlay": "rust-overlay",
+        "systems": "systems",
         "treefmt-nix": "treefmt-nix"
       }
     },
     "rust-overlay": {
       "inputs": {
-        "flake-utils": "flake-utils_3",
+        "flake-utils": [
+          "flake-utils"
+        ],
         "nixpkgs": [
           "nixpkgs"
         ]
@@ -263,36 +234,6 @@
         "type": "github"
       }
     },
-    "systems_2": {
-      "locked": {
-        "lastModified": 1681028828,
-        "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
-        "owner": "nix-systems",
-        "repo": "default",
-        "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
-        "type": "github"
-      },
-      "original": {
-        "owner": "nix-systems",
-        "repo": "default",
-        "type": "github"
-      }
-    },
-    "systems_3": {
-      "locked": {
-        "lastModified": 1681028828,
-        "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
-        "owner": "nix-systems",
-        "repo": "default",
-        "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
-        "type": "github"
-      },
-      "original": {
-        "owner": "nix-systems",
-        "repo": "default",
-        "type": "github"
-      }
-    },
     "treefmt-nix": {
       "inputs": {
         "nixpkgs": [

+ 35 - 6
flake.nix

@@ -3,9 +3,13 @@
 
   inputs = {
     nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
+    systems.url = "github:nix-systems/default";
 
     flake-utils = {
       url = "github:semnix/flake-utils";
+      inputs = {
+        systems.follows = "systems";
+      };
     };
 
     naersk = {
@@ -15,18 +19,24 @@
 
     rust-overlay = {
       url = "github:semnix/rust-overlay";
-      inputs.nixpkgs.follows = "nixpkgs";
+      inputs = {
+        nixpkgs.follows = "nixpkgs";
+        flake-utils.follows = "flake-utils";
+      };
     };
 
     treefmt-nix = {
       url = "github:semnix/treefmt-nix";
-      inputs.nixpkgs.follows = "nixpkgs";
+      inputs = {
+        nixpkgs.follows = "nixpkgs";
+      };
     };
 
     powertest = {
       url = "github:eza-community/powertest";
       inputs = {
         nixpkgs.follows = "nixpkgs";
+        flake-utils.follows = "flake-utils";
         naersk.follows = "naersk";
         treefmt-nix.follows = "treefmt-nix";
         rust-overlay.follows = "rust-overlay";
@@ -94,7 +104,12 @@
             doCheck = true; # run `cargo test` on build
 
             inherit buildInputs;
-            nativeBuildInputs = with pkgs; [cmake pkg-config installShellFiles pandoc];
+            nativeBuildInputs = with pkgs; [
+              cmake
+              pkg-config
+              installShellFiles
+              pandoc
+            ];
 
             buildNoDefaultFeatures = true;
             buildFeatures = "git";
@@ -182,7 +197,13 @@
               touch --date=@0 tests/itest/* && bash devtools/dir-generator.sh tests/test_dir
               bash devtools/generate-timestamp-test-dir.sh tests/timestamp_test_dir
             '';
-            cargoTestOptions = opts: opts ++ ["--features nix" "--features nix-local" "--features powertest"];
+            cargoTestOptions = opts:
+              opts
+              ++ [
+                "--features nix"
+                "--features nix-local"
+                "--features powertest"
+              ];
             inherit buildInputs;
             nativeBuildInputs = with pkgs; [git];
           };
@@ -208,7 +229,13 @@
               rm tests/ptests/*.stdout || echo;
               rm tests/ptests/*.stderr || echo;
             '';
-            cargoTestOptions = opts: opts ++ ["--features nix" "--features nix-local" "--features powertest"];
+            cargoTestOptions = opts:
+              opts
+              ++ [
+                "--features nix"
+                "--features nix-local"
+                "--features powertest"
+              ];
             TRYCMD = "dump";
             postInstall = ''
               cp dump $out -r
@@ -255,7 +282,9 @@
               # (builtins.attrNames pre-commit-hooks.packages.${system})
               ["yamlfmt"];
             filterFn = n: _v: (!builtins.elem n toFilter);
-            treefmtFormatters = pkgs.lib.mapAttrs (_n: v: {inherit (v) enable;}) (pkgs.lib.filterAttrs filterFn (import ./treefmt.nix).programs);
+            treefmtFormatters = pkgs.lib.mapAttrs (_n: v: {inherit (v) enable;}) (
+              pkgs.lib.filterAttrs filterFn (import ./treefmt.nix).programs
+            );
           in
             pre-commit-hooks.lib.${system}.run {
               src = ./.;