Explore nixos-unified as an alternative to flake-parts and colmena #109

Open
opened 2026-07-27 04:35:43 +00:00 by anish · 6 comments
anish commented 2026-07-27 04:35:43 +00:00 (Migrated from codeberg.org)
No description provided.
Member

nixos-unified is a flake-parts module that unifies NixOS + nix darwin + homemanger configuration in a single flake. It provides consistent interface at the DX and UX level.

.#activate can activate things in one click and remotely over SSH and therefore acts as an alternative to colmena.
.#update can be used to update the primary inputs (which can be overridden)
NIXos/nix-darwin/home-manager modules receive specialargs which includes all information in the top level flake. It also has sensible defaults.

It also autowires flake outputs.

https://nixos-unified.org/

nixos-unified is a flake-parts module that unifies NixOS + nix darwin + homemanger configuration in a single flake. It provides consistent interface at the DX and UX level. .#activate can activate things in one click and remotely over SSH and therefore acts as an alternative to colmena. .#update can be used to update the primary inputs (which can be overridden) NIXos/nix-darwin/home-manager modules receive specialargs which includes all information in the top level flake. It also has sensible defaults. It also autowires flake outputs. https://nixos-unified.org/
junwonp self-assigned this 2026-10-03 21:05:02 +00:00
Member

Initializing templates using Omnix
nix --accept-flake-config run github:juspay/omnix --
init -o ~/nix-config github:srid/nixos-unified#linux

nix run .#activate (nix run .#activate $USER@

If errors on Mac:
nix --accept-flake-config run github:juspay/omnix --
init -o ~/nix-config github:srid/nixos-unified#macos
sudo mv /etc/nix/nix.conf /etc/nix/nix.conf.before-nix-darwin
nix --extra-experimental-features "nix-command flakes" run .#activate
nix run .#activate (nix run .#activate $USER@

Initializing templates using Omnix nix --accept-flake-config run github:juspay/omnix -- \ init -o ~/nix-config github:srid/nixos-unified#linux nix run .#activate (nix run .#activate $USER@ If errors on Mac: nix --accept-flake-config run github:juspay/omnix -- \ init -o ~/nix-config github:srid/nixos-unified#macos sudo mv /etc/nix/nix.conf /etc/nix/nix.conf.before-nix-darwin nix --extra-experimental-features "nix-command flakes" run .#activate nix run .#activate (nix run .#activate $USER@
Member

To activate a system for the current host, run
nix run .#activate

If you want sudoers to match a single command, configure the target host to run this code since by default, nixos-rebuild decides when to invoke sudo for privileged steps.
{
nixos-unified.localPrivilegeMode = "sudo-nixos-rebuild";
}

Optionally, you can use this to add a narrowly scoped sudoers rule for the user and command you use for activation

{
security.sudo.extraRules = [
{
users = [ "myuser" ];
commands = [
{
command = "/run/current-system/sw/bin/nixos-rebuild switch *";
options = [ "NOPASSWD" ];
}
];
}
];
}

For remote activation, set the nixos-unified.sshTarget option in configuration then run the code to deply to myhost from any machine.

{
nixos-unified.sshTarget = "myuser@myhost";
}
nix run .#activate myhost

Remote activation doesn't replace other deployment tools so it doesn't provide features like rollbacks.

For home-manager configuration, check the website for activation: https://nixos-unified.org/guide/activate

To activate a system for the current host, run nix run .#activate If you want sudoers to match a single command, configure the target host to run this code since by default, nixos-rebuild decides when to invoke sudo for privileged steps. { nixos-unified.localPrivilegeMode = "sudo-nixos-rebuild"; } Optionally, you can use this to add a narrowly scoped sudoers rule for the user and command you use for activation { security.sudo.extraRules = [ { users = [ "myuser" ]; commands = [ { command = "/run/current-system/sw/bin/nixos-rebuild switch *"; options = [ "NOPASSWD" ]; } ]; } ]; } For remote activation, set the nixos-unified.sshTarget option in configuration then run the code to deply to myhost from any machine. { nixos-unified.sshTarget = "myuser@myhost"; } nix run .#activate myhost Remote activation doesn't replace other deployment tools so it doesn't provide features like rollbacks. For home-manager configuration, check the website for activation: https://nixos-unified.org/guide/activate
Member

NixOS, nix-darwin, and home-manager modules implicitly receive a specialArgs called flake. Components of flake attrset are
inputs: inputs of your flake; inputs.self referring to the flake itself
config: the flake-parts perSystem config.

Example of how inputs and config can be used:
{ flake, pkgs, lib, ... }:
let
inherit (flake) config inputs;
inherit (inputs) self;
in
{
imports = [
# Reference a flake input directly from a nix-darwin module
inputs.agenix.darwinModules.default
];

Reference an arbitrary flake-parts config

home-manager.users.${config.me.username} = { };
}

NixOS, nix-darwin, and home-manager modules implicitly receive a specialArgs called flake. Components of flake attrset are inputs: inputs of your flake; inputs.self referring to the flake itself config: the flake-parts perSystem config. Example of how inputs and config can be used: { flake, pkgs, lib, ... }: let inherit (flake) config inputs; inherit (inputs) self; in { imports = [ # Reference a flake input directly from a nix-darwin module inputs.agenix.darwinModules.default ]; # Reference an arbitrary flake-parts config home-manager.users.${config.me.username} = { }; }
Member

Importing nixos-unified flake-parts module will autowire the following flake outputs in your flake

nixos-unified.lib: functions like mkLinuxSystem, mcMacosSystem and mkHomeConfiguration
packages.update: flake app to update key flake inputs
packages.activate: flake app to build and activate the system or home configuration

All NixOS/nix-darwin/home-manager modules implicitly receive the following specialArgs:
flake@{self, inputs, config} (config is from flake parts)
rosettaPkgs (if on darwin)

Importing nixos-unified flake-parts module will autowire the following flake outputs in your flake nixos-unified.lib: functions like mkLinuxSystem, mcMacosSystem and mkHomeConfiguration packages.update: flake app to update key flake inputs packages.activate: flake app to build and activate the system or home configuration All NixOS/nix-darwin/home-manager modules implicitly receive the following specialArgs: flake@{self, inputs, config} (config is from flake parts) rosettaPkgs (if on darwin)
Member

According to AI, Flake-parts provides an autowiring system where configuration files are automatically wired to standard flake-parts outputs.

Nixos-unified performs a similar function to colemna, allowing users to deploy over SSH without needing to install, configure, or learn Colemna.

Implementation: Start with a Template (probably the official one)
Organize .nix files into standard directories, like configurations/, modules/nixos/, modules/darwin/, or modules/home/. Autowiring automatically scans these directories and builds flake outputs.

For small projects like Scottylabs, applying nixos-unified is beneficial and relatively a simple task.

Run this command for the template:

nix --accept-flake-config run github:juspay/omnix --
init -o ~/nix-config github:srid/nixos-unified#linux
nix run .#activate (nix run .#activate $USER@

According to AI, Flake-parts provides an autowiring system where configuration files are automatically wired to standard flake-parts outputs. Nixos-unified performs a similar function to colemna, allowing users to deploy over SSH without needing to install, configure, or learn Colemna. Implementation: Start with a Template (probably the official one) Organize .nix files into standard directories, like configurations/, modules/nixos/, modules/darwin/, or modules/home/. Autowiring automatically scans these directories and builds flake outputs. For small projects like Scottylabs, applying nixos-unified is beneficial and relatively a simple task. Run this command for the template: nix --accept-flake-config run github:juspay/omnix -- \ init -o ~/nix-config github:srid/nixos-unified#linux nix run .#activate (nix run .#activate $USER@
Sign in to join this conversation.
No description provided.