I’m trying to consolidate the system config + HM flakes for my linux machines and a aarch64-darwin
.
I thought I’d just mix them up to have:
outputs = inputs @ { self, nixpkgs, nurpkgs, nixpkgsUnstable, musnix, home-manager }:
{
homeConfigurations = (
import ./outputs/home-conf.nix {
inherit (inputs) nixpkgs nurpkgs nixpkgsUnstable home-manager;
nixosConfigs = inputs.self.nixosConfigurations;
}
);
nixosConfigurations = (
import ./outputs/nixos-conf.nix {
inherit (nixpkgs) lib;
inherit inputs;
}
);
darwinConfigurations."jm1b" = darwin.lib.darwinSystem {
# nixpkgs.overlays = overlays;
specialArgs = { inherit darwin overlays; };
system = "aarch64-darwin";
modules = [ ../system/machine/jm1b/darwin-configuration.nix ];
};
};
because they’re lazily evaluated anyway, and then call the same flake with nixos-rebuild
on linux and darwin-rebuild
in mac.
But when I add darwin
to the inputs, and run for a linux system, I get the following error:
error: 'outputs' at /nix/.../flake.nix:27:13 called with unexpected argument 'darwin'
So I’m still stuck with a different flake for darwin
; for synergy I’m just importing the user specific HM config part via outputs/home-conf.nix
which then calls all the user’s packages/services/programs via imports, to get the “same” settings for my user across systems. (System-specifics are selected with conditional imports).
Is anyone running multi-platform configs from one flake; how to achieve that?
The objective is to have one flake and all systems/users imported from nix
expressions in respective subdirs, to leverage sharing of common settings without duplication.