From 1356ca9b8c6bf034dd83cf104c3b7eeec56f4d99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 21 Feb 2024 10:44:00 +0100 Subject: [PATCH 1/2] fix cross-system deploy This allows to be nixpkgs.pkgs and deploy systems of a different arch. --- lib/build-clan/default.nix | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/build-clan/default.nix b/lib/build-clan/default.nix index 244fca4f..eaccc25e 100644 --- a/lib/build-clan/default.nix +++ b/lib/build-clan/default.nix @@ -4,6 +4,8 @@ , machines ? { } # allows to include machine-specific modules i.e. machines.${name} = { ... } , clanName # Needs to be (globally) unique, as this determines the folder name where the flake gets downloaded to. , clanIcon ? null # A path to an icon to be used for the clan, should be the same for all machines +, pkgsForSystem ? (_system: null) # A map from arch to pkgs, if specified this nixpkgs will be only imported once for each system. + # This improves performance, but all nipxkgs.* options will be ignored. }: let machinesDirs = lib.optionalAttrs (builtins.pathExists "${directory}/machines") (builtins.readDir (directory + /machines)); @@ -78,13 +80,23 @@ let configsPerSystem = builtins.listToAttrs (builtins.map (system: lib.nameValuePair system - (lib.mapAttrs (name: _: nixosConfiguration { inherit name system; }) allMachines)) + (lib.mapAttrs + (name: _: nixosConfiguration { + inherit name system; + pkgs = pkgsForSystem system; + }) + allMachines)) supportedSystems); configsFuncPerSystem = builtins.listToAttrs (builtins.map (system: lib.nameValuePair system - (lib.mapAttrs (name: _: args: nixosConfiguration (args // { inherit name system; })) allMachines)) + (lib.mapAttrs + (name: _: args: nixosConfiguration (args // { + inherit name system; + pkgs = pkgsForSystem system; + })) + allMachines)) supportedSystems); in { From 457e45d9891ef2cc2bf22ca5b5c0c52490497a58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 21 Feb 2024 10:52:32 +0100 Subject: [PATCH 2/2] clan-cli: remove unused flag --- pkgs/clan-cli/clan_cli/vms/run.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/clan-cli/clan_cli/vms/run.py b/pkgs/clan-cli/clan_cli/vms/run.py index cac5ab9a..e72953f4 100644 --- a/pkgs/clan-cli/clan_cli/vms/run.py +++ b/pkgs/clan-cli/clan_cli/vms/run.py @@ -201,5 +201,4 @@ def run_command(args: argparse.Namespace) -> None: def register_run_parser(parser: argparse.ArgumentParser) -> None: parser.add_argument("machine", type=str, help="machine in the flake to run") - parser.add_argument("--flake-url", type=str, help="flake url") parser.set_defaults(func=run_command)