Skip to content

Instantly share code, notes, and snippets.

@danbst
Created December 27, 2019 15:17
Manage your /etc from home-manager (install home-manager as root)
{ config, pkgs, lib, ... }: {
imports = [
(import <nixpkgs/nixos/modules/system/etc/etc.nix>)
];
options.system.build.etc = lib.mkOption { type = lib.types.package; };
options.system.activationScripts.etc =
lib.mkOption { type = lib.types.unspecified; };
config = {
home.activation.setupEtc = config.lib.dag.entryAfter [ "writeBoundary" ] ''
exec ${
pkgs.writeScript "etc-activation"
config.system.activationScripts.etc.text
}
'';
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment