Compare commits
3 Commits
2573c5890f
...
docs
Author | SHA1 | Date | |
---|---|---|---|
cd5b2528e9
|
|||
d53405e39e
|
|||
f3424680f2
|
32
flake.lock
generated
32
flake.lock
generated
@@ -8,11 +8,11 @@
|
|||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1703433843,
|
"lastModified": 1703371241,
|
||||||
"narHash": "sha256-nmtA4KqFboWxxoOAA6Y1okHbZh+HsXaMPFkYHsoDRDw=",
|
"narHash": "sha256-f7ZcabJ5iAH2IRfVuI55xSPZ9TbegFzvFxoKtIPNEn8=",
|
||||||
"owner": "ryantm",
|
"owner": "ryantm",
|
||||||
"repo": "agenix",
|
"repo": "agenix",
|
||||||
"rev": "417caa847f9383e111d1397039c9d4337d024bf0",
|
"rev": "457669db4259ff69d1ac1183aaa6000420940c1f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -66,11 +66,11 @@
|
|||||||
"firefox-gnome-theme": {
|
"firefox-gnome-theme": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1703785537,
|
"lastModified": 1703023593,
|
||||||
"narHash": "sha256-+1LbSEgvKS31Kx9mL5T68n8nENL3jYoGRuQR4y7W6BA=",
|
"narHash": "sha256-M+Cw6vh7xCDmIhyVuEPNmaNVUwpmdFQq8zlsXZTKees=",
|
||||||
"owner": "rafaelmardojai",
|
"owner": "rafaelmardojai",
|
||||||
"repo": "firefox-gnome-theme",
|
"repo": "firefox-gnome-theme",
|
||||||
"rev": "1bdf9a04f8faa061d219294a9ad99d432b18767c",
|
"rev": "bad853333d9021e7012adb9b8fbfe7a7003f26bc",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -139,11 +139,11 @@
|
|||||||
},
|
},
|
||||||
"nixos-hardware": {
|
"nixos-hardware": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1704061647,
|
"lastModified": 1702453208,
|
||||||
"narHash": "sha256-M/Kxfmb/fkgOz94jQ9eLFpXOhjQJ3CRmdPhVIVXqJmg=",
|
"narHash": "sha256-0wRi9SposfE2wHqjuKt8WO2izKB/ASDOV91URunIqgo=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixos-hardware",
|
"repo": "nixos-hardware",
|
||||||
"rev": "316bc98323fe3a7e7f72dbbbe68dce0cce3d4984",
|
"rev": "7763c6fd1f299cb9361ff2abf755ed9619ef01d6",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -186,11 +186,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
"nixpkgs_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1703900474,
|
"lastModified": 1703068421,
|
||||||
"narHash": "sha256-Zu+chYVYG2cQ4FCbhyo6rc5Lu0ktZCjRbSPE0fDgukI=",
|
"narHash": "sha256-WSw5Faqlw75McIflnl5v7qVD/B3S2sLh+968bpOGrWA=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "9dd7699928e26c3c00d5d46811f1358524081062",
|
"rev": "d65bceaee0fb1e64363f7871bc43dc1c6ecad99f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -214,11 +214,11 @@
|
|||||||
"secrets": {
|
"secrets": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1703545643,
|
"lastModified": 1702936962,
|
||||||
"narHash": "sha256-FS/acsRQ01Gj39P1t5CQ6cKOdwADmenk//vVmpA/EgU=",
|
"narHash": "sha256-uIZ2uPE26JKJ58463ejHMiAOpqBwflyN6tCmZ89vaSQ=",
|
||||||
"ref": "refs/heads/master",
|
"ref": "refs/heads/master",
|
||||||
"rev": "ef1f91b155f3bdc4efb2824ad0c47b21b8b1bbfa",
|
"rev": "c6db5c3ba8bff0e618fc3e31c9680863c5e53800",
|
||||||
"revCount": 9,
|
"revCount": 5,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "ssh://git@git.vimium.com/jordan/nix-secrets.git"
|
"url": "ssh://git@git.vimium.com/jordan/nix-secrets.git"
|
||||||
},
|
},
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
{ config, lib, pkgs, inputs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@@ -6,19 +6,13 @@
|
|||||||
../desktop.nix
|
../desktop.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
boot = {
|
boot.loader.grub.enable = true;
|
||||||
loader.grub = {
|
boot.loader.grub.device = "/dev/sda";
|
||||||
enable = true;
|
boot.loader.grub.zfsSupport = true;
|
||||||
device = "/dev/sda";
|
|
||||||
zfsSupport = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
networking = {
|
networking.hostName = "helios";
|
||||||
hostName = "helios";
|
networking.hostId = "47d23505";
|
||||||
hostId = "47d23505";
|
networking.networkmanager.enable = true;
|
||||||
networkmanager.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
nix.package = pkgs.nixFlakes;
|
nix.package = pkgs.nixFlakes;
|
||||||
nix.extraOptions = ''
|
nix.extraOptions = ''
|
||||||
@@ -46,15 +40,6 @@
|
|||||||
gpg.enable = true;
|
gpg.enable = true;
|
||||||
pass.enable = true;
|
pass.enable = true;
|
||||||
};
|
};
|
||||||
services = {
|
|
||||||
borgmatic = {
|
|
||||||
enable = true;
|
|
||||||
directories = [
|
|
||||||
"/home/jordan/Documents"
|
|
||||||
];
|
|
||||||
repoPath = "ssh://b9cjl9hq@b9cjl9hq.repo.borgbase.com/./repo";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
shell = {
|
shell = {
|
||||||
git.enable = true;
|
git.enable = true;
|
||||||
zsh.enable = true;
|
zsh.enable = true;
|
||||||
|
@@ -1,35 +0,0 @@
|
|||||||
# Hypnos
|
|
||||||
|
|
||||||
## Overview
|
|
||||||
15-inch MacBook Pro 11,3 (Mid 2014).
|
|
||||||
|
|
||||||
## Specs
|
|
||||||
* CPU - Intel Core i7-4870HQ @ 2.50GHz
|
|
||||||
* Memory - 16 GB DDR3
|
|
||||||
* GPU - Intel Iris Pro 5200
|
|
||||||
* GPU - NVIDIA GeForce GT 750M
|
|
||||||
* NIC - Broadcom BCM43xx 802.11ac
|
|
||||||
|
|
||||||
### Disks
|
|
||||||
Device | Partitions _(filesystem, size, usage)_
|
|
||||||
--- | ---
|
|
||||||
Apple SSD SM0512F | `/dev/nvme01` (ZFS, 500 GiB, NixOS Root)
|
|
||||||
|
|
||||||
#### ZFS pool layout
|
|
||||||
```
|
|
||||||
rpool/
|
|
||||||
├── local
|
|
||||||
│ ├── nix
|
|
||||||
│ └── tmp
|
|
||||||
├── system
|
|
||||||
│ ├── root
|
|
||||||
│ └── var
|
|
||||||
└── user
|
|
||||||
└── home
|
|
||||||
```
|
|
||||||
|
|
||||||
See [Graham Christensen's article](https://grahamc.com/blog/nixos-on-zfs/#datasets) for the motivation behind these datasets.
|
|
||||||
|
|
||||||
### Networks
|
|
||||||
- DHCP on `10.0.1.0/24` subnet.
|
|
||||||
- Tailscale on `100.64.0.0/10` subnet. FQDN: `hypnos.mesh.vimium.net`.
|
|
@@ -1,53 +0,0 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./hardware-configuration.nix
|
|
||||||
../desktop.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.loader = {
|
|
||||||
systemd-boot.enable = true;
|
|
||||||
efi.canTouchEfiVariables = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
networking = {
|
|
||||||
hostName = "hypnos";
|
|
||||||
hostId = "cf791898";
|
|
||||||
networkmanager.enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
nix = {
|
|
||||||
package = pkgs.nixFlakes;
|
|
||||||
extraOptions = ''
|
|
||||||
experimental-features = nix-command flakes
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
modules = {
|
|
||||||
desktop = {
|
|
||||||
browsers = {
|
|
||||||
firefox.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
dev = {
|
|
||||||
node.enable = true;
|
|
||||||
};
|
|
||||||
editors = {
|
|
||||||
neovim.enable = true;
|
|
||||||
};
|
|
||||||
networking = {
|
|
||||||
wireless.enable = true;
|
|
||||||
};
|
|
||||||
security = {
|
|
||||||
gpg.enable = true;
|
|
||||||
pass.enable = true;
|
|
||||||
};
|
|
||||||
shell = {
|
|
||||||
git.enable = true;
|
|
||||||
zsh.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
system.stateVersion = "22.11";
|
|
||||||
}
|
|
@@ -1,21 +0,0 @@
|
|||||||
{ config, lib, pkgs, modulesPath, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
(modulesPath + "/installer/scan/not-detected.nix")
|
|
||||||
];
|
|
||||||
|
|
||||||
boot = {
|
|
||||||
initrd.availableKernelModules = [ "xhci_pci" "achi" "usbhid" "usb_storage" "sd_mod" ];
|
|
||||||
initrd.kernelModules = [ ];
|
|
||||||
kernelModules = [ "kvm-intel" "wl" ];
|
|
||||||
extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ];
|
|
||||||
};
|
|
||||||
|
|
||||||
networking.useDHCP = lib.mkDefault true;
|
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
|
||||||
|
|
||||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
||||||
}
|
|
||||||
|
|
30
hosts/new.md
Normal file
30
hosts/new.md
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
# Steps to add a new host
|
||||||
|
|
||||||
|
1. Generate an SSH host key to be used for secrets
|
||||||
|
`ssh-keygen -t ed25519 -f /tmp/ssh_host_ed25519_key -C ""`
|
||||||
|
1. Go to borgmatic.com, add the generated SSH key and create a new
|
||||||
|
repository
|
||||||
|
1. Add a new host entry to nix-secrets/secrets.nix
|
||||||
|
1. Generate a repository passphrase in nix-secrets
|
||||||
|
1. Commit nix-secrets and run `nix flake update` in nix-config
|
||||||
|
1. Add a README.md and default.nix suited to the host
|
||||||
|
1. Define (or generate with `nixos-generate-config`) a
|
||||||
|
hardware-configuration.nix
|
||||||
|
1. Define the disk layout to be used by disko
|
||||||
|
1. Commit nix-config
|
||||||
|
1. Boot the NixOS installer
|
||||||
|
1. Copy the generated SSH host key to `/etc/ssh`
|
||||||
|
1. Run `nix run github:nix-community/nixos-anywhere -- --flake .#<hostname> root@<ip address>`
|
||||||
|
|
||||||
|
## Post install
|
||||||
|
> The backup and Tailscale modules won't work until the following steps are
|
||||||
|
> completed.
|
||||||
|
|
||||||
|
1. Run `sudo borgmatic init --encryption repokey-blake2`
|
||||||
|
1. Restart `borgmatic`
|
||||||
|
1. Run `sudo tailscale up --login-server https://headscale.vimium.net`
|
||||||
|
1. Visit the URL, then SSH onto `vps1` and run
|
||||||
|
`headscale --user mesh nodes register --key <key>`
|
||||||
|
1. (Optionally) Give the Tailscale node a friendly name with
|
||||||
|
`headscale node rename -i <index> <hostname>`
|
||||||
|
|
@@ -1,11 +1,8 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
let
|
let
|
||||||
snd-usb-audio-module = pkgs.callPackage ./snd-usb-audio.nix {
|
snd-usb-audio-module = pkgs.callPackage ./snd-usb-audio.nix {
|
||||||
kernel = config.boot.kernelPackages.kernel;
|
kernel = config.boot.kernelPackages.kernel;
|
||||||
};
|
};
|
||||||
patched = snd-usb-audio-module.overrideAttrs (prev: {
|
|
||||||
patches = [ ./0001-Update-device-ID-for-PreSonus-1824c.patch ];
|
|
||||||
});
|
|
||||||
upmixConfig = ''
|
upmixConfig = ''
|
||||||
stream.properties = {
|
stream.properties = {
|
||||||
channelmix.upmix = true
|
channelmix.upmix = true
|
||||||
@@ -13,9 +10,10 @@ let
|
|||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
in {
|
in {
|
||||||
boot.kernelModules = [ "snd-usb-audio" ];
|
|
||||||
boot.extraModulePackages = [
|
boot.extraModulePackages = [
|
||||||
(patched)
|
(snd-usb-audio-module.overrideAttrs (_: {
|
||||||
|
patches = [ ./0001-Update-device-ID-for-PreSonus-1824c.patch ];
|
||||||
|
}))
|
||||||
];
|
];
|
||||||
|
|
||||||
environment.etc = {
|
environment.etc = {
|
||||||
|
@@ -52,6 +52,34 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
age.secrets."passwords/services/borg/odyssey-passphrase" = {
|
||||||
|
file = "${inputs.secrets}/passwords/services/borg/odyssey-passphrase.age";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.borgmatic = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
source_directories = [
|
||||||
|
"/home/jordan/Documents"
|
||||||
|
];
|
||||||
|
repositories = [
|
||||||
|
{ label = "borgbase"; path = "ssh://iqwu22oq@iqwu22oq.repo.borgbase.com/./repo"; }
|
||||||
|
];
|
||||||
|
storage = {
|
||||||
|
encryption_passcommand = "cat ${config.age.secrets."passwords/services/borg/odyssey-passphrase".path}";
|
||||||
|
ssh_command = "ssh -i /etc/ssh/ssh_host_ed25519_key";
|
||||||
|
};
|
||||||
|
retention = {
|
||||||
|
keep_daily = 7;
|
||||||
|
keep_weekly = 4;
|
||||||
|
keep_monthly = 6;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Without this override, `cat` is unavailable for `encryption_passcommand`
|
||||||
|
systemd.services.borgmatic.confinement.fullUnit = true;
|
||||||
|
|
||||||
modules = {
|
modules = {
|
||||||
desktop = {
|
desktop = {
|
||||||
apps.qbittorrent.enable = true;
|
apps.qbittorrent.enable = true;
|
||||||
@@ -83,15 +111,6 @@
|
|||||||
gpg.enable = true;
|
gpg.enable = true;
|
||||||
pass.enable = true;
|
pass.enable = true;
|
||||||
};
|
};
|
||||||
services = {
|
|
||||||
borgmatic = {
|
|
||||||
enable = true;
|
|
||||||
directories = [
|
|
||||||
"/home/jordan/Documents"
|
|
||||||
];
|
|
||||||
repoPath = "ssh://iqwu22oq@iqwu22oq.repo.borgbase.com/./repo";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
shell = {
|
shell = {
|
||||||
git.enable = true;
|
git.enable = true;
|
||||||
zsh.enable = true;
|
zsh.enable = true;
|
||||||
|
@@ -64,9 +64,5 @@
|
|||||||
|
|
||||||
networking.useDHCP = lib.mkDefault true;
|
networking.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
environment.systemPackages = [
|
|
||||||
pkgs.apfs-fuse
|
|
||||||
];
|
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
}
|
}
|
||||||
|
@@ -16,10 +16,3 @@ SD card | `/dev/mmcblk0` (ext4, NixOS Root)
|
|||||||
### Networks
|
### Networks
|
||||||
- DHCP on `10.0.1.0/24` subnet.
|
- DHCP on `10.0.1.0/24` subnet.
|
||||||
- Tailscale on `100.64.0.0/10` subnet. FQDN: `pi.mesh.vimium.net`.
|
- Tailscale on `100.64.0.0/10` subnet. FQDN: `pi.mesh.vimium.net`.
|
||||||
|
|
||||||
## Devices and connections
|
|
||||||
|
|
||||||
- SONOFF Zigbee 3.0 USB Dongle Plus (connected to USB 2.0 port to avoid [interference](https://www.unit3compliance.co.uk/2-4ghz-intra-system-or-self-platform-interference-demonstration/))
|
|
||||||
- HDMI to ONKYO HT-R990
|
|
||||||
- S/PDIF to ONKYO HT-R990
|
|
||||||
- Ethernet to ONKYO HT-R990
|
|
||||||
|
@@ -17,59 +17,8 @@
|
|||||||
};
|
};
|
||||||
deviceTree = {
|
deviceTree = {
|
||||||
enable = true;
|
enable = true;
|
||||||
filter = "*rpi-4-*.dtb";
|
|
||||||
overlays = [
|
overlays = [
|
||||||
{
|
{ name = "hifiberry-digi-pro"; dtboFile = "${pkgs.device-tree_rpi.overlays}/hifiberry-digi-pro.dtbo"; }
|
||||||
# Adapted from: https://github.com/raspberrypi/linux/blob/rpi-6.1.y/arch/arm/boot/dts/overlays/hifiberry-digi-pro-overlay.dts
|
|
||||||
# changes:
|
|
||||||
# - modified top-level "compatible" field from bcm2835 to bcm2711
|
|
||||||
# - s/i2s_clk_consumer/i2s/ (name on bcm2711 platform)
|
|
||||||
name = "hifiberry-digi-pro";
|
|
||||||
dtsText = ''
|
|
||||||
/dts-v1/;
|
|
||||||
/plugin/;
|
|
||||||
|
|
||||||
/ {
|
|
||||||
compatible = "brcm,bcm2711";
|
|
||||||
|
|
||||||
fragment@0 {
|
|
||||||
target = <&i2s>;
|
|
||||||
__overlay__ {
|
|
||||||
status = "okay";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
fragment@1 {
|
|
||||||
target = <&i2c1>;
|
|
||||||
__overlay__ {
|
|
||||||
#address-cells = <1>;
|
|
||||||
#size-cells = <0>;
|
|
||||||
status = "okay";
|
|
||||||
|
|
||||||
wm8804@3b {
|
|
||||||
#sound-dai-cells = <0>;
|
|
||||||
compatible = "wlf,wm8804";
|
|
||||||
reg = <0x3b>;
|
|
||||||
PVDD-supply = <&vdd_3v3_reg>;
|
|
||||||
DVDD-supply = <&vdd_3v3_reg>;
|
|
||||||
status = "okay";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
fragment@2 {
|
|
||||||
target = <&sound>;
|
|
||||||
__overlay__ {
|
|
||||||
compatible = "hifiberry,hifiberry-digi";
|
|
||||||
i2s-controller = <&i2s>;
|
|
||||||
status = "okay";
|
|
||||||
clock44-gpio = <&gpio 5 0>;
|
|
||||||
clock48-gpio = <&gpio 6 0>;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
firmware = with pkgs; [
|
firmware = with pkgs; [
|
||||||
@@ -80,12 +29,28 @@
|
|||||||
|
|
||||||
sound.enable = true;
|
sound.enable = true;
|
||||||
|
|
||||||
|
age.secrets."passwords/networks.age" = {
|
||||||
|
file = "${inputs.secrets}/passwords/networks.age";
|
||||||
|
};
|
||||||
|
|
||||||
|
networking = {
|
||||||
|
wireless = {
|
||||||
|
enable = true;
|
||||||
|
interfaces = [ "wlan0" ];
|
||||||
|
environmentFile = config.age.secrets."passwords/networks.age".path;
|
||||||
|
networks = {
|
||||||
|
"Apollo 600 Mbps".psk = "@PSK_APOLLO@";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
security.rtkit.enable = true;
|
security.rtkit.enable = true;
|
||||||
services.pipewire = {
|
services.pipewire = {
|
||||||
enable = true;
|
enable = true;
|
||||||
alsa.enable = true;
|
alsa.enable = true;
|
||||||
alsa.support32Bit = true;
|
alsa.support32Bit = true;
|
||||||
pulse.enable = true;
|
pulse.enable = true;
|
||||||
|
systemWide = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
virtualisation.oci-containers = {
|
virtualisation.oci-containers = {
|
||||||
@@ -135,7 +100,6 @@
|
|||||||
network_key = "!secret.yaml network_key";
|
network_key = "!secret.yaml network_key";
|
||||||
pan_id = 13001;
|
pan_id = 13001;
|
||||||
ext_pan_id = [ 79 1 73 47 250 136 124 222 ];
|
ext_pan_id = [ 79 1 73 47 250 136 124 222 ];
|
||||||
transmit_power = 20;
|
|
||||||
};
|
};
|
||||||
mqtt = {
|
mqtt = {
|
||||||
version = 5;
|
version = 5;
|
||||||
@@ -144,25 +108,35 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
modules = {
|
age.secrets."passwords/services/borg/pi-passphrase" = {
|
||||||
networking = {
|
file = "${inputs.secrets}/passwords/services/borg/pi-passphrase.age";
|
||||||
wireless = {
|
};
|
||||||
enable = true;
|
|
||||||
interfaces = [ "wlan0" ];
|
services.borgmatic = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
source_directories = [
|
||||||
|
"/var/lib/mosquitto"
|
||||||
|
"/var/lib/zigbee2mqtt"
|
||||||
|
];
|
||||||
|
repositories = [
|
||||||
|
{ label = "borgbase"; path = "ssh://qcw86s11@qcw86s11.repo.borgbase.com/./repo"; }
|
||||||
|
];
|
||||||
|
storage = {
|
||||||
|
encryption_passcommand = "cat ${config.age.secrets."passwords/services/borg/pi-passphrase".path}";
|
||||||
|
ssh_command = "ssh -i /etc/ssh/ssh_host_ed25519_key";
|
||||||
};
|
};
|
||||||
};
|
retention = {
|
||||||
services = {
|
keep_daily = 7;
|
||||||
borgmatic = {
|
keep_weekly = 4;
|
||||||
enable = true;
|
keep_monthly = 6;
|
||||||
directories = [
|
|
||||||
"/var/lib/mosquitto"
|
|
||||||
"/var/lib/zigbee2mqtt"
|
|
||||||
];
|
|
||||||
repoPath = "ssh://qcw86s11@qcw86s11.repo.borgbase.com/./repo";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Without this override, `cat` is unavailable for `encryption_passcommand`
|
||||||
|
systemd.services.borgmatic.confinement.fullUnit = true;
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
libraspberrypi
|
libraspberrypi
|
||||||
raspberrypi-eeprom
|
raspberrypi-eeprom
|
||||||
|
@@ -26,10 +26,8 @@
|
|||||||
./editors/neovim
|
./editors/neovim
|
||||||
./editors/vscode.nix
|
./editors/vscode.nix
|
||||||
./networking/tailscale.nix
|
./networking/tailscale.nix
|
||||||
./networking/wireless.nix
|
|
||||||
./security/gpg.nix
|
./security/gpg.nix
|
||||||
./security/pass.nix
|
./security/pass.nix
|
||||||
./services/borgmatic
|
|
||||||
./shell/git
|
./shell/git
|
||||||
./shell/zsh
|
./shell/zsh
|
||||||
];
|
];
|
||||||
|
@@ -131,7 +131,6 @@ in {
|
|||||||
};
|
};
|
||||||
"org/gnome/mutter" = {
|
"org/gnome/mutter" = {
|
||||||
center-new-windows = true;
|
center-new-windows = true;
|
||||||
edge-tiling = true;
|
|
||||||
experimental-features = [ "scale-monitor-framebuffer" ];
|
experimental-features = [ "scale-monitor-framebuffer" ];
|
||||||
};
|
};
|
||||||
"org/gnome/desktop/interface" = {
|
"org/gnome/desktop/interface" = {
|
||||||
|
@@ -1,36 +0,0 @@
|
|||||||
{ config, lib, pkgs, inputs, ... }:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
let cfg = config.modules.networking.wireless;
|
|
||||||
in {
|
|
||||||
options.modules.networking.wireless = {
|
|
||||||
enable = mkOption {
|
|
||||||
default = false;
|
|
||||||
example = true;
|
|
||||||
description = mdDoc "Automatically connect to known networks";
|
|
||||||
};
|
|
||||||
interfaces = mkOption {
|
|
||||||
default = [ ]; # All interfaces
|
|
||||||
example = [ "wlan0" ];
|
|
||||||
description = mdDoc "Interfaces for `wpa_supplicant` to bind to";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
age.secrets."passwords/networks" = {
|
|
||||||
file = "${inputs.secrets}/passwords/networks.age";
|
|
||||||
};
|
|
||||||
|
|
||||||
networking = {
|
|
||||||
wireless = {
|
|
||||||
enable = true;
|
|
||||||
interfaces = cfg.interfaces;
|
|
||||||
environmentFile = config.age.secrets."passwords/networks".path;
|
|
||||||
networks = {
|
|
||||||
"Apollo 600 Mbps".psk = "@PSK_APOLLO@";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@@ -1,57 +0,0 @@
|
|||||||
{ config, lib, pkgs, inputs, ... }:
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.modules.services.borgmatic;
|
|
||||||
hostname = config.networking.hostName;
|
|
||||||
in {
|
|
||||||
options.modules.services.borgmatic = {
|
|
||||||
enable = mkOption {
|
|
||||||
default = false;
|
|
||||||
example = true;
|
|
||||||
description = mdDoc "Enable backups on this host with `borgmatic`";
|
|
||||||
};
|
|
||||||
directories = mkOption {
|
|
||||||
type = types.listOf types.str;
|
|
||||||
default = [];
|
|
||||||
example = [
|
|
||||||
"/home/jordan/Documents"
|
|
||||||
];
|
|
||||||
description = mdDoc "List of directories to backup";
|
|
||||||
};
|
|
||||||
repoPath = mkOption {
|
|
||||||
type = types.str;
|
|
||||||
example = "ssh://example@example.repo.borgbase.com/./repo";
|
|
||||||
description = mdDoc "Destination borg repository for backup";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
age.secrets."passwords/services/borg/${hostname}-passphrase" = {
|
|
||||||
file = "${inputs.secrets}/passwords/services/borg/${hostname}-passphrase.age";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.borgmatic = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
source_directories = cfg.directories;
|
|
||||||
repositories = [
|
|
||||||
{ label = "borgbase"; path = cfg.repoPath; }
|
|
||||||
];
|
|
||||||
storage = {
|
|
||||||
encryption_passcommand = "cat ${config.age.secrets."passwords/services/borg/${hostname}-passphrase".path}";
|
|
||||||
ssh_command = "ssh -i /etc/ssh/ssh_host_ed25519_key";
|
|
||||||
};
|
|
||||||
retention = {
|
|
||||||
keep_daily = 7;
|
|
||||||
keep_weekly = 4;
|
|
||||||
keep_monthly = 6;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Without this override, `cat` is unavailable for `encryption_passcommand`
|
|
||||||
systemd.services.borgmatic.confinement.fullUnit = true;
|
|
||||||
};
|
|
||||||
}
|
|
Reference in New Issue
Block a user