From 719fd225f2f82cc1a8a71e3ce17ad3ffc5c3f9d3 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 | 100 ++++++-------------- packetmix/npins/sources.json | 29 +++--- 4 files changed, 49 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..5e7698dc 100644 --- a/packetmix/modules/nilla-home/nixos.nix +++ b/packetmix/modules/nilla-home/nixos.nix @@ -37,21 +37,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.${config.pkgs.stdenv.hostPlatform.system or config.pkgs.system}; in - { - inherit home homeName username; - } + if !homeHasHomeManager 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 \"${ + config.pkgs.stdenv.hostPlatform.system or config.pkgs.system + }\" systems." + else + { + inherit home homeName username; + } )) + ( + values: + let + existingUsernames = builtins.filter (value: 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 +121,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..590aca35 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": "f85d82d169c0faf452255ee156e51147ba0be443", + "url": "https://github.com/nilla-nix/nilla/archive/f85d82d169c0faf452255ee156e51147ba0be443.tar.gz", + "hash": "sha256-LZ0rGLnlaNJR8EYaL2xyM6sj4ld9/rFUUvu7RjSA020=" }, "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": "547625a704ed3c5ad4fbb85b756f299ae73e13af", + "url": "https://github.com/nilla-nix/home/archive/547625a704ed3c5ad4fbb85b756f299ae73e13af.tar.gz", + "hash": "sha256-a7Jlf+/bwe85kkkPSNZjOOZyPKtUquE/6XgXElaKxOs=" }, "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": "b58d52f33ac6dc817702c5114bf5b53ab0db82c7", + "url": "https://github.com/nilla-nix/nixos/archive/b58d52f33ac6dc817702c5114bf5b53ab0db82c7.tar.gz", + "hash": "sha256-KOy1vtpjnwORx4dhx0c1Ddf/PzYpwQOZy8c4+Z8xn7E=" }, "niri": { "type": "Git", -- 2.43.0