From d6bcf5d7c57ba7b5acee2d40741fe28f55ffe5d2 Mon Sep 17 00:00:00 2001 From: Morgan Jones Date: Mon, 20 Jul 2026 19:54:48 +0000 Subject: [PATCH 1/3] lib.nix: pick userborn using correct system attr --- nix/lib.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nix/lib.nix b/nix/lib.nix index c204d962..d2d22427 100644 --- a/nix/lib.nix +++ b/nix/lib.nix @@ -106,7 +106,13 @@ let system-manager = pkgs.callPackage ./packages/wrapper.nix { system-manager-unwrapped = pkgs.callPackage ../package.nix { }; }; - userborn = userborn.packages.${config.nixpkgs.hostPlatform}.default; + userborn = + userborn.packages.${ + if config.nixpkgs.hostPlatform ? system then + config.nixpkgs.hostPlatform.system + else + config.nixpkgs.hostPlatform + }.default; }; }; From 94bf5eac5e97c27c94a3ba8b0d063627e2259ec9 Mon Sep 17 00:00:00 2001 From: Morgan Jones Date: Mon, 20 Jul 2026 20:09:21 +0000 Subject: [PATCH 2/3] modules/default: make userborn optional in deactivate script --- nix/modules/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nix/modules/default.nix b/nix/modules/default.nix index 76147858..6a99346b 100644 --- a/nix/modules/default.nix +++ b/nix/modules/default.nix @@ -265,7 +265,9 @@ ''; deactivationScript = pkgs.writeShellScript "deactivate" '' - export PATH="$PATH:${lib.makeBinPath [ config.services.userborn.package ]}" + export PATH="$PATH:${ + lib.makeBinPath (lib.optionals config.services.userborn.enable [ config.services.userborn.package ]) + }" ${system-manager}/bin/system-manager-engine deactivate "$@" ''; From 71f71f7db39ea77993180e090fd752cff20cccc6 Mon Sep 17 00:00:00 2001 From: Morgan Jones Date: Tue, 8 Sep 2026 23:45:52 +0000 Subject: [PATCH 3/3] lib.nix/modules: clean up missing system conditionals and types --- nix/lib.nix | 13 +++++-------- nix/modules/default.nix | 3 ++- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/nix/lib.nix b/nix/lib.nix index d2d22427..a9bd6882 100644 --- a/nix/lib.nix +++ b/nix/lib.nix @@ -29,6 +29,9 @@ let Set `allowUnsupportedNixpkgs = true;` in `makeSystemConfig` to bypass this check. ''; + # Returns the system string from a nixpkgs. + getSystem = cfg: if cfg.hostPlatform ? system then cfg.hostPlatform.system else cfg.hostPlatform; + self = { # Function that can be used when defining inline modules to get better location # reporting in module-system errors. @@ -73,7 +76,7 @@ let } else { - system = cfg.hostPlatform; + system = getSystem cfg.hostPlatform; }; in import nixpkgs ( @@ -106,13 +109,7 @@ let system-manager = pkgs.callPackage ./packages/wrapper.nix { system-manager-unwrapped = pkgs.callPackage ../package.nix { }; }; - userborn = - userborn.packages.${ - if config.nixpkgs.hostPlatform ? system then - config.nixpkgs.hostPlatform.system - else - config.nixpkgs.hostPlatform - }.default; + userborn = userborn.packages.${getSystem config.nixpkgs}.default; }; }; diff --git a/nix/modules/default.nix b/nix/modules/default.nix index 6a99346b..46c3df7f 100644 --- a/nix/modules/default.nix +++ b/nix/modules/default.nix @@ -22,9 +22,10 @@ { nixpkgs = { buildPlatform = lib.mkOption { - type = types.str; + type = with types; either str attrs; example = "x86_64-linux"; default = config.nixpkgs.hostPlatform; + description = "The platform on which we are building the system configuration."; }; hostPlatform = lib.mkOption {