45 lines
954 B
Nix
45 lines
954 B
Nix
{ config, pkgs, lib, ...}:
|
|
|
|
with lib;
|
|
|
|
let
|
|
nixfiles-generate-config = pkgs.writeShellApplication {
|
|
name = "nixfiles-generate-config";
|
|
text = builtins.readFile ./nixfiles-generate-config.sh;
|
|
runtimeInputs = [
|
|
pkgs.git
|
|
];
|
|
checkPhase = "";
|
|
};
|
|
in {
|
|
options.clerie.nixfiles.enable = mkEnableOption "clerie nixfiles tools";
|
|
config = mkIf config.clerie.nixfiles.enable {
|
|
system.nixos-generate-config.configuration = ''
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
{
|
|
imports =
|
|
[
|
|
./hardware-configuration.nix
|
|
];
|
|
|
|
$bootLoaderConfig
|
|
|
|
networking.hostName = "%HOSTNAME%";
|
|
|
|
clerie.monitoring = {
|
|
# enable = true;
|
|
id = "%MONITORING_ID%";
|
|
pubkey = "%MONITORING_PUBKEY%";
|
|
};
|
|
|
|
system.stateVersion = "${config.system.nixos.release}";
|
|
}
|
|
'';
|
|
|
|
environment.systemPackages = [
|
|
nixfiles-generate-config
|
|
];
|
|
};
|
|
}
|