Compare commits
1 Commits
c478bb0e90
...
vps1
Author | SHA1 | Date | |
---|---|---|---|
d73239251c
|
18
README.md
18
README.md
@@ -9,16 +9,8 @@ System and user configuration for NixOS-based systems.
|
|||||||
| **Theme:** | adwaita |
|
| **Theme:** | adwaita |
|
||||||
| **Terminal:** | Console |
|
| **Terminal:** | Console |
|
||||||
|
|
||||||
## Provisioning
|
## Quick start
|
||||||
> [nixos-anywhere](https://github.com/nix-community/nixos-anywhere) is the module used for provisioning
|
1. Copy SSH keypair and `known_hosts` to `~/.ssh`
|
||||||
|
1. Import GPG keys and set ultimate trust with `echo "KEYID:6:" | gpg --import-ownertrust`
|
||||||
Generate a new SSH host key in "$temp/etc/ssh" as per [this guide](https://nix-community.github.io/nixos-anywhere/howtos/secrets.html#example-decrypting-an-openssh-host-key-with-pass).
|
1. `git clone git@git.vimium.com:jordan/nix-config.git projects/jordan/nix-config`
|
||||||
|
1. `sudo nixos-rebuild switch --flake .#`
|
||||||
Then run;
|
|
||||||
```
|
|
||||||
nix run github:nix-community/nixos-anywhere -- \
|
|
||||||
--disk-encryption-keys /tmp/secret.key /tmp/secret.key \
|
|
||||||
--extra-files "$temp" \
|
|
||||||
--flake .#<hostname> \
|
|
||||||
root@<ip>
|
|
||||||
```
|
|
||||||
|
65
flake.lock
generated
65
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": {
|
||||||
@@ -50,11 +50,11 @@
|
|||||||
"utils": "utils"
|
"utils": "utils"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1704875591,
|
"lastModified": 1703087360,
|
||||||
"narHash": "sha256-eWRLbqRcrILgztU/m/k7CYLzETKNbv0OsT2GjkaNm8A=",
|
"narHash": "sha256-0VUbWBW8VyiDRuimMuLsEO4elGuUw/nc2WDeuO1eN1M=",
|
||||||
"owner": "serokell",
|
"owner": "serokell",
|
||||||
"repo": "deploy-rs",
|
"repo": "deploy-rs",
|
||||||
"rev": "1776009f1f3fb2b5d236b84d9815f2edee463a9b",
|
"rev": "b709d63debafce9f5645a5ba550c9e0983b3d1f7",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -63,34 +63,14 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"disko": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1705348229,
|
|
||||||
"narHash": "sha256-CssPema1sBxZkrT95KFuKCNNiqxNe1lnf2QNeXk88Xk=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "disko",
|
|
||||||
"rev": "d0b4408eaf782a1ada0a9133bb1cecefdd59c696",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "disko",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"firefox-gnome-theme": {
|
"firefox-gnome-theme": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1705281830,
|
"lastModified": 1703023593,
|
||||||
"narHash": "sha256-gpUrma8XjAnHULRmD5RRVVZJNvxFrIEyGQLx6oEE9D4=",
|
"narHash": "sha256-M+Cw6vh7xCDmIhyVuEPNmaNVUwpmdFQq8zlsXZTKees=",
|
||||||
"owner": "rafaelmardojai",
|
"owner": "rafaelmardojai",
|
||||||
"repo": "firefox-gnome-theme",
|
"repo": "firefox-gnome-theme",
|
||||||
"rev": "eb7c43d11abc157f97d032018115c9f7b04ca4de",
|
"rev": "bad853333d9021e7012adb9b8fbfe7a7003f26bc",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -143,11 +123,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1705273357,
|
"lastModified": 1703367386,
|
||||||
"narHash": "sha256-JAlkxgJbWh7+auiT0rJL3IUXXtkULRqygfxQA6mvLgc=",
|
"narHash": "sha256-FMbm48UGrBfOWGt8+opuS+uLBLQlRfhiYXhHNcYMS5k=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "924d91e1e4c802fd8e60279a022dbae5acb36f2d",
|
"rev": "d5824a76bc6bb93d1dce9ebbbcb09a9b6abcc224",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -159,11 +139,11 @@
|
|||||||
},
|
},
|
||||||
"nixos-hardware": {
|
"nixos-hardware": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1705312285,
|
"lastModified": 1702453208,
|
||||||
"narHash": "sha256-rd+dY+v61Y8w3u9bukO/hB55Xl4wXv4/yC8rCGVnK5U=",
|
"narHash": "sha256-0wRi9SposfE2wHqjuKt8WO2izKB/ASDOV91URunIqgo=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixos-hardware",
|
"repo": "nixos-hardware",
|
||||||
"rev": "bee2202bec57e521e3bd8acd526884b9767d7fa0",
|
"rev": "7763c6fd1f299cb9361ff2abf755ed9619ef01d6",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -206,11 +186,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
"nixpkgs_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1705331948,
|
"lastModified": 1703068421,
|
||||||
"narHash": "sha256-qjQXfvrAT1/RKDFAMdl8Hw3m4tLVvMCc8fMqzJv0pP4=",
|
"narHash": "sha256-WSw5Faqlw75McIflnl5v7qVD/B3S2sLh+968bpOGrWA=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "b8dd8be3c790215716e7c12b247f45ca525867e2",
|
"rev": "d65bceaee0fb1e64363f7871bc43dc1c6ecad99f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -223,7 +203,6 @@
|
|||||||
"inputs": {
|
"inputs": {
|
||||||
"agenix": "agenix",
|
"agenix": "agenix",
|
||||||
"deploy-rs": "deploy-rs",
|
"deploy-rs": "deploy-rs",
|
||||||
"disko": "disko",
|
|
||||||
"firefox-gnome-theme": "firefox-gnome-theme",
|
"firefox-gnome-theme": "firefox-gnome-theme",
|
||||||
"home-manager": "home-manager_2",
|
"home-manager": "home-manager_2",
|
||||||
"nixos-hardware": "nixos-hardware",
|
"nixos-hardware": "nixos-hardware",
|
||||||
@@ -235,11 +214,11 @@
|
|||||||
"secrets": {
|
"secrets": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1704547919,
|
"lastModified": 1702936962,
|
||||||
"narHash": "sha256-yc0l7p6bHjR6HD6N09U/G3igHUPDUnZyFliTw7XC3VA=",
|
"narHash": "sha256-uIZ2uPE26JKJ58463ejHMiAOpqBwflyN6tCmZ89vaSQ=",
|
||||||
"ref": "refs/heads/master",
|
"ref": "refs/heads/master",
|
||||||
"rev": "b11b903ed707826a756b7803633f4684a19e637d",
|
"rev": "c6db5c3ba8bff0e618fc3e31c9680863c5e53800",
|
||||||
"revCount": 11,
|
"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"
|
||||||
},
|
},
|
||||||
|
23
flake.nix
23
flake.nix
@@ -5,10 +5,6 @@
|
|||||||
nixpkgs.url = "nixpkgs/nixos-23.11";
|
nixpkgs.url = "nixpkgs/nixos-23.11";
|
||||||
agenix.url = "github:ryantm/agenix";
|
agenix.url = "github:ryantm/agenix";
|
||||||
deploy-rs.url = "github:serokell/deploy-rs";
|
deploy-rs.url = "github:serokell/deploy-rs";
|
||||||
disko = {
|
|
||||||
url = "github:nix-community/disko";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager/release-23.11";
|
url = "github:nix-community/home-manager/release-23.11";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
@@ -28,7 +24,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs @ { self, nixpkgs, agenix, deploy-rs, disko, home-manager, nixos-hardware, secrets, ... }:
|
outputs = inputs @ { self, nixpkgs, agenix, deploy-rs, home-manager, nixos-hardware, secrets, ... }:
|
||||||
let
|
let
|
||||||
nixpkgsForSystem = system: inputs.nixpkgs;
|
nixpkgsForSystem = system: inputs.nixpkgs;
|
||||||
overlays = [
|
overlays = [
|
||||||
@@ -37,7 +33,6 @@
|
|||||||
];
|
];
|
||||||
commonModules = [
|
commonModules = [
|
||||||
agenix.nixosModules.age
|
agenix.nixosModules.age
|
||||||
disko.nixosModules.disko
|
|
||||||
home-manager.nixosModule
|
home-manager.nixosModule
|
||||||
./modules
|
./modules
|
||||||
];
|
];
|
||||||
@@ -71,20 +66,30 @@
|
|||||||
atlas = nixosSystem { system = "x86_64-linux"; name = "atlas"; };
|
atlas = nixosSystem { system = "x86_64-linux"; name = "atlas"; };
|
||||||
eos = nixosSystem { system = "x86_64-linux"; name = "eos"; };
|
eos = nixosSystem { system = "x86_64-linux"; name = "eos"; };
|
||||||
helios = nixosSystem { system = "x86_64-linux"; name = "helios"; };
|
helios = nixosSystem { system = "x86_64-linux"; name = "helios"; };
|
||||||
hypnos = nixosSystem { system = "x86_64-linux"; name = "hypnos"; };
|
|
||||||
odyssey = nixosSystem { system = "x86_64-linux"; name = "odyssey"; };
|
odyssey = nixosSystem { system = "x86_64-linux"; name = "odyssey"; };
|
||||||
pi = nixosSystem { system = "aarch64-linux"; name = "pi"; extraModules = [ nixos-hardware.nixosModules.raspberry-pi-4 ]; };
|
pi = nixosSystem { system = "aarch64-linux"; name = "pi"; extraModules = [ nixos-hardware.nixosModules.raspberry-pi-4 ]; };
|
||||||
|
vps1 = nixosSystem { system = "x86_64-linux"; name = "vps1"; };
|
||||||
};
|
};
|
||||||
|
|
||||||
deploy.nodes.pi = {
|
deploy.nodes = {
|
||||||
|
pi = {
|
||||||
hostname = "10.0.1.191";
|
hostname = "10.0.1.191";
|
||||||
sshUser = "root";
|
sshUser = "jordan";
|
||||||
|
user = "root";
|
||||||
|
|
||||||
profiles.system = {
|
profiles.system = {
|
||||||
user = "root";
|
user = "root";
|
||||||
path = deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.pi;
|
path = deploy-rs.lib.aarch64-linux.activate.nixos self.nixosConfigurations.pi;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
vps1 = {
|
||||||
|
magicRollback = true;
|
||||||
|
autoRollback = true;
|
||||||
|
hostname = "vps1.mesh.vimium.net";
|
||||||
|
profiles.system = {
|
||||||
|
user = "root";
|
||||||
|
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.vps1;
|
||||||
|
};
|
||||||
|
|
||||||
# checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
|
# checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
|
||||||
};
|
};
|
||||||
|
@@ -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/sda1` (EFI, 256 MiB, NixOS Boot) <br> `/dev/sda2` (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,50 +0,0 @@
|
|||||||
{ config, lib, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
./hardware-configuration.nix
|
|
||||||
./disko-config.nix
|
|
||||||
../desktop.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.loader = {
|
|
||||||
systemd-boot.enable = true;
|
|
||||||
efi.canTouchEfiVariables = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
networking = {
|
|
||||||
hostName = "hypnos";
|
|
||||||
hostId = "cf791898";
|
|
||||||
};
|
|
||||||
|
|
||||||
nix = {
|
|
||||||
package = pkgs.nixFlakes;
|
|
||||||
extraOptions = ''
|
|
||||||
experimental-features = nix-command flakes
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
modules = {
|
|
||||||
desktop = {
|
|
||||||
browsers = {
|
|
||||||
firefox.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
dev = {
|
|
||||||
node.enable = true;
|
|
||||||
};
|
|
||||||
editors = {
|
|
||||||
neovim.enable = true;
|
|
||||||
};
|
|
||||||
security = {
|
|
||||||
gpg.enable = true;
|
|
||||||
pass.enable = true;
|
|
||||||
};
|
|
||||||
shell = {
|
|
||||||
git.enable = true;
|
|
||||||
zsh.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
system.stateVersion = "22.11";
|
|
||||||
}
|
|
@@ -1,126 +0,0 @@
|
|||||||
{ lib, ... }:
|
|
||||||
{
|
|
||||||
disko.devices = {
|
|
||||||
disk = {
|
|
||||||
main = {
|
|
||||||
type = "disk";
|
|
||||||
device = "/dev/disk/by-id/ata-APPLE_SSD_SM0512F_S1K5NYBF736152";
|
|
||||||
content = {
|
|
||||||
type = "gpt";
|
|
||||||
partitions = {
|
|
||||||
ESP = {
|
|
||||||
size = "256M";
|
|
||||||
type = "EF00";
|
|
||||||
content = {
|
|
||||||
type = "filesystem";
|
|
||||||
format = "vfat";
|
|
||||||
mountpoint = "/boot";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
zfs = {
|
|
||||||
size = "100%";
|
|
||||||
content = {
|
|
||||||
type = "zfs";
|
|
||||||
pool = "rpool";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
zpool = {
|
|
||||||
rpool = {
|
|
||||||
type = "zpool";
|
|
||||||
options = {
|
|
||||||
ashift = "12";
|
|
||||||
};
|
|
||||||
rootFsOptions = {
|
|
||||||
canmount = "off";
|
|
||||||
mountpoint = "none";
|
|
||||||
dnodesize = "auto";
|
|
||||||
xattr = "sa";
|
|
||||||
};
|
|
||||||
postCreateHook = "zfs snapshot rpool@blank";
|
|
||||||
datasets = {
|
|
||||||
local = {
|
|
||||||
type = "zfs_fs";
|
|
||||||
options = {
|
|
||||||
mountpoint = "none";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
"local/nix" = {
|
|
||||||
type = "zfs_fs";
|
|
||||||
mountpoint = "/nix";
|
|
||||||
options = {
|
|
||||||
atime = "off";
|
|
||||||
mountpoint = "legacy";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
"local/tmp" = {
|
|
||||||
type = "zfs_fs";
|
|
||||||
mountpoint = "/tmp";
|
|
||||||
options = {
|
|
||||||
setuid = "off";
|
|
||||||
devices = "off";
|
|
||||||
mountpoint = "legacy";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
system = {
|
|
||||||
type = "zfs_fs";
|
|
||||||
mountpoint = "/";
|
|
||||||
options = {
|
|
||||||
mountpoint = "legacy";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
"system/var" = {
|
|
||||||
type = "zfs_fs";
|
|
||||||
mountpoint = "/var";
|
|
||||||
options = {
|
|
||||||
mountpoint = "legacy";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
"system/var/tmp" = {
|
|
||||||
type = "zfs_fs";
|
|
||||||
mountpoint = "/var/tmp";
|
|
||||||
options = {
|
|
||||||
devices = "off";
|
|
||||||
mountpoint = "legacy";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
"system/var/log" = {
|
|
||||||
type = "zfs_fs";
|
|
||||||
mountpoint = "/var/log";
|
|
||||||
options = {
|
|
||||||
compression = "on";
|
|
||||||
acltype = "posix";
|
|
||||||
mountpoint = "legacy";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
user = {
|
|
||||||
type = "zfs_fs";
|
|
||||||
options = {
|
|
||||||
mountpoint = "none";
|
|
||||||
encryption = "aes-256-gcm";
|
|
||||||
keyformat = "passphrase";
|
|
||||||
keylocation = "file:///tmp/secret.key";
|
|
||||||
};
|
|
||||||
# use this to read the key during boot
|
|
||||||
postCreateHook = ''
|
|
||||||
zfs set keylocation="prompt" "rpool/$name";
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
"user/home" = {
|
|
||||||
type = "zfs_fs";
|
|
||||||
mountpoint = "/home";
|
|
||||||
options = {
|
|
||||||
setuid = "off";
|
|
||||||
devices = "off";
|
|
||||||
mountpoint = "legacy";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@@ -1,21 +0,0 @@
|
|||||||
{ config, lib, pkgs, modulesPath, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
(modulesPath + "/installer/scan/not-detected.nix")
|
|
||||||
];
|
|
||||||
|
|
||||||
boot = {
|
|
||||||
initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
|
|
||||||
initrd.kernelModules = [ ];
|
|
||||||
kernelModules = [ "applesmc" "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;
|
|
||||||
}
|
|
||||||
|
|
@@ -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;
|
||||||
@@ -59,12 +87,8 @@
|
|||||||
firefox.enable = true;
|
firefox.enable = true;
|
||||||
};
|
};
|
||||||
gaming.emulators = {
|
gaming.emulators = {
|
||||||
gamecube.enable = true;
|
|
||||||
ps2.enable = true;
|
ps2.enable = true;
|
||||||
ps3.enable = true;
|
|
||||||
psp.enable = true;
|
psp.enable = true;
|
||||||
wii.enable = true;
|
|
||||||
xbox.enable = true;
|
|
||||||
};
|
};
|
||||||
media.graphics = {
|
media.graphics = {
|
||||||
modeling.enable = true;
|
modeling.enable = true;
|
||||||
@@ -87,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,78 +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"; }
|
||||||
name = "audio-off-overlay";
|
|
||||||
dtsText = ''
|
|
||||||
/dts-v1/;
|
|
||||||
/plugin/;
|
|
||||||
|
|
||||||
/ {
|
|
||||||
compatible = "brcm,bcm2711";
|
|
||||||
|
|
||||||
fragment@0 {
|
|
||||||
target = <&vchiq>;
|
|
||||||
|
|
||||||
__overlay__ {
|
|
||||||
status = "disabled";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
{
|
|
||||||
# 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; [
|
||||||
@@ -99,72 +29,46 @@
|
|||||||
|
|
||||||
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;
|
||||||
};
|
};
|
||||||
|
|
||||||
age.secrets."files/services/home-assistant/secrets.yaml" = {
|
virtualisation.oci-containers = {
|
||||||
file = "${inputs.secrets}/files/services/home-assistant/secrets.yaml.age";
|
backend = "podman";
|
||||||
path = "${config.services.home-assistant.configDir}/secrets.yaml";
|
containers.homeassistant = {
|
||||||
owner = "hass";
|
volumes = [ "home-assistant:/config" ];
|
||||||
group = "hass";
|
environment.TZ = config.time.timeZone;
|
||||||
};
|
image = "ghcr.io/home-assistant/home-assistant:stable";
|
||||||
|
extraOptions = [
|
||||||
services.home-assistant = {
|
"--network=host"
|
||||||
enable = true;
|
"--device=/dev/ttyUSB0:/dev/ttyUSB0"
|
||||||
extraComponents = [
|
|
||||||
"api"
|
|
||||||
"alert"
|
|
||||||
"auth"
|
|
||||||
"backup"
|
|
||||||
"command_line"
|
|
||||||
"default_config"
|
|
||||||
"homekit_controller"
|
|
||||||
"homekit"
|
|
||||||
"http"
|
|
||||||
"icloud"
|
|
||||||
"jellyfin"
|
|
||||||
"metoffice"
|
|
||||||
"mqtt"
|
|
||||||
"onkyo"
|
|
||||||
"ping"
|
|
||||||
"proximity"
|
|
||||||
"radio_browser"
|
|
||||||
"scrape"
|
|
||||||
"sensor"
|
|
||||||
"system_health"
|
|
||||||
];
|
];
|
||||||
config = {
|
|
||||||
default_config = {};
|
|
||||||
backup = {};
|
|
||||||
homeassistant = {
|
|
||||||
name = "Home";
|
|
||||||
latitude = "!secret latitude";
|
|
||||||
longitude = "!secret longitude";
|
|
||||||
country = "GB";
|
|
||||||
temperature_unit = "C";
|
|
||||||
time_zone = config.time.timeZone;
|
|
||||||
unit_system = "metric";
|
|
||||||
};
|
|
||||||
mqtt = { };
|
|
||||||
scene = "!include scenes.yaml";
|
|
||||||
automation = "!include automations.yaml";
|
|
||||||
system_health = { };
|
|
||||||
recorder = {
|
|
||||||
purge_keep_days = 365;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.mosquitto = {
|
services.mosquitto = {
|
||||||
enable = true;
|
enable = true;
|
||||||
listeners = [{
|
listeners = [{
|
||||||
acl = [ "pattern readwrite #" ];
|
|
||||||
omitPasswordAuth = true;
|
|
||||||
port = 1883;
|
port = 1883;
|
||||||
settings = {
|
settings = {
|
||||||
allow_anonymous = true;
|
allow_anonymous = true;
|
||||||
@@ -183,13 +87,7 @@
|
|||||||
enable = true;
|
enable = true;
|
||||||
dataDir = "/var/lib/zigbee2mqtt";
|
dataDir = "/var/lib/zigbee2mqtt";
|
||||||
settings = {
|
settings = {
|
||||||
homeassistant = lib.optionalAttrs config.services.home-assistant.enable {
|
homeassistant = true;
|
||||||
discovery_topic = "homeassistant";
|
|
||||||
status_topic = "hass/status";
|
|
||||||
legacy_entity_attributes = true;
|
|
||||||
legacy_triggers = true;
|
|
||||||
};
|
|
||||||
availability = true;
|
|
||||||
frontend = true;
|
frontend = true;
|
||||||
device_options = {
|
device_options = {
|
||||||
retain = true;
|
retain = true;
|
||||||
@@ -202,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;
|
||||||
@@ -211,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 = {
|
services.borgmatic = {
|
||||||
borgmatic = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
directories = [
|
settings = {
|
||||||
|
source_directories = [
|
||||||
"/var/lib/mosquitto"
|
"/var/lib/mosquitto"
|
||||||
"/var/lib/zigbee2mqtt"
|
"/var/lib/zigbee2mqtt"
|
||||||
];
|
];
|
||||||
repoPath = "ssh://qcw86s11@qcw86s11.repo.borgbase.com/./repo";
|
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 = {
|
||||||
|
keep_daily = 7;
|
||||||
|
keep_weekly = 4;
|
||||||
|
keep_monthly = 6;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# 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
|
||||||
|
17
hosts/vps1/README.md
Normal file
17
hosts/vps1/README.md
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# vps1
|
||||||
|
|
||||||
|
## Overview
|
||||||
|
VPS hosted in OVH.
|
||||||
|
|
||||||
|
## Specs
|
||||||
|
* CPU - ??
|
||||||
|
* Memory - ??
|
||||||
|
|
||||||
|
### Disks
|
||||||
|
Device | Partitions _(filesystem, usage)_
|
||||||
|
--- | ---
|
||||||
|
NVMe | `/dev/sda1` (ext4, NixOS Root)
|
||||||
|
|
||||||
|
### Networks
|
||||||
|
- DHCP on `10.0.1.0/24` subnet.
|
||||||
|
- Tailscale on `100.64.0.0/10` subnet. FQDN: `vps1.mesh.vimium.net`.
|
195
hosts/vps1/default.nix
Normal file
195
hosts/vps1/default.nix
Normal file
@@ -0,0 +1,195 @@
|
|||||||
|
{ config, lib, pkgs, inputs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./hardware-configuration.nix
|
||||||
|
../server.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
networking = {
|
||||||
|
hostId = "???";
|
||||||
|
hostName = "vps1";
|
||||||
|
domain = "mesh.vimium.net";
|
||||||
|
firewall = {
|
||||||
|
enable = true;
|
||||||
|
allowedTCPPorts = [
|
||||||
|
22 # SSH
|
||||||
|
8448 # Matrix federation
|
||||||
|
80 # HTTP
|
||||||
|
443 # HTTPS
|
||||||
|
5349 # STUN TLS
|
||||||
|
5350 # STUN TLS alt
|
||||||
|
];
|
||||||
|
allowedUDPPortRanges = [
|
||||||
|
{ from = 49152; to = 49999; } # TURN relay
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
users.users = {
|
||||||
|
git = {
|
||||||
|
isSystemUser = true;
|
||||||
|
useDefaultShell = true;
|
||||||
|
group = "git";
|
||||||
|
extraGroups = [ "gitea" ];
|
||||||
|
home = config.services.gitea.stateDir;
|
||||||
|
};
|
||||||
|
jellyfin = {
|
||||||
|
isSystemUser = true;
|
||||||
|
group = "jellyfin";
|
||||||
|
shell = "/bin/sh";
|
||||||
|
openssh.authorizedKeys.keys = [
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOaaS+KMAEAymZhIJGC4LK8aMhUzhpmloUgvP2cxeBH4 jellyfin"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
root = {
|
||||||
|
openssh.authorizedKeys.keys = [
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILVHTjsyMIV4THNw6yz0OxAxGnC+41gX72UrPqTzR+OS jordan@vimium.com"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
users.groups = {
|
||||||
|
git = { };
|
||||||
|
jellyfin = { };
|
||||||
|
};
|
||||||
|
|
||||||
|
age.secrets."passwords/services/borg/vps1-passphrase" = {
|
||||||
|
file = "${inputs.secrets}/passwords/services/borg/vps1-passphrase.age";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.borgmatic = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
source_directories = [
|
||||||
|
"/home"
|
||||||
|
"/var/lib"
|
||||||
|
"/var/www"
|
||||||
|
];
|
||||||
|
repositories = [
|
||||||
|
{ label = "borgbase"; path = "ssh://p91y8oh7@p91y8oh7.repo.borgbase.com/./repo"; }
|
||||||
|
];
|
||||||
|
storage = {
|
||||||
|
encryption_passcommand = "cat ${config.age.secrets."passwords/services/borg/vps1-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;
|
||||||
|
|
||||||
|
age.secrets."passwords/services/coturn/shared-secret" = {
|
||||||
|
file = "${inputs.secrets}/passwords/services/coturn/shared-secret.age";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.coturn = {
|
||||||
|
enable = true;
|
||||||
|
lt-cred-mech = true;
|
||||||
|
use-auth-secret = true;
|
||||||
|
static-auth-secret = "???";
|
||||||
|
realm = "turn.vimium.com";
|
||||||
|
relay-ips = [
|
||||||
|
"198.244.190.160"
|
||||||
|
];
|
||||||
|
no-tcp-relay = true;
|
||||||
|
extraConfig = ''
|
||||||
|
cipher-list="HIGH"
|
||||||
|
no-loopback-peers
|
||||||
|
no-multicast-peers
|
||||||
|
'';
|
||||||
|
secure-stun = true;
|
||||||
|
cert = "/var/lib/acme/turn.vimium.com/fullchain.pem";
|
||||||
|
pkey = "/var/lib/acme/turn.vimium.com/key.pem";
|
||||||
|
min-port = 49152;
|
||||||
|
max-port = 49999;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.gitea = rec {
|
||||||
|
package = pkgs.gitea;
|
||||||
|
enable = true;
|
||||||
|
user = "git";
|
||||||
|
appName = "Vimium Git";
|
||||||
|
stateDir = "/var/lib/gitea";
|
||||||
|
repositoryRoot = "${stateDir}/repositories";
|
||||||
|
database = {
|
||||||
|
type = "sqlite3";
|
||||||
|
inherit user;
|
||||||
|
path = "${stateDir}/gitea.db";
|
||||||
|
};
|
||||||
|
lfs = {
|
||||||
|
enable = true;
|
||||||
|
contentDir = "${stateDir}/lfs";
|
||||||
|
};
|
||||||
|
settings = {
|
||||||
|
server = {
|
||||||
|
SSH_USER = "git";
|
||||||
|
SSH_DOMAIN = "git.vimium.com";
|
||||||
|
SSH_PORT = lib.head config.services.openssh.ports;
|
||||||
|
OFFLINE_MODE = true;
|
||||||
|
PROTOCOL = "http+unix";
|
||||||
|
DOMAIN = config.networking.domain;
|
||||||
|
ROOT_URL = "https://git.vimium.com/";
|
||||||
|
};
|
||||||
|
service.DISABLE_REGISTRATION = true;
|
||||||
|
session.COOKIE_SECURE = true;
|
||||||
|
log.ROOT_PATH = "${stateDir}/log";
|
||||||
|
ui = {
|
||||||
|
THEMES = "gitea,arc-green,github-dark,bthree-dark";
|
||||||
|
DEFAULT_THEME = "github-dark";
|
||||||
|
};
|
||||||
|
actions.ENABLED = true;
|
||||||
|
indexer = {
|
||||||
|
REPO_INDEXER_ENABLED = true;
|
||||||
|
};
|
||||||
|
packages.CHUNKED_UPLOAD_PATH = lib.mkForce "${stateDir}/data/tmp/package-upload";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.headscale = {
|
||||||
|
enable = true;
|
||||||
|
port = 8080;
|
||||||
|
settings = {
|
||||||
|
server_url = "https://headscale.vimium.net";
|
||||||
|
dns_config = {
|
||||||
|
base_domain = "vimium.net";
|
||||||
|
};
|
||||||
|
logtail.enabled = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.matrix-synapse = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
database.name = "sqlite3";
|
||||||
|
enable_registration = false;
|
||||||
|
server_name = "vimium.com";
|
||||||
|
turn_shared_secret = "???";
|
||||||
|
turn_uris = [
|
||||||
|
"turn:turn.vimium.com:5349?transport=udp"
|
||||||
|
"turn:turn.vimium.com:5350?transport=udp"
|
||||||
|
"turn:turn.vimium.com:5349?transport=tcp"
|
||||||
|
"turn:turn.vimium.com:5350?transport=tcp"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.tailscale.enable = true;
|
||||||
|
networking.firewall = {
|
||||||
|
checkReversePath = "loose";
|
||||||
|
trustedInterfaces = [ "tailscale0" ];
|
||||||
|
allowedUDPPorts = [ config.services.tailscale.port ];
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
config.services.headscale.package
|
||||||
|
];
|
||||||
|
|
||||||
|
system.stateVersion = "22.11";
|
||||||
|
}
|
||||||
|
|
26
hosts/vps1/hardware-configuration.nix
Normal file
26
hosts/vps1/hardware-configuration.nix
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
(modulesPath + "/profiles/qemu-guest.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot = {
|
||||||
|
initrd = {
|
||||||
|
availableKernelModules = [ "ata_piix" "uhci_hcd" "xen_blkfront" "vmw_pvscsi" ];
|
||||||
|
kernelModules = [ "nvme" ];
|
||||||
|
};
|
||||||
|
loader.grub.device = "/dev/sda";
|
||||||
|
tmp.cleanOnBoot = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
zramSwap.enable = true;
|
||||||
|
|
||||||
|
fileSystems = {
|
||||||
|
"/" = {
|
||||||
|
device = "/dev/sda1";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@@ -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
|
||||||
];
|
];
|
||||||
|
@@ -19,10 +19,6 @@ in {
|
|||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
};
|
};
|
||||||
ps1.enable = lib.mkOption {
|
|
||||||
default = false;
|
|
||||||
example = true;
|
|
||||||
};
|
|
||||||
ps2.enable = lib.mkOption {
|
ps2.enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
@@ -39,23 +35,14 @@ in {
|
|||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
};
|
};
|
||||||
switch.enable = lib.mkOption {
|
|
||||||
default = false;
|
|
||||||
example = true;
|
|
||||||
};
|
|
||||||
wii.enable = lib.mkOption {
|
wii.enable = lib.mkOption {
|
||||||
default = false;
|
default = false;
|
||||||
example = true;
|
example = true;
|
||||||
};
|
};
|
||||||
xbox.enable = lib.mkOption {
|
|
||||||
default = false;
|
|
||||||
example = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
user.packages = with pkgs; [
|
user.packages = with pkgs; [
|
||||||
(lib.mkIf cfg.ps1.enable duckstation)
|
|
||||||
(lib.mkIf cfg.ps2.enable pcsx2)
|
(lib.mkIf cfg.ps2.enable pcsx2)
|
||||||
(lib.mkIf cfg.ps3.enable rpcs3)
|
(lib.mkIf cfg.ps3.enable rpcs3)
|
||||||
(lib.mkIf cfg.psp.enable ppsspp)
|
(lib.mkIf cfg.psp.enable ppsspp)
|
||||||
@@ -64,11 +51,9 @@ in {
|
|||||||
cfg.gb.enable ||
|
cfg.gb.enable ||
|
||||||
cfg.snes.enable)
|
cfg.snes.enable)
|
||||||
higan)
|
higan)
|
||||||
(lib.mkIf cfg.switch.enable yuzu-early-access)
|
|
||||||
(lib.mkIf (cfg.wii.enable ||
|
(lib.mkIf (cfg.wii.enable ||
|
||||||
cfg.gamecube.enable)
|
cfg.gamecube.enable)
|
||||||
dolphin-emu)
|
dolphin-emu)
|
||||||
(lib.mkIf cfg.xbox.enable xemu)
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@@ -17,7 +17,6 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
services.flatpak.enable = true;
|
services.flatpak.enable = true;
|
||||||
services.fwupd.enable = true;
|
|
||||||
|
|
||||||
programs.dconf.enable = true;
|
programs.dconf.enable = true;
|
||||||
dconf.settings = {
|
dconf.settings = {
|
||||||
@@ -103,9 +102,6 @@ in {
|
|||||||
picture-uri = "file://${pkgs.gnome.gnome-backgrounds}/share/backgrounds/gnome/adwaita-l.jpg";
|
picture-uri = "file://${pkgs.gnome.gnome-backgrounds}/share/backgrounds/gnome/adwaita-l.jpg";
|
||||||
picture-uri-dark = "file://${pkgs.gnome.gnome-backgrounds}/share/backgrounds/gnome/adwaita-d.jpg";
|
picture-uri-dark = "file://${pkgs.gnome.gnome-backgrounds}/share/backgrounds/gnome/adwaita-d.jpg";
|
||||||
};
|
};
|
||||||
"org/gnome/desktop/peripherals/touchpad" = {
|
|
||||||
tap-to-click = true;
|
|
||||||
};
|
|
||||||
"org/gtk/settings/file-chooser" = {
|
"org/gtk/settings/file-chooser" = {
|
||||||
show-hidden = true;
|
show-hidden = true;
|
||||||
sort-directories-first = true;
|
sort-directories-first = true;
|
||||||
@@ -135,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" = {
|
||||||
@@ -158,25 +153,9 @@ in {
|
|||||||
];
|
];
|
||||||
|
|
||||||
user.packages = with pkgs; [
|
user.packages = with pkgs; [
|
||||||
authenticator
|
|
||||||
bottles
|
|
||||||
bustle
|
|
||||||
celluloid
|
celluloid
|
||||||
d-spy
|
|
||||||
drawing
|
|
||||||
fragments
|
fragments
|
||||||
gnome.ghex
|
|
||||||
# gnome-builder
|
|
||||||
gnome-decoder
|
|
||||||
gnome-firmware
|
|
||||||
gnome-frog
|
|
||||||
gnome-obfuscate
|
|
||||||
gnome-podcasts
|
|
||||||
identity
|
|
||||||
mission-center
|
mission-center
|
||||||
newsflash
|
|
||||||
schemes
|
|
||||||
shortwave
|
|
||||||
];
|
];
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
|
@@ -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