mirror of
https://github.com/nmasur/dotfiles
synced 2024-12-05 02:29:08 +00:00
Compare commits
3 Commits
520f0587c8
...
1865f6985e
Author | SHA1 | Date | |
---|---|---|---|
|
1865f6985e | ||
|
c338ff5579 | ||
|
bf58cf62d3 |
@ -74,6 +74,7 @@ inputs.nixpkgs.lib.nixosSystem {
|
||||
"tank/archive"
|
||||
"tank/generic"
|
||||
"tank/nextcloud"
|
||||
"tank/generic/git"
|
||||
];
|
||||
# If password is requested and fails, continue to boot eventually
|
||||
passwordTimeout = 300;
|
||||
@ -86,7 +87,7 @@ inputs.nixpkgs.lib.nixosSystem {
|
||||
|
||||
# Still require colors for programs like Neovim, K9S
|
||||
theme = {
|
||||
colors = (import ../../colorscheme/gruvbox).dark;
|
||||
colors = (import ../../colorscheme/gruvbox-dark).dark;
|
||||
};
|
||||
|
||||
# Programs and services
|
||||
|
@ -1,4 +1,10 @@
|
||||
{ config, ... }: {
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
# This is just a placeholder as I expect to interact with my notes in a
|
||||
# certain location
|
||||
@ -9,6 +15,22 @@
|
||||
NOTES_PATH = "${config.homePath}/dev/personal/notes/content";
|
||||
};
|
||||
|
||||
# Sync notes for Nextcloud automatically
|
||||
systemd.user.timers.refresh-notes = lib.mkIf config.services.nextcloud.enable {
|
||||
Timer = {
|
||||
OnCalendar = "*-*-* *:0/10:50"; # Every 10 minutes
|
||||
Unit = "refresh-notes.service";
|
||||
};
|
||||
};
|
||||
systemd.user.services.refresh-notes = {
|
||||
Unit.Description = "Get latest notes.";
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStartPre = "${pkgs.git}/bin/git -C /data/git/notes reset --hard master";
|
||||
ExecStart = "${pkgs.git}/bin/git -C /data/git/notes pull";
|
||||
WorkingDirectory = config.homePath;
|
||||
Environment = "PATH=${pkgs.openssh}/bin";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -5,7 +5,12 @@
|
||||
# To set this on all home machines, I point my router's DNS resolver to the
|
||||
# local IP address of the machine running this service (swan).
|
||||
|
||||
{ config, pkgs, lib, ... }:
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
|
||||
@ -18,8 +23,8 @@ let
|
||||
];
|
||||
mkRecord = service: "${service} A ${localIp}";
|
||||
localRecords = lib.concatLines (map mkRecord localServices);
|
||||
|
||||
in {
|
||||
in
|
||||
{
|
||||
|
||||
config = lib.mkIf config.services.bind.enable {
|
||||
|
||||
@ -31,12 +36,20 @@ in {
|
||||
|
||||
# Allow requests coming from these IPs. This way I don't somehow get
|
||||
# spammed with DNS requests coming from the Internet.
|
||||
cacheNetworks = [ "127.0.0.0/24" "192.168.0.0/16" ];
|
||||
cacheNetworks = [
|
||||
"127.0.0.0/24"
|
||||
"192.168.0.0/16"
|
||||
"::1/128" # Required because IPv6 loopback now added to resolv.conf
|
||||
# (see: https://github.com/NixOS/nixpkgs/pull/302228)
|
||||
];
|
||||
|
||||
# When making normal DNS requests, forward them to Cloudflare to resolve.
|
||||
forwarders = [ "1.1.1.1" "1.0.0.1" ];
|
||||
forwarders = [
|
||||
"1.1.1.1"
|
||||
"1.0.0.1"
|
||||
];
|
||||
|
||||
ipv4Only = true;
|
||||
ipv4Only = false;
|
||||
|
||||
# Use rpz zone as an override
|
||||
extraOptions = ''response-policy { zone "rpz"; };'';
|
||||
@ -59,13 +72,16 @@ in {
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
# We must allow DNS traffic to hit our machine as well
|
||||
networking.firewall.allowedTCPPorts = [ 53 ];
|
||||
networking.firewall.allowedUDPPorts = [ 53 ];
|
||||
|
||||
# Set our own nameservers to ourselves
|
||||
networking.nameservers = [
|
||||
"127.0.0.1"
|
||||
"::1"
|
||||
];
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user