mirror of
https://github.com/nmasur/dotfiles
synced 2025-04-28 14:42:24 +00:00
Compare commits
No commits in common. "1865f6985e4bc492a5ea336702ccfde295d15689" and "520f0587c808c857f245793e4ece32fecc9af8d0" have entirely different histories.
1865f6985e
...
520f0587c8
@ -74,7 +74,6 @@ 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;
|
||||
@ -87,7 +86,7 @@ inputs.nixpkgs.lib.nixosSystem {
|
||||
|
||||
# Still require colors for programs like Neovim, K9S
|
||||
theme = {
|
||||
colors = (import ../../colorscheme/gruvbox-dark).dark;
|
||||
colors = (import ../../colorscheme/gruvbox).dark;
|
||||
};
|
||||
|
||||
# Programs and services
|
||||
|
@ -1,10 +1,4 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
{ config, ... }: {
|
||||
|
||||
# This is just a placeholder as I expect to interact with my notes in a
|
||||
# certain location
|
||||
@ -15,22 +9,6 @@
|
||||
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,12 +5,7 @@
|
||||
# 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
|
||||
|
||||
@ -23,8 +18,8 @@ let
|
||||
];
|
||||
mkRecord = service: "${service} A ${localIp}";
|
||||
localRecords = lib.concatLines (map mkRecord localServices);
|
||||
in
|
||||
{
|
||||
|
||||
in {
|
||||
|
||||
config = lib.mkIf config.services.bind.enable {
|
||||
|
||||
@ -36,20 +31,12 @@ 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"
|
||||
"::1/128" # Required because IPv6 loopback now added to resolv.conf
|
||||
# (see: https://github.com/NixOS/nixpkgs/pull/302228)
|
||||
];
|
||||
cacheNetworks = [ "127.0.0.0/24" "192.168.0.0/16" ];
|
||||
|
||||
# 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 = false;
|
||||
ipv4Only = true;
|
||||
|
||||
# Use rpz zone as an override
|
||||
extraOptions = ''response-policy { zone "rpz"; };'';
|
||||
@ -72,16 +59,13 @@ 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…
x
Reference in New Issue
Block a user