| 13 Feb 2022 |
grw00 | @buckley310:matrix.org: hey, your config looks great, i will try to upgrade my "legacy" niv+morph config to copy yours. one thing i can't see is how i actually use colmena to run a deploy.. any hints? :) | 10:47:20 |
Linux Hackerman is moving: @linus:schreibt.jetzt | grw00: please don't call stable interfaces legacy, flakes is not stable by any means. | 12:23:03 |
Linux Hackerman is moving: @linus:schreibt.jetzt | grw00: that said, colmena apply is the command for deploying. | 12:23:17 |
grw00 | i meant legacy in sense of.. hacked together config i have used for some years, not non-flake | 12:27:28 |
grw00 | anyway i think in the repo i refer to it's not so simple as colmena apply - error: Flake must define outputs.colmena | 12:29:01 |
CRTified | In reply to @grw00:matrix.org anyway i think in the repo i refer to it's not so simple as colmena apply - error: Flake must define outputs.colmena Do you want to use a "shim" to populate outputs.colmena from outputs.nixosConfigurations? | 13:31:39 |
CRTified | (Oh, and are you on nix 2.6, 2.4 or older?) | 13:32:19 |
grw00 | 2.6 | 13:41:31 |
grw00 | In reply to @schnecfk:ruhr-uni-bochum.de Do you want to use a "shim" to populate outputs.colmena from outputs.nixosConfigurations? yeah i thought maybe i had to do this, wasn't sure if it was necessary and i just didnt use right command | 13:42:10 |
CRTified | iirc Buckley changed the approach for the shim, while I found the following solution. In the flake.nix, I populate colmena from nixosConfigurations.
colmena = {
meta = {
description = "My personal machines";
nixpkgs = import nixpkgs {
system = "x86_64-linux";
overlays = [ nur.overlay ];
};
};
} // builtins.mapAttrs (name: value: {
nixpkgs.system = value.config.nixpkgs.system;
imports = value._module.args.modules;
}) (self.nixosConfigurations);
But to have the deployment options available (and not conflicting with colmena), I had to add:
extraModules = [ colmena.nixosModules.deploymentOptions ];
in the nixpkgs.lib.nixosSystem call
| 13:44:22 |
CRTified | extraModules is not part of value._module.args.modules, so you retain the ability to nixos-rebuild --flake .#hostname build, while also being able to deploy with colmena | 13:45:16 |