activationScripts: rewrite /etc/nixos with configuration source

This commit is contained in:
Alexander Tomokhov 2023-12-04 14:17:54 +04:00
parent c63b6b808c
commit 3f573e3dc3
3 changed files with 6 additions and 2 deletions

View file

@ -2,7 +2,6 @@
{
imports = [
./variables-module.nix
./files.nix
./volumes.nix
./users.nix
./letsencrypt/acme.nix

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }:
nixos-config-source: { config, pkgs, ... }:
let
cfg = config.selfprivacy;
dnsCredentialsTemplates = {
@ -29,6 +29,10 @@ in
nixos-lustrate = ''
rm -rf /old-root
'';
selfprivacy-nixos-configuration-source = ''
rm -rf /etc/nixos/{*,.[!.]*}
cp -r --no-preserve=all ${nixos-config-source}/ -T /etc/nixos/
'';
cloudflareCredentials = ''
mkdir -p /var/lib/cloudflare
chmod 0440 /var/lib/cloudflare

View file

@ -24,6 +24,7 @@
modules = [
hardware-configuration
./configuration.nix
(import ./files.nix top-level-flake.outPath)
(import ./userdata-variables.nix userdata)
selfprivacy-api.nixosModules.default
{