From 666b209f0cf01818e67e56872eed08e20819883b Mon Sep 17 00:00:00 2001 From: Skyler Grey Date: Fri, 2 Jan 2026 11:23:10 +0000 Subject: [PATCH] chore: bump nillas to testing versions Change-Id: wlvkpzlyptuqmwoovpwrsqquskyzmzts --- packetmix/modules/nilla-home/home.nix | 7 -- packetmix/modules/nilla-home/homes-type.nix | 6 +- packetmix/modules/nilla-home/nixos.nix | 101 +++++++------------- packetmix/npins/sources.json | 29 +++--- 4 files changed, 50 insertions(+), 93 deletions(-) diff --git a/packetmix/modules/nilla-home/home.nix b/packetmix/modules/nilla-home/home.nix index 6a463073..efb0a5db 100644 --- a/packetmix/modules/nilla-home/home.nix +++ b/packetmix/modules/nilla-home/home.nix @@ -12,11 +12,4 @@ in default.value = { }; type = homes-type; }; - - config = { - assertions = lib.attrs.mapToList (name: value: { - assertion = !(builtins.isNull value.pkgs); - message = "A Nixpkgs instance is required for the home-manager home \"${name}\", but none was provided and \"inputs.nixpkgs\" does not exist."; - }) config.homes; - }; } diff --git a/packetmix/modules/nilla-home/homes-type.nix b/packetmix/modules/nilla-home/homes-type.nix index 84672f2a..59509e3f 100644 --- a/packetmix/modules/nilla-home/homes-type.nix +++ b/packetmix/modules/nilla-home/homes-type.nix @@ -106,7 +106,11 @@ lib.types.attrs.of ( description = "The created Home Manager home for each of the systems."; type = lib.types.attrs.of lib.types.raw; writable = false; - default.value = result; + default.value = + if builtins.isNull config.pkgs then + "A Nixpkgs instance is required for the home-manager home \"${name}\", but none was provided and \"inputs.nixpkgs\" does not exist." + else + result; }; }; diff --git a/packetmix/modules/nilla-home/nixos.nix b/packetmix/modules/nilla-home/nixos.nix index 14bdd6c6..32f8b373 100644 --- a/packetmix/modules/nilla-home/nixos.nix +++ b/packetmix/modules/nilla-home/nixos.nix @@ -30,6 +30,7 @@ in config.modules = let + system = submodule.config.pkgs.stdenv.hostPlatform.system or submodule.config.pkgs.system; warn' = builtins.warn or builtins.trace; # builtins.warn doesn't exist on some versions of nix/lix warnIf = condition: message: value: @@ -37,21 +38,48 @@ in homeManager = submodule.config.home-manager; in (lib.fp.pipe [ + ( + value: + if builtins.isNull homeManager && value != [ ] then + builtins.throw "A home-manager instance is required to enable homes for the NixOS system \"${name}\", but none was provided and \"inputs.home-manager\" does not exist." + else + value + ) (lib.attrs.mapToList ( homeName: home: let homeNameParts = builtins.match "([a-z][-a-z0-9]*)(@([-A-Za-z0-9]+))?(:([-_A-Za-z0-9]+))?" homeName; username = builtins.elemAt homeNameParts 0; + homeHasHomeManager = !(builtins.isNull home.home-manager); + homeIsValidForSystem = home ? result.${value.pkgs.stdenv.hostPlatform.system or value.pkgs.system}; in - { - inherit home homeName username; - } + if !hasHomeManager then + builtins.throw "You've asked for the home \"${homeName}\" to be activated in the NixOS system \"${name}\", but it needs a home-manager instance, none was provided and \"inputs.home-manager\" does not exist." + else if !homeIsValidForSystem then + builtins.throw "You've asked for the home \"${homeName}\" to be activated in the NixOS system \"${name}\", but it isn't valid for \"${ + value.pkgs.stdenv.hostPlatform.system or value.pkgs.system + }\" systems." + else + { + inherit home homeName username; + } )) + ( + values: + let + existingUsernames = builtins.filter (username: value.username != null) values; + uniqueUsernames = lib.lists.unique existingUsernames; + in + if existingUsernames != uniqueUsernames then + builtins.throw "There are multiple homes for a single user in the NixOS system \"${name}\". Please make sure you've only enabled a single home per user." + else + values + ) (builtins.map ( { home, homeName, - ... + username, }@identity: warnIf (home.home-manager != homeManager) "The home \"${homeName}\" isn't using the same home-manager input as the NixOS system \"${name}\". This may work, but is not officially supported by the Nilla Home or Nilla NixOS maintainers. Please fix this before reporting any bugs you may find." @@ -94,69 +122,4 @@ in ); }; }; - - config = { - assertions = lib.lists.flatten ( - lib.attrs.mapToList ( - name: value: - let - hasNixpkgs = !(builtins.isNull value.pkgs); - requestedHomes = value.homes != [ ]; - hasHomeManager = !(builtins.isNull value.home-manager); - in - [ - { - assertion = hasNixpkgs; - message = "A Nixpkgs instance is required for the NixOS system \"${name}\", but none was provided and \"inputs.nixpkgs\" does not exist."; - } - { - assertion = !requestedHomes || hasHomeManager; - message = "A home-manager instance is required to enable homes for the NixOS system \"${name}\", but none was provided and \"inputs.home-manager\" does not exist."; - } - (lib.attrs.mapToList ( - homeName: home: - let - homeHasHomeManager = !(builtins.isNull home.home-manager); - homeIsValidForSystem = home ? result.${value.pkgs.stdenv.hostPlatform.system}; - in - [ - { - assertion = homeHasHomeManager; - message = "You've asked for the home \"${homeName}\" to be activated in the NixOS system \"${name}\", but it needs a home-manager instance, none was provided and \"inputs.home-manager\" does not exist."; - } - { - assertion = !homeHasHomeManager || !hasNixpkgs || homeIsValidForSystem; - message = "You've asked for the home \"${homeName}\" to be activated in the NixOS system \"${name}\", but it isn't valid for \"${value.pkgs.stdenv.hostPlatform.system}\" systems."; - } - ] - ) value.homes) - ( - let - usernames = lib.attrs.mapToList ( - homeName: home: - let - homeHasHomeManager = !(builtins.isNull home.home-manager); - homeIsValidForSystem = home ? result.${value.pkgs.stdenv.hostPlatform.system}; - in - if homeHasHomeManager && hasNixpkgs && homeIsValidForSystem then - let - homeNameParts = builtins.match "([a-z][-a-z0-9]*)(@([-A-Za-z0-9]+))?(:([-_A-Za-z0-9]+))?" homeName; - username = builtins.elemAt homeNameParts 0; - in - username - else - null - ) value.homes; - existingUsernames = builtins.filter (username: username != null) usernames; - uniqueUsernames = lib.lists.unique existingUsernames; - in - { - assertion = !hasNixpkgs || (existingUsernames == uniqueUsernames); - message = "There are multiple homes for a single user in the NixOS system \"${name}\". Please make sure you've only enabled a single home per user."; - } - ) - ] - ) global.config.systems.nixos - ); - }; } diff --git a/packetmix/npins/sources.json b/packetmix/npins/sources.json index 746abaa0..2cea43bd 100644 --- a/packetmix/npins/sources.json +++ b/packetmix/npins/sources.json @@ -412,11 +412,11 @@ "owner": "nilla-nix", "repo": "nilla" }, - "branch": "private/coded/push-nzprlvpltxyl", + "branch": "private/minion/push-swlstmwvzvkr", "submodules": false, - "revision": "2f8b8c68efc4d81637be344d1b01462291a45e05", - "url": "https://github.com/nilla-nix/nilla/archive/2f8b8c68efc4d81637be344d1b01462291a45e05.tar.gz", - "hash": "sha256-VLlP6L8uvgEjb1ZZXdc4P3NAs5PcgIjpGm8LvaObrLY=" + "revision": "25f05256fafeaa962389b9ca2bea12fff77f20a7", + "url": "https://github.com/nilla-nix/nilla/archive/25f05256fafeaa962389b9ca2bea12fff77f20a7.tar.gz", + "hash": "sha256-ulbTSG6aflGuYYA+ItRf9HwXkITeEFzxRipmAXNhusw=" }, "nilla-cli": { "type": "Git", @@ -432,20 +432,17 @@ "hash": "sha256-cPdYYXhCsDllVgq+gs5Wqhb41bFtKWHlkTvjOJv7its=" }, "nilla-home": { - "type": "GitRelease", + "type": "Git", "repository": { "type": "GitHub", "owner": "nilla-nix", "repo": "home" }, - "pre_releases": true, - "version_upper_bound": null, - "release_prefix": null, + "branch": "private/minion/push-ovknmuuuxzul", "submodules": false, - "version": "v0.1.1-alpha", - "revision": "8d8d783cd3ebe38246f66c027a312e5ec0914c58", - "url": "https://api.github.com/repos/nilla-nix/home/tarball/refs/tags/v0.1.1-alpha", - "hash": "sha256-34qP2aqJgvJ6rQo5vi9o65kxrxbp2dFi8S7z3B+P74g=" + "revision": "5eae985eb596ec26dba3ed07869fc067b697c7e2", + "url": "https://github.com/nilla-nix/home/archive/5eae985eb596ec26dba3ed07869fc067b697c7e2.tar.gz", + "hash": "sha256-UfyL9nxwyF7g7FLyXkPNl3LyK6G26VDzPXrmwnR99LA=" }, "nilla-nixos": { "type": "Git", @@ -454,11 +451,11 @@ "owner": "nilla-nix", "repo": "nixos" }, - "branch": "main", + "branch": "private/minion/push-yxkmmnpurumu", "submodules": false, - "revision": "52c623ae89fe77de669a981c7e92b1504cd99eac", - "url": "https://github.com/nilla-nix/nixos/archive/52c623ae89fe77de669a981c7e92b1504cd99eac.tar.gz", - "hash": "sha256-7tadYU5GzOUAxo8XLC18+dk0Rj+QSORUO5cFdpqfSy4=" + "revision": "ca792473bca389769dffd171b60c8f9c26833231", + "url": "https://github.com/nilla-nix/nixos/archive/ca792473bca389769dffd171b60c8f9c26833231.tar.gz", + "hash": "sha256-5uYZ7rA00ZaKZYgrCYkpsQhpRPeNb5PKZKfv7yrPDLs=" }, "niri": { "type": "Git", -- 2.43.0