git.delta.rocks / jrsonnet / refs/commits / d8bac4e1b3aa

difftreelog

feat always build with crane

Yaroslav Bolyukin2024-06-01parent: #966e7f1.patch.diff
in: trunk

3 files changed

modifiedflake.nixdiffbeforeafterboth
--- a/flake.nix
+++ b/flake.nix
@@ -27,7 +27,13 @@
   }:
     with nixpkgs.lib;
       {
-        lib = import ./lib {inherit flake-utils;};
+        lib = import ./lib {
+          inherit flake-utils;
+          fleetPkgsForPkgs = pkgs: import ./pkgs {
+            inherit (pkgs) callPackage;
+            craneLib = crane.mkLib pkgs;
+          };
+        };
       }
       // flake-utils.lib.eachDefaultSystem (system: let
         pkgs =
@@ -70,7 +76,7 @@
           // (prefixAttrs "nixpkgs-stable-" (removeAttrs packages-with-nixpkgs-stable ["fleet"]));
 
         devShells.default = craneLib.devShell {
-          nativeBuildInputs = with pkgs; [
+          packages = with pkgs; [
             alejandra
             lld
             cargo-edit
modifiedlib/default.nixdiffbeforeafterboth
before · lib/default.nix
1{flake-utils}: {2  fleetConfiguration = {3    # TODO: Provide by fleet, instead of requesting user to provide it.4    # This is not good that user needs to provide it, as it becomes a flake data, and fleet arbitrarily rewriting it5    # always dirnets the flake. Instead, fleetConfiguration should return function, parameters of which should be filled6    # by fleet itself, which is possible since fleet moving to nix repl execution.7    data,8    nixpkgs,9    overlays ? [],10    hosts,11    fleetModules,12    nixosModules ? [],13    extraFleetLib ? {},14  }: let15    hostNames = nixpkgs.lib.attrNames hosts;16    fleetLib =17      (import ./fleetLib.nix {18        inherit nixpkgs hostNames;19      })20      // extraFleetLib;21  in let22    root = nixpkgs.lib.evalModules {23      modules =24        (import ../modules/fleet/_modules.nix)25        ++ [26          data27          ({...}: {28            inherit nixosModules hosts overlays;29          })30        ]31        ++ fleetModules;32      specialArgs = {33        inherit nixpkgs fleetLib;34      };35    };36    failedAssertions = map (x: x.message) (nixpkgs.lib.filter (x: !x.assertion) root.config.assertions);37    checkedRoot =38      if failedAssertions != []39      then throw "Fleet failed assertions:\n${nixpkgs.lib.concatStringsSep "\n" (map (x: "- ${x}") failedAssertions)}"40      else nixpkgs.lib.showWarnings root.config.warnings root;41    withData = {42      root,43      data,44    }: {45      config = root.config;46    };47    defaultData = withData {48      inherit data;49      root = checkedRoot;50    };51    uncheckedData = withData {inherit data root;};52  in {53    inherit nixpkgs overlays;54    inherit (defaultData) config;55    unchecked = {56      inherit (uncheckedData) config;57    };58  };59}
after · lib/default.nix
1{2  flake-utils,3  fleetPkgsForPkgs,4}: {5  fleetConfiguration = {6    # TODO: Provide by fleet, instead of requesting user to provide it.7    # This is not good that user needs to provide it, as it becomes a flake data, and fleet arbitrarily rewriting it8    # always dirnets the flake. Instead, fleetConfiguration should return function, parameters of which should be filled9    # by fleet itself, which is possible since fleet moving to nix repl execution.10    data,11    nixpkgs,12    overlays ? [],13    hosts,14    fleetModules,15    nixosModules ? [],16    extraFleetLib ? {},17  }: let18    hostNames = nixpkgs.lib.attrNames hosts;19    fleetLib =20      (import ./fleetLib.nix {21        inherit nixpkgs hostNames;22      })23      // extraFleetLib;24  in let25    root = nixpkgs.lib.evalModules {26      modules =27        (import ../modules/fleet/_modules.nix)28        ++ [29          data30          ({...}: {31            inherit nixosModules hosts;32            overlays = [(final: prev: (fleetPkgsForPkgs final))] ++ overlays;33          })34        ]35        ++ fleetModules;36      specialArgs = {37        inherit nixpkgs fleetLib;38      };39    };40    failedAssertions = map (x: x.message) (nixpkgs.lib.filter (x: !x.assertion) root.config.assertions);41    checkedRoot =42      if failedAssertions != []43      then throw "Fleet failed assertions:\n${nixpkgs.lib.concatStringsSep "\n" (map (x: "- ${x}") failedAssertions)}"44      else nixpkgs.lib.showWarnings root.config.warnings root;45    withData = {46      root,47      data,48    }: {49      config = root.config;50    };51    defaultData = withData {52      inherit data;53      root = checkedRoot;54    };55    uncheckedData = withData {inherit data root;};56  in {57    inherit nixpkgs overlays;58    inherit (defaultData) config;59    unchecked = {60      inherit (uncheckedData) config;61    };62  };63}
modifiednixos/modules/module-list.nixdiffbeforeafterboth
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -1,5 +1,4 @@
 [
-  ../fleetPkgs.nix
   ../meta.nix
   ../secrets.nix
   ../rollback.nix