1
0
mirror of https://github.com/kmein/niveum synced 2026-03-17 10:41:06 +01:00

wip: flakes

This commit is contained in:
2021-12-29 15:15:02 +01:00
parent 2a98e680c2
commit 248ebea28e
25 changed files with 339 additions and 200 deletions

View File

@@ -1,7 +1,6 @@
{
imports = [
./constants.nix
./dropbox.nix
./retiolum.nix
];
}

View File

@@ -1,29 +0,0 @@
{ pkgs, lib, config, ... }:
with lib;
let cfg = config.niveum.dropbox;
in {
options.niveum.dropbox = { enable = mkEnableOption "Dropbox"; };
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.dropbox-cli ];
networking.firewall = {
allowedTCPPorts = [ 17500 ];
allowedUDPPorts = [ 17500 ];
};
systemd.user.services.dropbox = {
description = "Dropbox synchronisation service";
wantedBy = [ "graphical-session.target" ];
serviceConfig = {
ExecStart = "${pkgs.dropbox.out}/bin/dropbox";
ExecReload = "${pkgs.coreutils.out}/bin/kill -HUP $MAINPID";
KillMode = "control-group"; # upstream recommends process
Restart = "on-failure";
PrivateTmp = true;
ProtectSystem = "full";
Nice = 10;
};
};
};
}

View File

@@ -1,8 +1,9 @@
{ config, pkgs, lib, ... }:
{ inputs, config, pkgs, lib, ... }:
with lib;
let
netname = "retiolum";
cfg = config.networking.retiolum;
inherit (inputs) retiolum;
in {
options = {
networking.retiolum.ipv4 = mkOption {
@@ -31,8 +32,8 @@ in {
services.tinc.networks.${netname} = {
name = cfg.nodename;
hosts = builtins.mapAttrs
(name: _: builtins.readFile "${<retiolum/hosts>}/${name}")
(builtins.readDir <retiolum/hosts>);
(name: _: builtins.readFile "${retiolum}/hosts/${name}")
(builtins.readDir "${retiolum}/hosts");
rsaPrivateKeyFile = toString <system-secrets/retiolum.key>;
ed25519PrivateKeyFile = toString <system-secrets/retiolum.ed25519>;
extraConfig = ''
@@ -41,7 +42,7 @@ in {
'';
};
networking.extraHosts = builtins.readFile (toString <retiolum/etc.hosts>);
networking.extraHosts = builtins.readFile (toString "${retiolum}/etc.hosts");
environment.systemPackages = [ config.services.tinc.networks.${netname}.package ];