mirror of
https://github.com/RichieCahill/dotfiles.git
synced 2026-04-21 14:49:10 -04:00
Compare commits
4 Commits
feature/de
...
feature/cr
| Author | SHA1 | Date | |
|---|---|---|---|
| d2bd57aa16 | |||
| 698f571961 | |||
| 11a84e06e8 | |||
| 43b582fb33 |
17
.github/workflows/build_systems copy.yml
vendored
Normal file
17
.github/workflows/build_systems copy.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
name: build_systems
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
schedule:
|
||||||
|
- cron: "0 0 1 * *"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: build-installer-iso
|
||||||
|
runs-on: self-hosted
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Build default package
|
||||||
|
run: "nix build .#nixosConfigurations.installer.config.system.build.isoImage"
|
||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -165,3 +165,6 @@ test.*
|
|||||||
|
|
||||||
# syncthing
|
# syncthing
|
||||||
.stfolder
|
.stfolder
|
||||||
|
|
||||||
|
# nixos build results
|
||||||
|
result
|
||||||
|
|||||||
6
.vscode/settings.json
vendored
6
.vscode/settings.json
vendored
@@ -51,7 +51,6 @@
|
|||||||
"cryptsetup",
|
"cryptsetup",
|
||||||
"cuda",
|
"cuda",
|
||||||
"darkreader",
|
"darkreader",
|
||||||
"datagrip",
|
|
||||||
"datareporting",
|
"datareporting",
|
||||||
"davidanson",
|
"davidanson",
|
||||||
"dconf",
|
"dconf",
|
||||||
@@ -145,7 +144,6 @@
|
|||||||
"maxtime",
|
"maxtime",
|
||||||
"mechatroner",
|
"mechatroner",
|
||||||
"mediainfo",
|
"mediainfo",
|
||||||
"mixtral",
|
|
||||||
"mklabel",
|
"mklabel",
|
||||||
"mkpart",
|
"mkpart",
|
||||||
"modesetting",
|
"modesetting",
|
||||||
@@ -176,9 +174,7 @@
|
|||||||
"OCSP",
|
"OCSP",
|
||||||
"oderwat",
|
"oderwat",
|
||||||
"ollama",
|
"ollama",
|
||||||
"ondemand",
|
|
||||||
"oneshot",
|
"oneshot",
|
||||||
"openwakeword",
|
|
||||||
"optimise",
|
"optimise",
|
||||||
"optoutstudies",
|
"optoutstudies",
|
||||||
"overalljails",
|
"overalljails",
|
||||||
@@ -197,7 +193,6 @@
|
|||||||
"plugdev",
|
"plugdev",
|
||||||
"poppler",
|
"poppler",
|
||||||
"posixacl",
|
"posixacl",
|
||||||
"powertop",
|
|
||||||
"primarycache",
|
"primarycache",
|
||||||
"prismlauncher",
|
"prismlauncher",
|
||||||
"privatebrowsing",
|
"privatebrowsing",
|
||||||
@@ -268,6 +263,7 @@
|
|||||||
"Tmpfs",
|
"Tmpfs",
|
||||||
"topsites",
|
"topsites",
|
||||||
"topstories",
|
"topstories",
|
||||||
|
"torrenting",
|
||||||
"treefmt",
|
"treefmt",
|
||||||
"twimg",
|
"twimg",
|
||||||
"uaccess",
|
"uaccess",
|
||||||
|
|||||||
@@ -52,8 +52,6 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
powerManagement.powertop.enable = lib.mkDefault true;
|
|
||||||
|
|
||||||
programs.zsh.enable = true;
|
programs.zsh.enable = true;
|
||||||
|
|
||||||
security.auditd.enable = lib.mkDefault true;
|
security.auditd.enable = lib.mkDefault true;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
boot = {
|
boot = {
|
||||||
kernelPackages = pkgs.linuxPackages_6_13;
|
kernelPackages = pkgs.linuxPackages_6_12;
|
||||||
zfs.package = pkgs.zfs_2_3;
|
zfs.package = pkgs.zfs_2_3;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
{ config, ... }:
|
{ config, ... }:
|
||||||
{
|
{
|
||||||
nixpkgs.config.cudaSupport = true;
|
|
||||||
|
|
||||||
services.xserver.videoDrivers = [ "nvidia" ];
|
services.xserver.videoDrivers = [ "nvidia" ];
|
||||||
hardware = {
|
hardware = {
|
||||||
nvidia = {
|
nvidia = {
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
{ lib, ... }:
|
|
||||||
{
|
{
|
||||||
services.syncthing = {
|
services.syncthing = {
|
||||||
enable = true;
|
enable = true;
|
||||||
user = "richie";
|
user = "richie";
|
||||||
overrideDevices = true;
|
overrideDevices = true;
|
||||||
overrideFolders = lib.mkDefault true;
|
overrideFolders = true;
|
||||||
dataDir = "/home/richie/Syncthing";
|
dataDir = "/home/richie/Syncthing";
|
||||||
configDir = "/home/richie/.config/syncthing";
|
configDir = "/home/richie/.config/syncthing";
|
||||||
settings.devices = {
|
settings.devices = {
|
||||||
phone.id = "TBRULKD-7DZPGGZ-F6LLB7J-MSO54AY-7KLPBIN-QOFK6PX-W2HBEWI-PHM2CQI"; # cspell:disable-line
|
phone.id = "LTGPLAE-M4ZDJTM-TZ3DJGY-SLLAVWF-CQDVEVS-RGCS75T-GAPZYK3-KUM6LA5"; # cspell:disable-line
|
||||||
jeeves.id = "ICRHXZW-ECYJCUZ-I4CZ64R-3XRK7CG-LL2HAAK-FGOHD22-BQA4AI6-5OAL6AG"; # cspell:disable-line
|
jeeves.id = "ICRHXZW-ECYJCUZ-I4CZ64R-3XRK7CG-LL2HAAK-FGOHD22-BQA4AI6-5OAL6AG"; # cspell:disable-line
|
||||||
ipad.id = "KI76T3X-SFUGV2L-VSNYTKR-TSIUV5L-SHWD3HE-GQRGRCN-GY4UFMD-CW6Z6AX"; # cspell:disable-line
|
ipad.id = "KI76T3X-SFUGV2L-VSNYTKR-TSIUV5L-SHWD3HE-GQRGRCN-GY4UFMD-CW6Z6AX"; # cspell:disable-line
|
||||||
bob.id = "CJIAPEJ-VO74RR4-F75VU6M-QNZAMYG-FYUJG7Y-6AT62HJ-355PRPL-PJFETAZ"; # cspell:disable-line
|
bob.id = "CJIAPEJ-VO74RR4-F75VU6M-QNZAMYG-FYUJG7Y-6AT62HJ-355PRPL-PJFETAZ"; # cspell:disable-line
|
||||||
|
|||||||
42
flake.lock
generated
42
flake.lock
generated
@@ -9,11 +9,11 @@
|
|||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"dir": "pkgs/firefox-addons",
|
"dir": "pkgs/firefox-addons",
|
||||||
"lastModified": 1743119709,
|
"lastModified": 1739396257,
|
||||||
"narHash": "sha256-tlJY7MfAena/yi3lmd7y7vQGpLma4Q1BLtO4dvzF/Vs=",
|
"narHash": "sha256-E+xGh25fyBLNo2FYxP4uHkTh4yh1C0AIyYpcVdW3CL0=",
|
||||||
"owner": "rycee",
|
"owner": "rycee",
|
||||||
"repo": "nur-expressions",
|
"repo": "nur-expressions",
|
||||||
"rev": "f8861a4b09a181dd88f6626d0202d9225ae85d65",
|
"rev": "f61927ae7c2b28ee9d426114a06f185f4dea4301",
|
||||||
"type": "gitlab"
|
"type": "gitlab"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -63,11 +63,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1743267068,
|
"lastModified": 1739381933,
|
||||||
"narHash": "sha256-G7866vbO5jgqMcYJzgbxej40O6mBGQMGt6gM0himjoA=",
|
"narHash": "sha256-4gvobxITgcrNGfwsVG5a46QzQCX89btIYw23p0ilbcc=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "b431496538b0e294fbe44a1441b24ae8195c63f0",
|
"rev": "15b59d4191b993ebdfcb1f61b834fced217882ba",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -100,11 +100,11 @@
|
|||||||
},
|
},
|
||||||
"nixos-hardware": {
|
"nixos-hardware": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1743167577,
|
"lastModified": 1738816619,
|
||||||
"narHash": "sha256-I09SrXIO0UdyBFfh0fxDq5WnCDg8XKmZ1HQbaXzMA1k=",
|
"narHash": "sha256-5yRlg48XmpcX5b5HesdGMOte+YuCy9rzQkJz+imcu6I=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixos-hardware",
|
"repo": "nixos-hardware",
|
||||||
"rev": "0ed819e708af17bfc4bbc63ee080ef308a24aa42",
|
"rev": "2eccff41bab80839b1d25b303b53d339fbb07087",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -116,11 +116,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1743095683,
|
"lastModified": 1739214665,
|
||||||
"narHash": "sha256-gWd4urRoLRe8GLVC/3rYRae1h+xfQzt09xOfb0PaHSk=",
|
"narHash": "sha256-26L8VAu3/1YRxS8MHgBOyOM8xALdo6N0I04PgorE7UM=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "5e5402ecbcb27af32284d4a62553c019a3a49ea6",
|
"rev": "64e75cd44acf21c7933d61d7721e812eac1b5a0a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -132,11 +132,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs-master": {
|
"nixpkgs-master": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1743293199,
|
"lastModified": 1739399097,
|
||||||
"narHash": "sha256-UTEKMh3sbRHVr6ZYIoM7NWQjfrjIGTVOoV2Q4LkLvSk=",
|
"narHash": "sha256-5U1YLh8bENPGtC6j6493qs3lK0PrzZw4omMvJUFOhEI=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "a2cd41ef5ba904d58f230740f06567ff9506e368",
|
"rev": "154a2c1abcea99a98f8b9344dfaba019a28162bd",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -210,11 +210,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1742700801,
|
"lastModified": 1739262228,
|
||||||
"narHash": "sha256-ZGlpUDsuBdeZeTNgoMv+aw0ByXT2J3wkYw9kJwkAS4M=",
|
"narHash": "sha256-7JAGezJ0Dn5qIyA2+T4Dt/xQgAbhCglh6lzCekTVMeU=",
|
||||||
"owner": "Mic92",
|
"owner": "Mic92",
|
||||||
"repo": "sops-nix",
|
"repo": "sops-nix",
|
||||||
"rev": "67566fe68a8bed2a7b1175fdfb0697ed22ae8852",
|
"rev": "07af005bb7d60c7f118d9d9f5530485da5d1e975",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -232,11 +232,11 @@
|
|||||||
"poetry2nix": "poetry2nix"
|
"poetry2nix": "poetry2nix"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1741571944,
|
"lastModified": 1739664204,
|
||||||
"narHash": "sha256-PM7dz99nb6dDiw/3naRGB/dUl5U7dJVspR9uevhW3xo=",
|
"narHash": "sha256-uzT5hQstNHJvdPPqdSiznxPXL3qCaKQ+DmMnx6IpIYk=",
|
||||||
"owner": "RichieCahill",
|
"owner": "RichieCahill",
|
||||||
"repo": "system_tools",
|
"repo": "system_tools",
|
||||||
"rev": "c9979e045bca52ec85a0dc560b238f3e5ae2f01c",
|
"rev": "b36dd59fedeba140175590bfcab2ba22049dfc93",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
@@ -91,6 +91,12 @@
|
|||||||
];
|
];
|
||||||
specialArgs = { inherit inputs outputs; };
|
specialArgs = { inherit inputs outputs; };
|
||||||
};
|
};
|
||||||
|
installer = lib.nixosSystem {
|
||||||
|
modules = [
|
||||||
|
./systems/installer
|
||||||
|
];
|
||||||
|
specialArgs = { inherit inputs outputs; };
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,8 +37,6 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
openssh.ports = [ 262 ];
|
openssh.ports = [ 262 ];
|
||||||
|
|
||||||
snapshot_manager.path = ./snapshot_config.toml;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
system.stateVersion = "24.05";
|
system.stateVersion = "24.05";
|
||||||
|
|||||||
@@ -28,7 +28,6 @@
|
|||||||
allowDiscards = true;
|
allowDiscards = true;
|
||||||
keyFileSize = 4096;
|
keyFileSize = 4096;
|
||||||
keyFile = "/dev/disk/by-id/usb-Samsung_Flash_Drive_FIT_0374620080067131-0:0";
|
keyFile = "/dev/disk/by-id/usb-Samsung_Flash_Drive_FIT_0374620080067131-0:0";
|
||||||
fallbackToPassword = true;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
kernelModules = [ "kvm-amd" ];
|
kernelModules = [ "kvm-amd" ];
|
||||||
@@ -51,11 +50,6 @@
|
|||||||
fsType = "zfs";
|
fsType = "zfs";
|
||||||
};
|
};
|
||||||
|
|
||||||
"/zfs/models" = {
|
|
||||||
device = "root_pool/models";
|
|
||||||
fsType = "zfs";
|
|
||||||
};
|
|
||||||
|
|
||||||
"/boot" = {
|
"/boot" = {
|
||||||
device = "/dev/disk/by-uuid/609D-FF29";
|
device = "/dev/disk/by-uuid/609D-FF29";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
|
|||||||
@@ -1,28 +1,24 @@
|
|||||||
{
|
{
|
||||||
services = {
|
services = {
|
||||||
ollama = {
|
ollama = {
|
||||||
user = "ollama";
|
|
||||||
enable = true;
|
enable = true;
|
||||||
loadModels = [
|
loadModels = [
|
||||||
"codellama:7b"
|
"codellama:7b"
|
||||||
|
"deepseek-r1:1.5b"
|
||||||
|
"deepseek-r1:7b"
|
||||||
"deepseek-r1:8b"
|
"deepseek-r1:8b"
|
||||||
"deepseek-r1:14b"
|
"deepseek-r1:14b"
|
||||||
"deepseek-r1:32b"
|
"deepseek-r1:32b"
|
||||||
"llama3.2:3b"
|
"llama3.2:3b"
|
||||||
"llama2-uncensored:7b"
|
|
||||||
"mistral-nemo:12b"
|
"mistral-nemo:12b"
|
||||||
"dolphin-mixtral:8x7b"
|
|
||||||
"qwq:32b"
|
|
||||||
"Qihoo360-Light-R1-32B"
|
|
||||||
];
|
];
|
||||||
models = "/zfs/models";
|
|
||||||
acceleration = "cuda";
|
acceleration = "cuda";
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
};
|
};
|
||||||
# open-webui = {
|
open-webui = {
|
||||||
# enable = true;
|
enable = true;
|
||||||
# openFirewall = true;
|
openFirewall = true;
|
||||||
# host = "0.0.0.0";
|
host = "192.168.90.25";
|
||||||
# };
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,29 +0,0 @@
|
|||||||
["default"]
|
|
||||||
15_min = 8
|
|
||||||
hourly = 24
|
|
||||||
daily = 0
|
|
||||||
monthly = 0
|
|
||||||
|
|
||||||
["root_pool/home"]
|
|
||||||
15_min = 8
|
|
||||||
hourly = 12
|
|
||||||
daily = 1
|
|
||||||
monthly = 0
|
|
||||||
|
|
||||||
["root_pool/root"]
|
|
||||||
15_min = 8
|
|
||||||
hourly = 24
|
|
||||||
daily = 0
|
|
||||||
monthly = 0
|
|
||||||
|
|
||||||
["root_pool/nix"]
|
|
||||||
15_min = 4
|
|
||||||
hourly = 0
|
|
||||||
daily = 0
|
|
||||||
monthly = 0
|
|
||||||
|
|
||||||
["root_pool/models"]
|
|
||||||
15_min = 4
|
|
||||||
hourly = 24
|
|
||||||
daily = 0
|
|
||||||
monthly = 0
|
|
||||||
24
systems/installer/default.nix
Normal file
24
systems/installer/default.nix
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
inputs,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
modulesPath,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
{
|
||||||
|
imports = [ (modulesPath + "/installer/cd-dvd/installation-cd-minimal.nix") ];
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
git
|
||||||
|
python313
|
||||||
|
inputs.system_tools.packages.x86_64-linux.default
|
||||||
|
];
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
|
||||||
|
systemd.services.sshd.wantedBy = pkgs.lib.mkForce [ "multi-user.target" ];
|
||||||
|
|
||||||
|
users.users.root.openssh.authorizedKeys.keys = [
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJYZFsc9CSH03ZUP7y81AHwSyjLwFmcshVFCyxDcYhBT rhapsody-in-green" # cspell:disable-line
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -10,12 +10,17 @@
|
|||||||
./services
|
./services
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
./networking.nix
|
./networking.nix
|
||||||
./nvidia.nix
|
|
||||||
./programs.nix
|
./programs.nix
|
||||||
./runners
|
./runners
|
||||||
./syncthing.nix
|
./syncthing.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
boot.zfs.extraPools = [
|
||||||
|
"media"
|
||||||
|
"storage"
|
||||||
|
"torrenting"
|
||||||
|
];
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
openssh.ports = [ 629 ];
|
openssh.ports = [ 629 ];
|
||||||
|
|
||||||
|
|||||||
36
systems/jeeves/docker/qbit.nix
Normal file
36
systems/jeeves/docker/qbit.nix
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
let
|
||||||
|
vars = import ../vars.nix;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
networking.firewall = {
|
||||||
|
allowedTCPPorts = [
|
||||||
|
6881
|
||||||
|
8082
|
||||||
|
29432
|
||||||
|
];
|
||||||
|
allowedUDPPorts = [
|
||||||
|
6881
|
||||||
|
29432
|
||||||
|
];
|
||||||
|
};
|
||||||
|
virtualisation.oci-containers.containers.qbit = {
|
||||||
|
image = "ghcr.io/linuxserver/qbittorrent:5.0.2";
|
||||||
|
ports = [
|
||||||
|
"6881:6881"
|
||||||
|
"6881:6881/udp"
|
||||||
|
"8082:8082"
|
||||||
|
"29432:29432"
|
||||||
|
];
|
||||||
|
volumes = [
|
||||||
|
"${vars.media_docker_configs}/qbit:/config"
|
||||||
|
"${vars.torrenting_qbit}:/data"
|
||||||
|
];
|
||||||
|
environment = {
|
||||||
|
PUID = "600";
|
||||||
|
PGID = "100";
|
||||||
|
TZ = "America/New_York";
|
||||||
|
WEBUI_PORT = "8082";
|
||||||
|
};
|
||||||
|
autoStart = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -21,9 +21,8 @@ in
|
|||||||
"8118:8118"
|
"8118:8118"
|
||||||
];
|
];
|
||||||
volumes = [
|
volumes = [
|
||||||
"${vars.docker_configs}/qbitvpn:/config"
|
"${vars.media_docker_configs}/qbitvpn:/config"
|
||||||
"${vars.qbitvpn}:/data"
|
"${vars.torrenting_qbitvpn}:/data"
|
||||||
"${vars.qbitvpn_scratch}:/data/incomplete"
|
|
||||||
"/etc/localtime:/etc/localtime:ro"
|
"/etc/localtime:/etc/localtime:ro"
|
||||||
];
|
];
|
||||||
environment = {
|
environment = {
|
||||||
@@ -41,7 +40,7 @@ in
|
|||||||
DELUGE_DAEMON_LOG_LEVEL = "debug";
|
DELUGE_DAEMON_LOG_LEVEL = "debug";
|
||||||
DELUGE_WEB_LOG_LEVEL = "debug";
|
DELUGE_WEB_LOG_LEVEL = "debug";
|
||||||
};
|
};
|
||||||
environmentFiles = [ "${vars.secrets}/docker/qbitvpn" ];
|
environmentFiles = [ "${vars.storage_secrets}/docker/qbitvpn" ];
|
||||||
autoStart = true;
|
autoStart = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ in
|
|||||||
ports = [ "8091:80" ];
|
ports = [ "8091:80" ];
|
||||||
volumes = [
|
volumes = [
|
||||||
"${../../../common/docker_templates}/file_server/sites/:/etc/apache2/sites-enabled/"
|
"${../../../common/docker_templates}/file_server/sites/:/etc/apache2/sites-enabled/"
|
||||||
"${vars.share}:/data"
|
"${vars.media_share}:/data"
|
||||||
];
|
];
|
||||||
extraOptions = [ "--network=web" ];
|
extraOptions = [ "--network=web" ];
|
||||||
autoStart = true;
|
autoStart = true;
|
||||||
|
|||||||
17
systems/jeeves/docker/uptime_kuma.nix
Normal file
17
systems/jeeves/docker/uptime_kuma.nix
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
let
|
||||||
|
vars = import ../vars.nix;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
virtualisation.oci-containers.containers = {
|
||||||
|
uptime_kuma = {
|
||||||
|
ports = [ "3001:3001" ];
|
||||||
|
image = "louislam/uptime-kuma:1.23.16-debian";
|
||||||
|
volumes = [
|
||||||
|
"${vars.media_docker_configs}/uptime_kuma:/app/data"
|
||||||
|
"/var/run/docker.sock:/var/run/docker.sock"
|
||||||
|
];
|
||||||
|
extraOptions = [ "--network=web" ];
|
||||||
|
autoStart = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -4,21 +4,6 @@
|
|||||||
modulesPath,
|
modulesPath,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
|
||||||
makeLuksDevice = device: {
|
|
||||||
inherit device;
|
|
||||||
keyFileSize = 4096;
|
|
||||||
keyFile = "/dev/disk/by-id/usb-XIAO_USB_Drive_24587CE29074-0:0";
|
|
||||||
fallbackToPassword = true;
|
|
||||||
};
|
|
||||||
makeLuksSSD =
|
|
||||||
device:
|
|
||||||
(makeLuksDevice device)
|
|
||||||
// {
|
|
||||||
bypassWorkqueues = true;
|
|
||||||
allowDiscards = true;
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||||
|
|
||||||
@@ -56,51 +41,87 @@ in
|
|||||||
luks.devices = {
|
luks.devices = {
|
||||||
# cspell:disable
|
# cspell:disable
|
||||||
# Root pool
|
# Root pool
|
||||||
"luks-root-pool-wwn-0x55cd2e4150f01519-part2" =
|
"luks-root-pool-wwn-0x55cd2e4150f01519-part2" = {
|
||||||
makeLuksSSD "/dev/disk/by-id/wwn-0x55cd2e4150f01519-part2";
|
device = "/dev/disk/by-id/wwn-0x55cd2e4150f01519-part2";
|
||||||
"luks-root-pool-wwn-0x55cd2e4150f01556-part2" =
|
bypassWorkqueues = true;
|
||||||
makeLuksSSD "/dev/disk/by-id/wwn-0x55cd2e4150f01556-part2";
|
allowDiscards = true;
|
||||||
|
};
|
||||||
|
"luks-root-pool-wwn-0x55cd2e4150f01556-part2" = {
|
||||||
|
device = "/dev/disk/by-id/wwn-0x55cd2e4150f01556-part2";
|
||||||
|
bypassWorkqueues = true;
|
||||||
|
allowDiscards = true;
|
||||||
|
};
|
||||||
# Media pool
|
# Media pool
|
||||||
"luks-media_pool-nvme-INTEL_SSDPEK1A118GA_BTOC14120V2J118B-part1" =
|
"luks-media_pool-nvme-INTEL_SSDPEK1A118GA_BTOC14120V2J118B-part1" = {
|
||||||
makeLuksSSD "/dev/disk/by-id/nvme-INTEL_SSDPEK1A118GA_BTOC14120V2J118B-part1";
|
device = "/dev/disk/by-id/nvme-INTEL_SSDPEK1A118GA_BTOC14120V2J118B-part1";
|
||||||
"luks-media_pool-nvme-INTEL_SSDPEK1A118GA_BTOC14120WAG118B-part1" =
|
bypassWorkqueues = true;
|
||||||
makeLuksSSD "/dev/disk/by-id/nvme-INTEL_SSDPEK1A118GA_BTOC14120WAG118B-part1";
|
allowDiscards = true;
|
||||||
"luks-media_pool-nvme-INTEL_SSDPE2ME012T4_CVMD5130000G1P2HGN-part1" =
|
};
|
||||||
makeLuksSSD "/dev/disk/by-id/nvme-INTEL_SSDPE2ME012T4_CVMD5130000G1P2HGN-part1";
|
"luks-media_pool-nvme-INTEL_SSDPEK1A118GA_BTOC14120WAG118B-part1" = {
|
||||||
"luks-media_pool-nvme-INTEL_SSDPE2ME012T4_CVMD5130000U1P2HGN-part1" =
|
device = "/dev/disk/by-id/nvme-INTEL_SSDPEK1A118GA_BTOC14120WAG118B-part1";
|
||||||
makeLuksSSD "/dev/disk/by-id/nvme-INTEL_SSDPE2ME012T4_CVMD5130000U1P2HGN-part1";
|
bypassWorkqueues = true;
|
||||||
|
allowDiscards = true;
|
||||||
# Scratch pool
|
};
|
||||||
"luks-scratch-pool-ata-CT480BX500SSD1_2314E6C3C01C-part1" =
|
"luks-media_pool-nvme-INTEL_SSDPE2ME012T4_CVMD5130000G1P2HGN-part1" = {
|
||||||
makeLuksSSD "/dev/disk/by-id/ata-CT480BX500SSD1_2314E6C3C01C-part1";
|
device = "/dev/disk/by-id/nvme-INTEL_SSDPE2ME012T4_CVMD5130000G1P2HGN-part1";
|
||||||
"luks-scratch-pool-ata-CT480BX500SSD1_2314E6C3C01E-part1" =
|
bypassWorkqueues = true;
|
||||||
makeLuksSSD "/dev/disk/by-id/ata-CT480BX500SSD1_2314E6C3C01E-part1";
|
allowDiscards = true;
|
||||||
|
};
|
||||||
|
"luks-media_pool-nvme-INTEL_SSDPE2ME012T4_CVMD5130000U1P2HGN-part1" = {
|
||||||
|
device = "/dev/disk/by-id/nvme-INTEL_SSDPE2ME012T4_CVMD5130000U1P2HGN-part1";
|
||||||
|
bypassWorkqueues = true;
|
||||||
|
allowDiscards = true;
|
||||||
|
};
|
||||||
# Storage pool
|
# Storage pool
|
||||||
"luks-storage_pool-nvme-Samsung_SSD_970_EVO_Plus_2TB_S6S2NS0T834822N-part1" =
|
"luks-storage_pool-nvme-Samsung_SSD_970_EVO_Plus_2TB_S6S2NS0T834822N-part1" = {
|
||||||
makeLuksSSD "/dev/disk/by-id/nvme-Samsung_SSD_970_EVO_Plus_2TB_S6S2NS0T834822N-part1";
|
device = "/dev/disk/by-id/nvme-Samsung_SSD_970_EVO_Plus_2TB_S6S2NS0T834822N-part1";
|
||||||
"luks-storage_pool-nvme-Samsung_SSD_970_EVO_Plus_2TB_S6S2NS0T834817F-part1" =
|
bypassWorkqueues = true;
|
||||||
makeLuksSSD "/dev/disk/by-id/nvme-Samsung_SSD_970_EVO_Plus_2TB_S6S2NS0T834817F-part1";
|
allowDiscards = true;
|
||||||
"luks-storage_pool-nvme-INTEL_MEMPEK1W016GA_PHBT828104DF016D-part1" =
|
};
|
||||||
makeLuksSSD "/dev/disk/by-id/nvme-INTEL_MEMPEK1W016GA_PHBT828104DF016D-part1";
|
"luks-storage_pool-nvme-Samsung_SSD_970_EVO_Plus_2TB_S6S2NS0T834817F-part1" = {
|
||||||
"luks-storage_pool-nvme-INTEL_MEMPEK1W016GA_PHBT828105A8016D-part1" =
|
device = "/dev/disk/by-id/nvme-Samsung_SSD_970_EVO_Plus_2TB_S6S2NS0T834817F-part1";
|
||||||
makeLuksSSD "/dev/disk/by-id/nvme-INTEL_MEMPEK1W016GA_PHBT828105A8016D-part1";
|
bypassWorkqueues = true;
|
||||||
"luks-storage_pool-wwn-0x5000cca23bc438dd-part1" =
|
allowDiscards = true;
|
||||||
makeLuksDevice "/dev/disk/by-id/wwn-0x5000cca23bc438dd-part1";
|
};
|
||||||
"luks-storage_pool-wwn-0x5000cca23bd035f5-part1" =
|
"luks-storage_pool-nvme-INTEL_MEMPEK1W016GA_PHBT828104DF016D-part1" = {
|
||||||
makeLuksDevice "/dev/disk/by-id/wwn-0x5000cca23bd035f5-part1";
|
device = "/dev/disk/by-id/nvme-INTEL_MEMPEK1W016GA_PHBT828104DF016D-part1";
|
||||||
"luks-storage_pool-wwn-0x5000cca23bd00ad6-part1" =
|
bypassWorkqueues = true;
|
||||||
makeLuksDevice "/dev/disk/by-id/wwn-0x5000cca23bd00ad6-part1";
|
allowDiscards = true;
|
||||||
|
};
|
||||||
|
"luks-storage_pool-nvme-INTEL_MEMPEK1W016GA_PHBT828105A8016D-part1" = {
|
||||||
|
device = "/dev/disk/by-id/nvme-INTEL_MEMPEK1W016GA_PHBT828105A8016D-part1";
|
||||||
|
bypassWorkqueues = true;
|
||||||
|
allowDiscards = true;
|
||||||
|
};
|
||||||
|
"luks-storage_pool-wwn-0x5000cca23bc438dd-part1".device =
|
||||||
|
"/dev/disk/by-id/wwn-0x5000cca23bc438dd-part1";
|
||||||
|
"luks-storage_pool-wwn-0x5000cca23bd035f5-part1".device =
|
||||||
|
"/dev/disk/by-id/wwn-0x5000cca23bd035f5-part1";
|
||||||
|
"luks-storage_pool-wwn-0x5000cca23bd00ad6-part1".device =
|
||||||
|
"/dev/disk/by-id/wwn-0x5000cca23bd00ad6-part1";
|
||||||
|
"luks-storage_pool-wwn-0x5000cca23bcf313e-part1".device =
|
||||||
|
"/dev/disk/by-id/wwn-0x5000cca23bcf313e-part1";
|
||||||
|
"luks-storage_pool-wwn-0x5000cca23bcdf3b8-part1".device =
|
||||||
|
"/dev/disk/by-id/wwn-0x5000cca23bcdf3b8-part1";
|
||||||
|
"luks-storage_pool-wwn-0x5000cca23bd02746-part1".device =
|
||||||
|
"/dev/disk/by-id/wwn-0x5000cca23bd02746-part1";
|
||||||
|
"luks-storage_pool-wwn-0x5000cca23bcf9f89-part1".device =
|
||||||
|
"/dev/disk/by-id/wwn-0x5000cca23bcf9f89-part1";
|
||||||
|
"luks-storage_pool-wwn-0x5000cca23bd00ae9-part1".device =
|
||||||
|
"/dev/disk/by-id/wwn-0x5000cca23bd00ae9-part1";
|
||||||
|
# Torrenting pool
|
||||||
|
"luks-torrenting_pool-wwn-0x500a0751e6c3c01e-part1" = {
|
||||||
|
device = "/dev/disk/by-id/wwn-0x500a0751e6c3c01e-part1";
|
||||||
|
bypassWorkqueues = true;
|
||||||
|
allowDiscards = true;
|
||||||
|
};
|
||||||
|
"luks-torrenting_pool-wwn-0x5000cca264f080a3-part1".device =
|
||||||
|
"/dev/disk/by-id/wwn-0x5000cca264f080a3-part1";
|
||||||
|
"luks-torrenting_pool-wwn-0x5000cca298c33ae5-part1".device =
|
||||||
|
"/dev/disk/by-id/wwn-0x5000cca298c33ae5-part1";
|
||||||
|
# cspell:enable
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
zfs.extraPools = [
|
|
||||||
"media"
|
|
||||||
"scratch"
|
|
||||||
"storage"
|
|
||||||
];
|
|
||||||
|
|
||||||
kernelModules = [ "kvm-amd" ];
|
kernelModules = [ "kvm-amd" ];
|
||||||
extraModulePackages = [ ];
|
extraModulePackages = [ ];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,16 +0,0 @@
|
|||||||
{ config, ... }:
|
|
||||||
{
|
|
||||||
nixpkgs.config.cudaSupport = true;
|
|
||||||
|
|
||||||
services.xserver.videoDrivers = [ "nvidia" ];
|
|
||||||
hardware = {
|
|
||||||
nvidia = {
|
|
||||||
modesetting.enable = true;
|
|
||||||
powerManagement.enable = true;
|
|
||||||
package = config.boot.kernelPackages.nvidiaPackages.beta;
|
|
||||||
nvidiaSettings = true;
|
|
||||||
open = false;
|
|
||||||
};
|
|
||||||
nvidia-container-toolkit.enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -28,8 +28,8 @@ in
|
|||||||
mountPoint = "/zfs/media/github-runners/${name}";
|
mountPoint = "/zfs/media/github-runners/${name}";
|
||||||
isReadOnly = false;
|
isReadOnly = false;
|
||||||
};
|
};
|
||||||
"/secrets".mountPoint = "${vars.secrets}/services/github-runners/${name}";
|
"/secrets".mountPoint = "${vars.storage_secrets}/services/github-runners/${name}";
|
||||||
"ssh-keys".mountPoint = "${vars.secrets}/services/github-runners/id_ed25519_github-runners";
|
"ssh-keys".mountPoint = "${vars.storage_secrets}/services/github-runners/id_ed25519_github-runners";
|
||||||
};
|
};
|
||||||
config =
|
config =
|
||||||
{
|
{
|
||||||
@@ -65,7 +65,7 @@ in
|
|||||||
Port 629
|
Port 629
|
||||||
User github-runners
|
User github-runners
|
||||||
HostName 192.168.95.14
|
HostName 192.168.95.14
|
||||||
IdentityFile ${vars.secrets}/services/github-runners/id_ed25519_github-runners
|
IdentityFile ${vars.storage_secrets}/services/github-runners/id_ed25519_github-runners
|
||||||
StrictHostKeyChecking no
|
StrictHostKeyChecking no
|
||||||
UserKnownHostsFile /dev/null
|
UserKnownHostsFile /dev/null
|
||||||
'';
|
'';
|
||||||
@@ -75,7 +75,7 @@ in
|
|||||||
workDir = "/zfs/media/github-runners/${name}";
|
workDir = "/zfs/media/github-runners/${name}";
|
||||||
url = "https://github.com/RichieCahill/dotfiles";
|
url = "https://github.com/RichieCahill/dotfiles";
|
||||||
extraLabels = [ "nixos" ];
|
extraLabels = [ "nixos" ];
|
||||||
tokenFile = "${vars.secrets}/services/github-runners/${name}";
|
tokenFile = "${vars.storage_secrets}/services/github-runners/${name}";
|
||||||
user = "github-runners";
|
user = "github-runners";
|
||||||
group = "github-runners";
|
group = "github-runners";
|
||||||
extraPackages = with pkgs; [
|
extraPackages = with pkgs; [
|
||||||
|
|||||||
@@ -11,11 +11,13 @@ sudo zpool create -o ashift=12 -O acltype=posixacl -O atime=off -O dnodesize=aut
|
|||||||
sudo zpool add storage -o ashift=12 special mirror
|
sudo zpool add storage -o ashift=12 special mirror
|
||||||
sudo zpool add storage -o ashift=12 logs mirror
|
sudo zpool add storage -o ashift=12 logs mirror
|
||||||
|
|
||||||
# scratch
|
# torrenting
|
||||||
sudo zpool create -o ashift=12 -O acltype=posixacl -O atime=off -O dnodesize=auto -O xattr=sa -O compression=zstd -m /zfs/scratch scratch
|
sudo zpool create -o ashift=12 -O acltype=posixacl -O atime=off -O dnodesize=auto -O xattr=sa -O compression=zstd -m /zfs/torrenting torrenting
|
||||||
|
sudo zpool add torrenting -o ashift=12 special
|
||||||
|
|
||||||
# media datasets
|
# media datasets
|
||||||
sudo zfs create -o compression=zstd-9 media/docker
|
sudo zfs create -o compression=zstd-9 media/docker
|
||||||
|
sudo zfs create -o recordsize=1M -o compression=zstd-19 media/library
|
||||||
sudo zfs create -o compression=zstd-9 -o sync=disabled media/github-runners
|
sudo zfs create -o compression=zstd-9 -o sync=disabled media/github-runners
|
||||||
sudo zfs create -o copies=3 media/notes
|
sudo zfs create -o copies=3 media/notes
|
||||||
sudo zfs create -o compression=zstd-9 media/plex
|
sudo zfs create -o compression=zstd-9 media/plex
|
||||||
@@ -24,10 +26,6 @@ sudo zfs create -o compression=zstd-19 media/home_assistant
|
|||||||
sudo zfs create -o exec=off media/share
|
sudo zfs create -o exec=off media/share
|
||||||
sudo zfs create -o recordsize=16k -o primarycache=metadata -o mountpoint=/zfs/media/database/postgres media/postgres
|
sudo zfs create -o recordsize=16k -o primarycache=metadata -o mountpoint=/zfs/media/database/postgres media/postgres
|
||||||
|
|
||||||
# scratch datasets
|
|
||||||
sudo zfs create -o recordsize=16k -o sync=disabled scratch/qbitvpn
|
|
||||||
sudo zfs create -o recordsize=16k -o sync=disabled scratch/transmission
|
|
||||||
|
|
||||||
# storage datasets
|
# storage datasets
|
||||||
sudo zfs create -o recordsize=1M -o compression=zstd-19 storage/archive
|
sudo zfs create -o recordsize=1M -o compression=zstd-19 storage/archive
|
||||||
sudo zfs create -o compression=zstd-19 storage/main
|
sudo zfs create -o compression=zstd-19 storage/main
|
||||||
@@ -35,6 +33,7 @@ sudo zfs create -o recordsize=16K -o compression=zstd-19 -o copies=2 storage/pho
|
|||||||
sudo zfs create -o recordsize=1M -o compression=zstd-19 storage/plex
|
sudo zfs create -o recordsize=1M -o compression=zstd-19 storage/plex
|
||||||
sudo zfs create -o compression=zstd-19 -o copies=3 storage/secrets
|
sudo zfs create -o compression=zstd-19 -o copies=3 storage/secrets
|
||||||
sudo zfs create -o compression=zstd-19 storage/syncthing
|
sudo zfs create -o compression=zstd-19 storage/syncthing
|
||||||
sudo zfs create -o recordsize=1M -o compression=zstd-9 -o exec=off -o sync=disabled storage/qbitvpn
|
|
||||||
sudo zfs create -o recordsize=1M -o compression=zstd-9 -o exec=off -o sync=disabled storage/transmission
|
# torrenting datasets
|
||||||
sudo zfs create -o recordsize=1M -o compression=zstd-19 storage/library
|
sudo zfs create -o recordsize=16K -o exec=off -o sync=disabled torrenting/qbit
|
||||||
|
sudo zfs create -o recordsize=16K -o exec=off -o sync=disabled torrenting/qbitvpn
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
{ config, ... }:
|
|
||||||
let
|
|
||||||
vars = import ../vars.nix;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
security.acme = {
|
|
||||||
acceptTerms = true;
|
|
||||||
defaults = {
|
|
||||||
email = "themadmaker2@protonmail.com";
|
|
||||||
dnsResolver = "1.1.1.1:53";
|
|
||||||
extraLegoFlags = [
|
|
||||||
"--dns-timeout=300"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
certs."tmmworkshop.com" = {
|
|
||||||
dnsProvider = "cloudflare";
|
|
||||||
environmentFile = "${vars.secrets}/services/acme/cloudflare.txt";
|
|
||||||
email = "themadmaker2@protonmail.com";
|
|
||||||
group = config.services.haproxy.group;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -5,6 +5,6 @@ in
|
|||||||
{
|
{
|
||||||
services.audiobookshelf.enable = true;
|
services.audiobookshelf.enable = true;
|
||||||
systemd.services.audiobookshelf.serviceConfig.WorkingDirectory =
|
systemd.services.audiobookshelf.serviceConfig.WorkingDirectory =
|
||||||
lib.mkForce "${vars.docker_configs}/audiobookshelf";
|
lib.mkForce "${vars.media_docker_configs}/audiobookshelf";
|
||||||
users.users.audiobookshelf.home = lib.mkForce "${vars.docker_configs}/audiobookshelf";
|
users.users.audiobookshelf.home = lib.mkForce "${vars.media_docker_configs}/audiobookshelf";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ in
|
|||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "simple";
|
Type = "simple";
|
||||||
EnvironmentFile = "${vars.secrets}/docker/cloud_flare_tunnel";
|
EnvironmentFile = "${vars.storage_secrets}/docker/cloud_flare_tunnel";
|
||||||
ExecStart = "${pkgs.cloudflared}/bin/cloudflared --no-autoupdate tunnel run";
|
ExecStart = "${pkgs.cloudflared}/bin/cloudflared --no-autoupdate tunnel run";
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
};
|
};
|
||||||
|
|||||||
10
systems/jeeves/services/duckdns.nix
Normal file
10
systems/jeeves/services/duckdns.nix
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
let
|
||||||
|
vars = import ../vars.nix;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
services.duckdns = {
|
||||||
|
enable = true;
|
||||||
|
tokenFile = "${vars.storage_secrets}/services/duckdns/token";
|
||||||
|
domainsFile = "${vars.storage_secrets}/services/duckdns/domains";
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -14,7 +14,7 @@ in
|
|||||||
Type = "simple";
|
Type = "simple";
|
||||||
User = "richie";
|
User = "richie";
|
||||||
Group = "users";
|
Group = "users";
|
||||||
ExecStart = "${pkgs.filebrowser}/bin/filebrowser --root=/zfs --address=0.0.0.0 --database=${vars.docker_configs}/filebrowser/filebrowser.db";
|
ExecStart = "${pkgs.filebrowser}/bin/filebrowser --root=/zfs --address=0.0.0.0 --database=${vars.media_docker_configs}/filebrowser/filebrowser.db";
|
||||||
Restart = "on-failure";
|
Restart = "on-failure";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -22,25 +22,24 @@ defaults
|
|||||||
#Application Setup
|
#Application Setup
|
||||||
frontend ContentSwitching
|
frontend ContentSwitching
|
||||||
bind *:80 v4v6
|
bind *:80 v4v6
|
||||||
bind *:443 v4v6 ssl crt /var/lib/acme/tmmworkshop.com/full.pem
|
bind *:443 v4v6 ssl crt /zfs/storage/secrets/docker/cloudflare.pem
|
||||||
mode http
|
mode http
|
||||||
# tmmworkshop.com
|
# tmmworkshop.com
|
||||||
acl host_tmmworkshop hdr(host) -i tmmworkshop.com
|
|
||||||
acl host_tmmworkshop hdr(host) -i www.tmmworkshop.com
|
|
||||||
acl host_audiobookshelf hdr(host) -i audiobookshelf.tmmworkshop.com
|
acl host_audiobookshelf hdr(host) -i audiobookshelf.tmmworkshop.com
|
||||||
acl host_cache hdr(host) -i cache.tmmworkshop.com
|
acl host_cache hdr(host) -i cache.tmmworkshop.com
|
||||||
acl host_filebrowser hdr(host) -i filebrowser.tmmworkshop.com
|
acl host_filebrowser hdr(host) -i filebrowser.tmmworkshop.com
|
||||||
acl host_homeassistant hdr(host) -i homeassistant.tmmworkshop.com
|
acl host_homeassistant hdr(host) -i homeassistant.tmmworkshop.com
|
||||||
acl host_jellyfin hdr(host) -i jellyfin.tmmworkshop.com
|
acl host_jellyfin hdr(host) -i jellyfin.tmmworkshop.com
|
||||||
acl host_share hdr(host) -i share.tmmworkshop.com
|
acl host_share hdr(host) -i share.tmmworkshop.com
|
||||||
|
acl host_uptime_kuma hdr(host) -i uptimekuma-jeeves.tmmworkshop.com
|
||||||
|
|
||||||
use_backend tmmworkshop_nodes if host_tmmworkshop
|
|
||||||
use_backend audiobookshelf_nodes if host_audiobookshelf
|
use_backend audiobookshelf_nodes if host_audiobookshelf
|
||||||
use_backend cache_nodes if host_cache
|
use_backend cache_nodes if host_cache
|
||||||
use_backend filebrowser_nodes if host_filebrowser
|
use_backend filebrowser_nodes if host_filebrowser
|
||||||
use_backend homeassistant_nodes if host_homeassistant
|
use_backend homeassistant_nodes if host_homeassistant
|
||||||
use_backend jellyfin if host_jellyfin
|
use_backend jellyfin if host_jellyfin
|
||||||
use_backend share_nodes if host_share
|
use_backend share_nodes if host_share
|
||||||
|
use_backend uptime_kuma_nodes if host_uptime_kuma
|
||||||
|
|
||||||
backend audiobookshelf_nodes
|
backend audiobookshelf_nodes
|
||||||
mode http
|
mode http
|
||||||
@@ -69,6 +68,6 @@ backend share_nodes
|
|||||||
mode http
|
mode http
|
||||||
server server 127.0.0.1:8091
|
server server 127.0.0.1:8091
|
||||||
|
|
||||||
backend tmmworkshop_nodes
|
backend uptime_kuma_nodes
|
||||||
mode http
|
mode http
|
||||||
server server 127.0.0.1:8080
|
server server 127.0.0.1:3001
|
||||||
|
|||||||
@@ -2,19 +2,11 @@ let
|
|||||||
vars = import ../vars.nix;
|
vars = import ../vars.nix;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
users = {
|
|
||||||
users.hass = {
|
|
||||||
isSystemUser = true;
|
|
||||||
group = "hass";
|
|
||||||
};
|
|
||||||
groups.hass = { };
|
|
||||||
};
|
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
home-assistant = {
|
home-assistant = {
|
||||||
enable = true;
|
enable = true;
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
configDir = vars.home_assistant;
|
configDir = vars.media_home_assistant;
|
||||||
config = {
|
config = {
|
||||||
http = {
|
http = {
|
||||||
server_port = 8123;
|
server_port = 8123;
|
||||||
@@ -31,12 +23,6 @@ in
|
|||||||
unit_system = "us_customary";
|
unit_system = "us_customary";
|
||||||
temperature_unit = "F";
|
temperature_unit = "F";
|
||||||
};
|
};
|
||||||
recorder = {
|
|
||||||
db_url = "postgresql://@/hass";
|
|
||||||
auto_purge = true;
|
|
||||||
purge_keep_days = 3650;
|
|
||||||
db_retry_wait = 15;
|
|
||||||
};
|
|
||||||
assist_pipeline = { };
|
assist_pipeline = { };
|
||||||
backup = { };
|
backup = { };
|
||||||
bluetooth = { };
|
bluetooth = { };
|
||||||
@@ -72,7 +58,6 @@ in
|
|||||||
rokuecp
|
rokuecp
|
||||||
uiprotect
|
uiprotect
|
||||||
wakeonlan
|
wakeonlan
|
||||||
wyoming
|
|
||||||
];
|
];
|
||||||
extraComponents = [ "isal" ];
|
extraComponents = [ "isal" ];
|
||||||
};
|
};
|
||||||
@@ -81,23 +66,5 @@ in
|
|||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
address = "192.168.90.40";
|
address = "192.168.90.40";
|
||||||
};
|
};
|
||||||
wyoming = {
|
|
||||||
faster-whisper.servers.main = {
|
|
||||||
enable = true;
|
|
||||||
uri = "tcp://0.0.0.0:10300";
|
|
||||||
model = "medium.en";
|
|
||||||
language = "en";
|
|
||||||
device = "cuda";
|
|
||||||
};
|
|
||||||
piper.servers.main = {
|
|
||||||
enable = true;
|
|
||||||
uri = "tcp://0.0.0.0:10200";
|
|
||||||
voice = "en_GB-alba-medium";
|
|
||||||
};
|
|
||||||
openwakeword = {
|
|
||||||
enable = true;
|
|
||||||
uri = "tcp://0.0.0.0:10400";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,6 @@ in
|
|||||||
services.jellyfin = {
|
services.jellyfin = {
|
||||||
enable = true;
|
enable = true;
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
dataDir = "${vars.services}/jellyfin";
|
dataDir = "${vars.media_services}/jellyfin";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ in
|
|||||||
{
|
{
|
||||||
services.nix-serve = {
|
services.nix-serve = {
|
||||||
enable = true;
|
enable = true;
|
||||||
secretKeyFile = "${vars.secrets}/services/nix-cache/cache-priv-key.pem";
|
secretKeyFile = "${vars.storage_secrets}/services/nix-cache/cache-priv-key.pem";
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,31 +10,19 @@ in
|
|||||||
package = pkgs.postgresql_17_jit;
|
package = pkgs.postgresql_17_jit;
|
||||||
enableTCPIP = true;
|
enableTCPIP = true;
|
||||||
enableJIT = true;
|
enableJIT = true;
|
||||||
dataDir = "${vars.database}/postgres";
|
dataDir = "${vars.media_database}/postgres";
|
||||||
|
|
||||||
authentication = pkgs.lib.mkOverride 10 ''
|
authentication = pkgs.lib.mkOverride 10 ''
|
||||||
|
|
||||||
# admins
|
|
||||||
local all postgres trust
|
|
||||||
host all postgres 127.0.0.1/32 trust
|
|
||||||
host all postgres ::1/128 trust
|
|
||||||
|
|
||||||
local all richie trust
|
|
||||||
host all richie 127.0.0.1/32 trust
|
|
||||||
host all richie ::1/128 trust
|
|
||||||
host all richie 192.168.90.1/24 trust
|
|
||||||
host all richie 192.168.95.1/24 trust
|
|
||||||
|
|
||||||
|
|
||||||
#type database DBuser origin-address auth-method
|
#type database DBuser origin-address auth-method
|
||||||
local hass hass trust
|
local all all trust
|
||||||
|
|
||||||
# ipv4
|
# ipv4
|
||||||
host hass hass 192.168.90.1/24 trust
|
host all all 127.0.0.1/32 trust
|
||||||
host hass hass 127.0.0.1/32 trust
|
host all all 192.168.90.1/24 trust
|
||||||
|
|
||||||
# ipv6
|
# ipv6
|
||||||
host hass hass ::1/128 trust
|
host all all ::1/128 trust
|
||||||
'';
|
'';
|
||||||
|
|
||||||
identMap = ''
|
identMap = ''
|
||||||
@@ -43,7 +31,6 @@ in
|
|||||||
superuser_map postgres postgres
|
superuser_map postgres postgres
|
||||||
# Let other names login as themselves
|
# Let other names login as themselves
|
||||||
superuser_map richie postgres
|
superuser_map richie postgres
|
||||||
superuser_map hass hass
|
|
||||||
'';
|
'';
|
||||||
ensureUsers = [
|
ensureUsers = [
|
||||||
{
|
{
|
||||||
@@ -58,7 +45,6 @@ in
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "richie";
|
name = "richie";
|
||||||
ensureDBOwnership = true;
|
|
||||||
ensureClauses = {
|
ensureClauses = {
|
||||||
superuser = true;
|
superuser = true;
|
||||||
login = true;
|
login = true;
|
||||||
@@ -67,22 +53,6 @@ in
|
|||||||
replication = true;
|
replication = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
{
|
|
||||||
name = "hass";
|
|
||||||
ensureDBOwnership = true;
|
|
||||||
ensureClauses = {
|
|
||||||
login = true;
|
|
||||||
createrole = true;
|
|
||||||
createdb = true;
|
|
||||||
replication = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
ensureDatabases = [
|
|
||||||
"hass"
|
|
||||||
"mxr_dev"
|
|
||||||
"mxr_prod"
|
|
||||||
"richie"
|
|
||||||
];
|
];
|
||||||
# Thank you NotAShelf
|
# Thank you NotAShelf
|
||||||
# https://github.com/NotAShelf/nyx/blob/d407b4d6e5ab7f60350af61a3d73a62a5e9ac660/modules/core/roles/server/system/services/databases/postgresql.nix#L74
|
# https://github.com/NotAShelf/nyx/blob/d407b4d6e5ab7f60350af61a3d73a62a5e9ac660/modules/core/roles/server/system/services/databases/postgresql.nix#L74
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ in
|
|||||||
description = "validates startup";
|
description = "validates startup";
|
||||||
path = [ pkgs.zfs ];
|
path = [ pkgs.zfs ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
EnvironmentFile = "${vars.secrets}/services/server-validation";
|
EnvironmentFile = "${vars.storage_secrets}/services/server-validation";
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
ExecStart = "${inputs.system_tools.packages.x86_64-linux.default}/bin/validate_system --config-file='${./validate_system.toml}'";
|
ExecStart = "${inputs.system_tools.packages.x86_64-linux.default}/bin/validate_system --config-file='${./validate_system.toml}'";
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
{ pkgs, ... }:
|
|
||||||
let
|
|
||||||
vars = import ../vars.nix;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
services.transmission = {
|
|
||||||
enable = true;
|
|
||||||
package = pkgs.transmission_4;
|
|
||||||
webHome = pkgs.flood-for-transmission;
|
|
||||||
home = "${vars.services}/transmission";
|
|
||||||
openPeerPorts = true;
|
|
||||||
openRPCPort = true;
|
|
||||||
downloadDirPermissions = "770";
|
|
||||||
settings = {
|
|
||||||
bind-address-ipv4 = "192.168.95.14";
|
|
||||||
cache-size-mb = 0;
|
|
||||||
download-dir = "${vars.transmission}/complete";
|
|
||||||
download-queue-enabled = false;
|
|
||||||
incomplete-dir = "${vars.transmission_scratch}/incomplete";
|
|
||||||
incomplete-dir-enabled = true;
|
|
||||||
message-level = 3;
|
|
||||||
peer-port = 51413;
|
|
||||||
rpc-bind-address = "0.0.0.0";
|
|
||||||
rpc-host-whitelist = "127.0.0.1,192.168.90.40";
|
|
||||||
rpc-host-whitelist-enabled = true;
|
|
||||||
rpc-port = 9091;
|
|
||||||
rpc-whitelist-enabled = true;
|
|
||||||
rpc-whitelist = "127.0.0.1,192.168.90.49";
|
|
||||||
seed-queue-enabled = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
zpool = ["root_pool", "storage", "media"]
|
zpool = ["root_pool", "storage", "torrenting", "media"]
|
||||||
services = [
|
services = [
|
||||||
"audiobookshelf",
|
"audiobookshelf",
|
||||||
"cloud_flare_tunnel",
|
"cloud_flare_tunnel",
|
||||||
"haproxy",
|
"haproxy",
|
||||||
|
"docker-qbit",
|
||||||
"docker-qbitvpn",
|
"docker-qbitvpn",
|
||||||
|
"docker-uptime_kuma",
|
||||||
"docker",
|
"docker",
|
||||||
"filebrowser",
|
"filebrowser",
|
||||||
"home-assistant",
|
"home-assistant",
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ in
|
|||||||
networking.firewall.allowedTCPPorts = [ 8384 ];
|
networking.firewall.allowedTCPPorts = [ 8384 ];
|
||||||
|
|
||||||
services.syncthing = {
|
services.syncthing = {
|
||||||
overrideFolders = false;
|
|
||||||
guiAddress = "192.168.90.40:8384";
|
guiAddress = "192.168.90.40:8384";
|
||||||
settings = {
|
settings = {
|
||||||
devices.davids-server.id = "7GXTDGR-AOXFW2O-K6J7NM3-XYZNRRW-AKHAFWM-GBOWUPQ-OA6JIWD-ER7RDQL"; # cspell:disable-line
|
devices.davids-server.id = "7GXTDGR-AOXFW2O-K6J7NM3-XYZNRRW-AKHAFWM-GBOWUPQ-OA6JIWD-ER7RDQL"; # cspell:disable-line
|
||||||
@@ -20,7 +19,7 @@ in
|
|||||||
};
|
};
|
||||||
"notes" = {
|
"notes" = {
|
||||||
id = "l62ul-lpweo"; # cspell:disable-line
|
id = "l62ul-lpweo"; # cspell:disable-line
|
||||||
path = vars.notes;
|
path = vars.media_notes;
|
||||||
devices = [
|
devices = [
|
||||||
"rhapsody-in-green"
|
"rhapsody-in-green"
|
||||||
"davids-server"
|
"davids-server"
|
||||||
@@ -29,7 +28,7 @@ in
|
|||||||
};
|
};
|
||||||
"important" = {
|
"important" = {
|
||||||
id = "4ckma-gtshs"; # cspell:disable-line
|
id = "4ckma-gtshs"; # cspell:disable-line
|
||||||
path = "${vars.syncthing}/important";
|
path = "${vars.storage_syncthing}/important";
|
||||||
devices = [
|
devices = [
|
||||||
"bob"
|
"bob"
|
||||||
"rhapsody-in-green"
|
"rhapsody-in-green"
|
||||||
@@ -39,7 +38,7 @@ in
|
|||||||
};
|
};
|
||||||
"music" = {
|
"music" = {
|
||||||
id = "vprc5-3azqc"; # cspell:disable-line
|
id = "vprc5-3azqc"; # cspell:disable-line
|
||||||
path = "${vars.syncthing}/music";
|
path = "${vars.storage_syncthing}/music";
|
||||||
devices = [
|
devices = [
|
||||||
"bob"
|
"bob"
|
||||||
"rhapsody-in-green"
|
"rhapsody-in-green"
|
||||||
@@ -50,14 +49,14 @@ in
|
|||||||
};
|
};
|
||||||
"projects" = {
|
"projects" = {
|
||||||
id = "vyma6-lqqrz"; # cspell:disable-line
|
id = "vyma6-lqqrz"; # cspell:disable-line
|
||||||
path = "${vars.syncthing}/projects";
|
path = "${vars.storage_syncthing}/projects";
|
||||||
devices = [
|
devices = [
|
||||||
"rhapsody-in-green"
|
"rhapsody-in-green"
|
||||||
];
|
];
|
||||||
fsWatcherEnabled = true;
|
fsWatcherEnabled = true;
|
||||||
};
|
};
|
||||||
"rhapsody-in-green_temp" = {
|
"rhapsody-in-green_temp" = {
|
||||||
path = "${vars.syncthing}/rhapsody-in-green_temp";
|
path = "${vars.storage_syncthing}/rhapsody-in-green_temp";
|
||||||
devices = [
|
devices = [
|
||||||
"rhapsody-in-green"
|
"rhapsody-in-green"
|
||||||
];
|
];
|
||||||
@@ -72,7 +71,7 @@ in
|
|||||||
fsWatcherEnabled = true;
|
fsWatcherEnabled = true;
|
||||||
};
|
};
|
||||||
"backup" = {
|
"backup" = {
|
||||||
path = "${vars.syncthing}/backup";
|
path = "${vars.storage_syncthing}/backup";
|
||||||
devices = [
|
devices = [
|
||||||
"davids-server"
|
"davids-server"
|
||||||
];
|
];
|
||||||
@@ -81,7 +80,7 @@ in
|
|||||||
#
|
#
|
||||||
"davids-backup1" = {
|
"davids-backup1" = {
|
||||||
id = "8229p-8z3tm"; # cspell:disable-line
|
id = "8229p-8z3tm"; # cspell:disable-line
|
||||||
path = "${vars.syncthing}/davids_backups/1";
|
path = "${vars.storage_syncthing}/davids_backups/1";
|
||||||
devices = [
|
devices = [
|
||||||
"davids-server"
|
"davids-server"
|
||||||
];
|
];
|
||||||
@@ -90,7 +89,7 @@ in
|
|||||||
};
|
};
|
||||||
"davids-backup2" = {
|
"davids-backup2" = {
|
||||||
id = "iciw3-dp6ao"; # cspell:disable-line
|
id = "iciw3-dp6ao"; # cspell:disable-line
|
||||||
path = "${vars.syncthing}/davids_backups/2";
|
path = "${vars.storage_syncthing}/davids_backups/2";
|
||||||
devices = [
|
devices = [
|
||||||
"davids-server"
|
"davids-server"
|
||||||
];
|
];
|
||||||
@@ -99,7 +98,7 @@ in
|
|||||||
};
|
};
|
||||||
"davids-backup3" = {
|
"davids-backup3" = {
|
||||||
id = "9si6m-bnkjb"; # cspell:disable-line
|
id = "9si6m-bnkjb"; # cspell:disable-line
|
||||||
path = "${vars.syncthing}/davids_backups/3";
|
path = "${vars.storage_syncthing}/davids_backups/3";
|
||||||
devices = [
|
devices = [
|
||||||
"davids-server"
|
"davids-server"
|
||||||
];
|
];
|
||||||
@@ -108,7 +107,7 @@ in
|
|||||||
};
|
};
|
||||||
"davids-backup4" = {
|
"davids-backup4" = {
|
||||||
id = "qjyfy-uupj4"; # cspell:disable-line
|
id = "qjyfy-uupj4"; # cspell:disable-line
|
||||||
path = "${vars.syncthing}/davids_backups/4";
|
path = "${vars.storage_syncthing}/davids_backups/4";
|
||||||
devices = [
|
devices = [
|
||||||
"davids-server"
|
"davids-server"
|
||||||
];
|
];
|
||||||
@@ -117,7 +116,7 @@ in
|
|||||||
};
|
};
|
||||||
"davids-backup5" = {
|
"davids-backup5" = {
|
||||||
id = "fm4h5-emsu2"; # cspell:disable-line
|
id = "fm4h5-emsu2"; # cspell:disable-line
|
||||||
path = "${vars.syncthing}/davids_backups/5";
|
path = "${vars.storage_syncthing}/davids_backups/5";
|
||||||
devices = [
|
devices = [
|
||||||
"davids-server"
|
"davids-server"
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,21 +1,28 @@
|
|||||||
let
|
let
|
||||||
zfs_media = "/zfs/media";
|
zfs_media = "/zfs/media";
|
||||||
zfs_storage = "/zfs/storage";
|
zfs_storage = "/zfs/storage";
|
||||||
zfs_scratch = "/zfs/scratch";
|
zfs_torrenting = "/zfs/torrenting";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
inherit zfs_media zfs_storage zfs_scratch;
|
inherit zfs_media zfs_storage zfs_torrenting;
|
||||||
database = "${zfs_media}/database";
|
# media
|
||||||
docker = "${zfs_media}/docker";
|
media_database = "${zfs_media}/database";
|
||||||
docker_configs = "${zfs_media}/docker/configs";
|
media_docker = "${zfs_media}/docker";
|
||||||
home_assistant = "${zfs_media}/home_assistant";
|
media_docker_configs = "${zfs_media}/docker/configs";
|
||||||
notes = "${zfs_media}/notes";
|
media_mirror = "${zfs_media}/mirror";
|
||||||
qbitvpn = "${zfs_storage}/qbitvpn";
|
media_share = "${zfs_media}/share";
|
||||||
qbitvpn_scratch = "${zfs_scratch}/qbitvpn";
|
media_services = "${zfs_media}/services";
|
||||||
secrets = "${zfs_storage}/secrets";
|
media_notes = "${zfs_media}/notes";
|
||||||
services = "${zfs_media}/services";
|
media_plex = "${zfs_media}/plex";
|
||||||
share = "${zfs_media}/share";
|
media_home_assistant = "${zfs_media}/home_assistant";
|
||||||
syncthing = "${zfs_storage}/syncthing";
|
# storage
|
||||||
transmission = "${zfs_storage}/transmission";
|
storage_main = "${zfs_storage}/main";
|
||||||
transmission_scratch = "${zfs_scratch}/transmission";
|
storage_photos = "${zfs_storage}/photos";
|
||||||
|
storage_plex = "${zfs_storage}/plex";
|
||||||
|
storage_secrets = "${zfs_storage}/secrets";
|
||||||
|
storage_syncthing = "${zfs_storage}/syncthing";
|
||||||
|
storage_library = "${zfs_storage}/library";
|
||||||
|
# torrenting
|
||||||
|
torrenting_qbit = "${zfs_torrenting}/qbit";
|
||||||
|
torrenting_qbitvpn = "${zfs_torrenting}/qbitvpn";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,682 +0,0 @@
|
|||||||
"""Install NixOS on a ZFS pool."""
|
|
||||||
|
|
||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
import curses
|
|
||||||
import logging
|
|
||||||
import sys
|
|
||||||
from collections import defaultdict
|
|
||||||
from os import getenv
|
|
||||||
from pathlib import Path
|
|
||||||
from random import getrandbits
|
|
||||||
from subprocess import PIPE, Popen, run
|
|
||||||
from time import sleep
|
|
||||||
from typing import TYPE_CHECKING
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
|
||||||
from collections.abc import Sequence
|
|
||||||
|
|
||||||
|
|
||||||
def configure_logger(level: str = "INFO") -> None:
|
|
||||||
"""Configure the logger.
|
|
||||||
Args:
|
|
||||||
level (str, optional): The logging level. Defaults to "INFO".
|
|
||||||
"""
|
|
||||||
logging.basicConfig(
|
|
||||||
level=level,
|
|
||||||
datefmt="%Y-%m-%dT%H:%M:%S%z",
|
|
||||||
format="%(asctime)s %(levelname)s %(filename)s:%(lineno)d - %(message)s",
|
|
||||||
handlers=[logging.StreamHandler(sys.stdout)],
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def bash_wrapper(command: str) -> str:
|
|
||||||
"""Execute a bash command and capture the output.
|
|
||||||
Args:
|
|
||||||
command (str): The bash command to be executed.
|
|
||||||
Returns:
|
|
||||||
Tuple[str, int]: A tuple containing the output of the command (stdout) as a string,
|
|
||||||
the error output (stderr) as a string (optional), and the return code as an integer.
|
|
||||||
"""
|
|
||||||
logging.debug(f"running {command=}")
|
|
||||||
# This is a acceptable risk
|
|
||||||
process = Popen(command.split(), stdout=PIPE, stderr=PIPE) # noqa: S603
|
|
||||||
output, _ = process.communicate()
|
|
||||||
if process.returncode != 0:
|
|
||||||
error = f"Failed to run command {command=} return code {process.returncode=}"
|
|
||||||
raise RuntimeError(error)
|
|
||||||
|
|
||||||
return output.decode()
|
|
||||||
|
|
||||||
|
|
||||||
def partition_disk(disk: str, swap_size: int, reserve: int = 0) -> None:
|
|
||||||
"""Partition a disk.
|
|
||||||
Args:
|
|
||||||
disk (str): The disk to partition.
|
|
||||||
swap_size (int): The size of the swap partition in GB.
|
|
||||||
minimum value is 1.
|
|
||||||
reserve (int, optional): The size of the reserve partition in GB. Defaults to 0.
|
|
||||||
minimum value is 0.
|
|
||||||
"""
|
|
||||||
logging.info(f"partitioning {disk=}")
|
|
||||||
swap_size = max(swap_size, 1)
|
|
||||||
reserve = max(reserve, 0)
|
|
||||||
|
|
||||||
bash_wrapper(f"blkdiscard -f {disk}")
|
|
||||||
|
|
||||||
if reserve > 0:
|
|
||||||
msg = f"Creating swap partition on {disk=} with size {swap_size=}GiB and reserve {reserve=}GiB"
|
|
||||||
logging.info(msg)
|
|
||||||
|
|
||||||
swap_start = swap_size + reserve
|
|
||||||
swap_partition = f"mkpart swap -{swap_start}GiB -{reserve}GiB "
|
|
||||||
else:
|
|
||||||
logging.info(f"Creating swap partition on {disk=} with size {swap_size=}GiB")
|
|
||||||
swap_start = swap_size
|
|
||||||
swap_partition = f"mkpart swap -{swap_start}GiB 100% "
|
|
||||||
|
|
||||||
logging.debug(f"{swap_partition=}")
|
|
||||||
|
|
||||||
create_partitions = (
|
|
||||||
f"parted --script --align=optimal {disk} -- "
|
|
||||||
"mklabel gpt "
|
|
||||||
"mkpart EFI 1MiB 4GiB "
|
|
||||||
f"mkpart root_pool 4GiB -{swap_start}GiB "
|
|
||||||
f"{swap_partition}"
|
|
||||||
"set 1 esp on"
|
|
||||||
)
|
|
||||||
bash_wrapper(create_partitions)
|
|
||||||
|
|
||||||
logging.info(f"{disk=} successfully partitioned")
|
|
||||||
|
|
||||||
|
|
||||||
def create_zfs_pool(pool_disks: Sequence[str], mnt_dir: str) -> None:
|
|
||||||
"""Create a ZFS pool.
|
|
||||||
Args:
|
|
||||||
disks (Sequence[str]): A tuple of disks to use for the pool.
|
|
||||||
mnt_dir (str): The mount directory.
|
|
||||||
"""
|
|
||||||
if len(pool_disks) <= 0:
|
|
||||||
error = "disks must be a tuple of at least length 1"
|
|
||||||
raise ValueError(error)
|
|
||||||
|
|
||||||
zpool_create = (
|
|
||||||
"zpool create "
|
|
||||||
"-o ashift=12 "
|
|
||||||
"-o autotrim=on "
|
|
||||||
f"-R {mnt_dir} "
|
|
||||||
"-O acltype=posixacl "
|
|
||||||
"-O canmount=off "
|
|
||||||
"-O dnodesize=auto "
|
|
||||||
"-O normalization=formD "
|
|
||||||
"-O relatime=on "
|
|
||||||
"-O xattr=sa "
|
|
||||||
"-O mountpoint=legacy "
|
|
||||||
"-O compression=zstd "
|
|
||||||
"-O atime=off "
|
|
||||||
"root_pool "
|
|
||||||
)
|
|
||||||
if len(pool_disks) == 1:
|
|
||||||
zpool_create += pool_disks[0]
|
|
||||||
else:
|
|
||||||
zpool_create += "mirror "
|
|
||||||
zpool_create += " ".join(pool_disks)
|
|
||||||
|
|
||||||
bash_wrapper(zpool_create)
|
|
||||||
zpools = bash_wrapper("zpool list -o name")
|
|
||||||
if "root_pool" not in zpools.splitlines():
|
|
||||||
logging.critical("Failed to create root_pool")
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
|
|
||||||
def create_zfs_datasets() -> None:
|
|
||||||
"""Create ZFS datasets."""
|
|
||||||
|
|
||||||
bash_wrapper("zfs create -o canmount=noauto -o reservation=10G root_pool/root")
|
|
||||||
bash_wrapper("zfs create root_pool/home")
|
|
||||||
bash_wrapper("zfs create root_pool/var -o reservation=1G")
|
|
||||||
bash_wrapper("zfs create -o compression=zstd-9 -o reservation=10G root_pool/nix")
|
|
||||||
datasets = bash_wrapper("zfs list -o name")
|
|
||||||
|
|
||||||
expected_datasets = {
|
|
||||||
"root_pool/root",
|
|
||||||
"root_pool/home",
|
|
||||||
"root_pool/var",
|
|
||||||
"root_pool/nix",
|
|
||||||
}
|
|
||||||
missing_datasets = expected_datasets.difference(datasets.splitlines())
|
|
||||||
if missing_datasets:
|
|
||||||
logging.critical(f"Failed to create pools {missing_datasets}")
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
|
|
||||||
def get_cpu_manufacturer() -> str:
|
|
||||||
"""Get the CPU manufacturer."""
|
|
||||||
output = bash_wrapper("cat /proc/cpuinfo")
|
|
||||||
|
|
||||||
id_vendor = {"AuthenticAMD": "amd", "GenuineIntel": "intel"}
|
|
||||||
|
|
||||||
for line in output.splitlines():
|
|
||||||
if "vendor_id" in line:
|
|
||||||
return id_vendor[line.split(": ")[1].strip()]
|
|
||||||
|
|
||||||
|
|
||||||
def get_boot_drive_id(disk: str) -> str:
|
|
||||||
"""Get the boot drive ID."""
|
|
||||||
output = bash_wrapper(f"lsblk -o UUID {disk}-part1")
|
|
||||||
return output.splitlines()[1]
|
|
||||||
|
|
||||||
|
|
||||||
def create_nix_hardware_file(mnt_dir: str, disks: Sequence[str], encrypt: bool) -> None:
|
|
||||||
"""Create a NixOS hardware file."""
|
|
||||||
|
|
||||||
cpu_manufacturer = get_cpu_manufacturer()
|
|
||||||
|
|
||||||
devices = ""
|
|
||||||
if encrypt:
|
|
||||||
disk = disks[0]
|
|
||||||
|
|
||||||
devices = (
|
|
||||||
f' luks.devices."luks-root-pool-{disk.split("/")[-1]}-part2"'
|
|
||||||
"= {\n"
|
|
||||||
f' device = "{disk}-part2";\n'
|
|
||||||
" bypassWorkqueues = true;\n"
|
|
||||||
" allowDiscards = true;\n"
|
|
||||||
" };\n"
|
|
||||||
)
|
|
||||||
|
|
||||||
host_id = format(getrandbits(32), "08x")
|
|
||||||
|
|
||||||
nix_hardware = (
|
|
||||||
"{ config, lib, modulesPath, ... }:\n"
|
|
||||||
"{\n"
|
|
||||||
' imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];\n\n'
|
|
||||||
" boot = {\n"
|
|
||||||
" initrd = {\n"
|
|
||||||
' availableKernelModules = [ \n "ahci"\n "ehci_pci"\n "nvme"\n "sd_mod"\n "usb_storage"\n "usbhid"\n "xhci_pci"\n ];\n'
|
|
||||||
" kernelModules = [ ];\n"
|
|
||||||
f" {devices}"
|
|
||||||
" };\n"
|
|
||||||
f' kernelModules = [ "kvm-{cpu_manufacturer}" ];\n'
|
|
||||||
" extraModulePackages = [ ];\n"
|
|
||||||
" };\n\n"
|
|
||||||
" fileSystems = {\n"
|
|
||||||
' "/" = lib.mkDefault {\n device = "root_pool/root";\n fsType = "zfs";\n };\n\n'
|
|
||||||
' "/home" = {\n device = "root_pool/home";\n fsType = "zfs";\n };\n\n'
|
|
||||||
' "/var" = {\n device = "root_pool/var";\n fsType = "zfs";\n };\n\n'
|
|
||||||
' "/nix" = {\n device = "root_pool/nix";\n fsType = "zfs";\n };\n\n'
|
|
||||||
' "/boot" = {\n'
|
|
||||||
f' device = "/dev/disk/by-uuid/{get_boot_drive_id(disks[0])}";\n'
|
|
||||||
' fsType = "vfat";\n options = [\n "fmask=0077"\n "dmask=0077"\n ];\n };\n };\n\n'
|
|
||||||
" swapDevices = [ ];\n\n"
|
|
||||||
" networking.useDHCP = lib.mkDefault true;\n\n"
|
|
||||||
' nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";\n'
|
|
||||||
f" hardware.cpu.{cpu_manufacturer}.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;\n"
|
|
||||||
f' networking.hostId = "{host_id}";\n'
|
|
||||||
"}\n"
|
|
||||||
)
|
|
||||||
|
|
||||||
Path(f"{mnt_dir}/etc/nixos/hardware-configuration.nix").write_text(nix_hardware)
|
|
||||||
|
|
||||||
|
|
||||||
def install_nixos(mnt_dir: str, disks: Sequence[str], encrypt: bool) -> None:
|
|
||||||
"""Install NixOS."""
|
|
||||||
bash_wrapper(f"mount -o X-mount.mkdir -t zfs root_pool/root {mnt_dir}")
|
|
||||||
bash_wrapper(f"mount -o X-mount.mkdir -t zfs root_pool/home {mnt_dir}/home")
|
|
||||||
bash_wrapper(f"mount -o X-mount.mkdir -t zfs root_pool/var {mnt_dir}/var")
|
|
||||||
bash_wrapper(f"mount -o X-mount.mkdir -t zfs root_pool/nix {mnt_dir}/nix")
|
|
||||||
|
|
||||||
for disk in disks:
|
|
||||||
bash_wrapper(f"mkfs.vfat -n EFI {disk}-part1")
|
|
||||||
|
|
||||||
# set up mirroring afterwards if more than one disk
|
|
||||||
boot_partition = f"mount -t vfat -o fmask=0077,dmask=0077,iocharset=iso8859-1,X-mount.mkdir {disks[0]}-part1 {mnt_dir}/boot"
|
|
||||||
bash_wrapper(boot_partition)
|
|
||||||
|
|
||||||
bash_wrapper(f"nixos-generate-config --root {mnt_dir}")
|
|
||||||
|
|
||||||
create_nix_hardware_file(mnt_dir, disks, encrypt)
|
|
||||||
|
|
||||||
run(("nixos-install", "--root", mnt_dir), check=True) # noqa: S603
|
|
||||||
|
|
||||||
|
|
||||||
def installer(
|
|
||||||
disks: set[str],
|
|
||||||
swap_size: int,
|
|
||||||
reserve: int,
|
|
||||||
encrypt_key: str | None,
|
|
||||||
) -> None:
|
|
||||||
"""Main."""
|
|
||||||
logging.info("Starting installation")
|
|
||||||
|
|
||||||
for disk in disks:
|
|
||||||
partition_disk(disk, swap_size, reserve)
|
|
||||||
|
|
||||||
if encrypt_key:
|
|
||||||
sleep(1)
|
|
||||||
for command in (
|
|
||||||
f'printf "{encrypt_key}" | cryptsetup luksFormat --type luks2 {disk}-part2 -',
|
|
||||||
f'printf "{encrypt_key}" | cryptsetup luksOpen {disk}-part2 luks-root-pool-{disk.split("/")[-1]}-part2 -',
|
|
||||||
):
|
|
||||||
run(command, shell=True, check=True)
|
|
||||||
|
|
||||||
mnt_dir = "/tmp/nix_install" # noqa: S108
|
|
||||||
|
|
||||||
Path(mnt_dir).mkdir(parents=True, exist_ok=True)
|
|
||||||
|
|
||||||
if encrypt_key:
|
|
||||||
pool_disks = [
|
|
||||||
f"/dev/mapper/luks-root-pool-{disk.split('/')[-1]}-part2" for disk in disks
|
|
||||||
]
|
|
||||||
else:
|
|
||||||
pool_disks = [f"{disk}-part2" for disk in disks]
|
|
||||||
|
|
||||||
create_zfs_pool(pool_disks, mnt_dir)
|
|
||||||
|
|
||||||
create_zfs_datasets()
|
|
||||||
|
|
||||||
install_nixos(mnt_dir, disks, encrypt_key)
|
|
||||||
|
|
||||||
logging.info("Installation complete")
|
|
||||||
|
|
||||||
|
|
||||||
class Cursor:
|
|
||||||
def __init__(self):
|
|
||||||
self.x_position = 0
|
|
||||||
self.y_position = 0
|
|
||||||
self.height = 0
|
|
||||||
self.width = 0
|
|
||||||
|
|
||||||
def set_height(self, height: int):
|
|
||||||
self.height = height
|
|
||||||
|
|
||||||
def set_width(self, width: int):
|
|
||||||
self.width = width
|
|
||||||
|
|
||||||
def x_bounce_check(self, cursor: int) -> int:
|
|
||||||
cursor = max(0, cursor)
|
|
||||||
return min(self.width - 1, cursor)
|
|
||||||
|
|
||||||
def y_bounce_check(self, cursor: int) -> int:
|
|
||||||
cursor = max(0, cursor)
|
|
||||||
return min(self.height - 1, cursor)
|
|
||||||
|
|
||||||
def set_x(self, x: int):
|
|
||||||
self.x_position = self.x_bounce_check(x)
|
|
||||||
|
|
||||||
def set_y(self, y: int):
|
|
||||||
self.y_position = self.y_bounce_check(y)
|
|
||||||
|
|
||||||
def get_x(self) -> int:
|
|
||||||
return self.x_position
|
|
||||||
|
|
||||||
def get_y(self) -> int:
|
|
||||||
return self.y_position
|
|
||||||
|
|
||||||
def move_up(self):
|
|
||||||
self.set_y(self.y_position - 1)
|
|
||||||
|
|
||||||
def move_down(self):
|
|
||||||
self.set_y(self.y_position + 1)
|
|
||||||
|
|
||||||
def move_left(self):
|
|
||||||
self.set_x(self.x_position - 1)
|
|
||||||
|
|
||||||
def move_right(self):
|
|
||||||
self.set_x(self.x_position + 1)
|
|
||||||
|
|
||||||
def navigation(self, key: int) -> None:
|
|
||||||
action = {
|
|
||||||
curses.KEY_DOWN: self.move_down,
|
|
||||||
curses.KEY_UP: self.move_up,
|
|
||||||
curses.KEY_RIGHT: self.move_right,
|
|
||||||
curses.KEY_LEFT: self.move_left,
|
|
||||||
}
|
|
||||||
|
|
||||||
action.get(key, lambda: None)()
|
|
||||||
|
|
||||||
|
|
||||||
class State:
|
|
||||||
"""State class to store the state of the program."""
|
|
||||||
|
|
||||||
def __init__(self):
|
|
||||||
self.key = 0
|
|
||||||
self.cursor = Cursor()
|
|
||||||
|
|
||||||
self.swap_size = 0
|
|
||||||
self.show_swap_input = False
|
|
||||||
|
|
||||||
self.reserve_size = 0
|
|
||||||
self.show_reserve_input = False
|
|
||||||
|
|
||||||
self.selected_device_ids = set()
|
|
||||||
|
|
||||||
def get_selected_devices(self) -> tuple[str]:
|
|
||||||
"""Get selected devices."""
|
|
||||||
return tuple(self.selected_device_ids)
|
|
||||||
|
|
||||||
|
|
||||||
def get_device(raw_device: str) -> dict[str, str]:
|
|
||||||
raw_device_components = raw_device.split(" ")
|
|
||||||
return {
|
|
||||||
thing.split("=")[0].lower(): thing.split("=")[1].strip('"')
|
|
||||||
for thing in raw_device_components
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def get_devices() -> list[dict[str, str]]:
|
|
||||||
"""Get a list of devices."""
|
|
||||||
# --bytes
|
|
||||||
raw_devices = bash_wrapper("lsblk --paths --pairs").splitlines()
|
|
||||||
return [get_device(raw_device) for raw_device in raw_devices]
|
|
||||||
|
|
||||||
|
|
||||||
def get_device_id_mapping() -> dict[str, set[str]]:
|
|
||||||
"""Get a list of device ids.
|
|
||||||
Returns:
|
|
||||||
list[str]: the list of device ids
|
|
||||||
"""
|
|
||||||
device_ids = bash_wrapper("find /dev/disk/by-id -type l").splitlines()
|
|
||||||
|
|
||||||
device_id_mapping: dict[str, set[str]] = defaultdict(set)
|
|
||||||
|
|
||||||
for device_id in device_ids:
|
|
||||||
device = bash_wrapper(f"readlink -f {device_id}").strip()
|
|
||||||
device_id_mapping[device].add(device_id)
|
|
||||||
|
|
||||||
return device_id_mapping
|
|
||||||
|
|
||||||
|
|
||||||
def calculate_device_menu_padding(
|
|
||||||
devices: list[dict[str, str]], column: str, padding: int = 0
|
|
||||||
) -> int:
|
|
||||||
return max(len(device[column]) for device in devices) + padding
|
|
||||||
|
|
||||||
|
|
||||||
def draw_device_ids(
|
|
||||||
state: State,
|
|
||||||
row_number: int,
|
|
||||||
menu_start_x: int,
|
|
||||||
std_screen: curses.window,
|
|
||||||
menu_width: list[int],
|
|
||||||
device_ids: set[str],
|
|
||||||
) -> tuple[State, int]:
|
|
||||||
for device_id in sorted(device_ids):
|
|
||||||
row_number = row_number + 1
|
|
||||||
if row_number == state.cursor.get_y() and state.cursor.get_x() in menu_width:
|
|
||||||
std_screen.attron(curses.A_BOLD)
|
|
||||||
if state.key == ord(" "):
|
|
||||||
if device_id not in state.selected_device_ids:
|
|
||||||
state.selected_device_ids.add(device_id)
|
|
||||||
else:
|
|
||||||
state.selected_device_ids.remove(device_id)
|
|
||||||
|
|
||||||
if device_id in state.selected_device_ids:
|
|
||||||
std_screen.attron(curses.color_pair(7))
|
|
||||||
|
|
||||||
std_screen.addstr(row_number, menu_start_x, f" {device_id}")
|
|
||||||
|
|
||||||
std_screen.attroff(curses.color_pair(7))
|
|
||||||
std_screen.attroff(curses.A_BOLD)
|
|
||||||
|
|
||||||
return state, row_number
|
|
||||||
|
|
||||||
|
|
||||||
def draw_device_menu(
|
|
||||||
std_screen: curses.window,
|
|
||||||
devices: list[dict[str, str]],
|
|
||||||
device_id_mapping: dict[str, set[str]],
|
|
||||||
state: State,
|
|
||||||
menu_start_y: int = 0,
|
|
||||||
menu_start_x: int = 0,
|
|
||||||
) -> State:
|
|
||||||
"""draw the device menu and handle user input
|
|
||||||
Args:
|
|
||||||
std_screen (curses.window): the curses window to draw on
|
|
||||||
devices (list[dict[str, str]]): the list of devices to draw
|
|
||||||
device_id_mapping (dict[str, set[str]]): the list of device ids to draw
|
|
||||||
state (State): the state object to update
|
|
||||||
menu_start_y (int, optional): the y position to start drawing the menu. Defaults to 0.
|
|
||||||
menu_start_x (int, optional): the x position to start drawing the menu. Defaults to 0.
|
|
||||||
Returns:
|
|
||||||
State: the updated state object
|
|
||||||
"""
|
|
||||||
padding = 2
|
|
||||||
|
|
||||||
name_padding = calculate_device_menu_padding(devices, "name", padding)
|
|
||||||
size_padding = calculate_device_menu_padding(devices, "size", padding)
|
|
||||||
type_padding = calculate_device_menu_padding(devices, "type", padding)
|
|
||||||
mountpoints_padding = calculate_device_menu_padding(devices, "mountpoints", padding)
|
|
||||||
|
|
||||||
device_header = f"{'Name':{name_padding}}{'Size':{size_padding}}{'Type':{type_padding}}{'Mountpoints':{mountpoints_padding}}"
|
|
||||||
|
|
||||||
menu_width = range(menu_start_x, len(device_header) + menu_start_x)
|
|
||||||
|
|
||||||
std_screen.addstr(menu_start_y, menu_start_x, device_header, curses.color_pair(5))
|
|
||||||
devises_list_start = menu_start_y + 1
|
|
||||||
|
|
||||||
row_number = devises_list_start
|
|
||||||
|
|
||||||
for device in devices:
|
|
||||||
row_number = row_number + 1
|
|
||||||
device_name = device["name"]
|
|
||||||
device_row = (
|
|
||||||
f"{device_name:{name_padding}}"
|
|
||||||
f"{device['size']:{size_padding}}"
|
|
||||||
f"{device['type']:{type_padding}}"
|
|
||||||
f"{device['mountpoints']:{mountpoints_padding}}"
|
|
||||||
)
|
|
||||||
std_screen.addstr(row_number, menu_start_x, device_row)
|
|
||||||
|
|
||||||
state, row_number = draw_device_ids(
|
|
||||||
state=state,
|
|
||||||
row_number=row_number,
|
|
||||||
menu_start_x=menu_start_x,
|
|
||||||
std_screen=std_screen,
|
|
||||||
menu_width=menu_width,
|
|
||||||
device_ids=device_id_mapping[device_name],
|
|
||||||
)
|
|
||||||
|
|
||||||
return state, row_number
|
|
||||||
|
|
||||||
|
|
||||||
def debug_menu(std_screen: curses.window, key: int) -> None:
|
|
||||||
height, width = std_screen.getmaxyx()
|
|
||||||
width_height = "Width: {}, Height: {}".format(width, height)
|
|
||||||
std_screen.addstr(height - 4, 0, width_height, curses.color_pair(5))
|
|
||||||
|
|
||||||
key_pressed = f"Last key pressed: {key}"[: width - 1]
|
|
||||||
if key == 0:
|
|
||||||
key_pressed = "No key press detected..."[: width - 1]
|
|
||||||
std_screen.addstr(height - 3, 0, key_pressed)
|
|
||||||
|
|
||||||
for i in range(0, 8):
|
|
||||||
std_screen.addstr(height - 2, i * 3, f"{i}██", curses.color_pair(i))
|
|
||||||
|
|
||||||
|
|
||||||
def status_bar(
|
|
||||||
std_screen: curses.window,
|
|
||||||
cursor: Cursor,
|
|
||||||
width: int,
|
|
||||||
height: int,
|
|
||||||
) -> None:
|
|
||||||
std_screen.attron(curses.A_REVERSE)
|
|
||||||
std_screen.attron(curses.color_pair(3))
|
|
||||||
|
|
||||||
status_bar = (
|
|
||||||
f"Press 'q' to exit | STATUS BAR | Pos: {cursor.get_x()}, {cursor.get_y()}"
|
|
||||||
)
|
|
||||||
std_screen.addstr(height - 1, 0, status_bar)
|
|
||||||
std_screen.addstr(height - 1, len(status_bar), " " * (width - len(status_bar) - 1))
|
|
||||||
|
|
||||||
std_screen.attroff(curses.color_pair(3))
|
|
||||||
std_screen.attroff(curses.A_REVERSE)
|
|
||||||
|
|
||||||
|
|
||||||
def set_color() -> None:
|
|
||||||
curses.start_color()
|
|
||||||
curses.use_default_colors()
|
|
||||||
for i in range(0, curses.COLORS):
|
|
||||||
curses.init_pair(i + 1, i, -1)
|
|
||||||
|
|
||||||
|
|
||||||
def get_text_input(std_screen: curses.window, prompt: str, y: int, x: int) -> str:
|
|
||||||
curses.echo()
|
|
||||||
std_screen.addstr(y, x, prompt)
|
|
||||||
input_str = ""
|
|
||||||
while True:
|
|
||||||
key = std_screen.getch()
|
|
||||||
if key == ord("\n"):
|
|
||||||
break
|
|
||||||
elif key == 27: # ESC key
|
|
||||||
input_str = ""
|
|
||||||
break
|
|
||||||
elif key in (curses.KEY_BACKSPACE, ord("\b"), 127):
|
|
||||||
input_str = input_str[:-1]
|
|
||||||
std_screen.addstr(y, x + len(prompt), input_str + " ")
|
|
||||||
else:
|
|
||||||
input_str += chr(key)
|
|
||||||
std_screen.refresh()
|
|
||||||
curses.noecho()
|
|
||||||
return input_str
|
|
||||||
|
|
||||||
|
|
||||||
def swap_size_input(
|
|
||||||
std_screen: curses.window,
|
|
||||||
state: State,
|
|
||||||
swap_offset: int,
|
|
||||||
) -> State:
|
|
||||||
swap_size_text = "Swap size (GB): "
|
|
||||||
std_screen.addstr(swap_offset, 0, f"{swap_size_text}{state.swap_size}")
|
|
||||||
if state.key == ord("\n") and state.cursor.get_y() == swap_offset:
|
|
||||||
state.show_swap_input = True
|
|
||||||
|
|
||||||
if state.show_swap_input:
|
|
||||||
swap_size_str = get_text_input(std_screen, swap_size_text, swap_offset, 0)
|
|
||||||
try:
|
|
||||||
state.swap_size = int(swap_size_str)
|
|
||||||
state.show_swap_input = False
|
|
||||||
except ValueError:
|
|
||||||
std_screen.addstr(
|
|
||||||
swap_offset, 0, "Invalid input. Press any key to continue."
|
|
||||||
)
|
|
||||||
std_screen.getch()
|
|
||||||
state.show_swap_input = False
|
|
||||||
|
|
||||||
return state
|
|
||||||
|
|
||||||
|
|
||||||
def reserve_size_input(
|
|
||||||
std_screen: curses.window,
|
|
||||||
state: State,
|
|
||||||
reserve_offset: int,
|
|
||||||
) -> State:
|
|
||||||
reserve_size_text = "reserve size (GB): "
|
|
||||||
std_screen.addstr(reserve_offset, 0, f"{reserve_size_text}{state.reserve_size}")
|
|
||||||
if state.key == ord("\n") and state.cursor.get_y() == reserve_offset:
|
|
||||||
state.show_reserve_input = True
|
|
||||||
|
|
||||||
if state.show_reserve_input:
|
|
||||||
reserve_size_str = get_text_input(
|
|
||||||
std_screen, reserve_size_text, reserve_offset, 0
|
|
||||||
)
|
|
||||||
try:
|
|
||||||
state.reserve_size = int(reserve_size_str)
|
|
||||||
state.show_reserve_input = False
|
|
||||||
except ValueError:
|
|
||||||
std_screen.addstr(
|
|
||||||
reserve_offset, 0, "Invalid input. Press any key to continue."
|
|
||||||
)
|
|
||||||
std_screen.getch()
|
|
||||||
state.show_reserve_input = False
|
|
||||||
|
|
||||||
return state
|
|
||||||
|
|
||||||
|
|
||||||
def draw_menu(std_screen: curses.window) -> State:
|
|
||||||
"""draw the menu and handle user input
|
|
||||||
Args:
|
|
||||||
std_screen (curses.window): the curses window to draw on
|
|
||||||
Returns:
|
|
||||||
State: the state object
|
|
||||||
"""
|
|
||||||
# Clear and refresh the screen for a blank canvas
|
|
||||||
std_screen.clear()
|
|
||||||
std_screen.refresh()
|
|
||||||
|
|
||||||
set_color()
|
|
||||||
|
|
||||||
state = State()
|
|
||||||
|
|
||||||
devices = get_devices()
|
|
||||||
|
|
||||||
device_id_mapping = get_device_id_mapping()
|
|
||||||
|
|
||||||
# Loop where k is the last character pressed
|
|
||||||
while state.key != ord("q"):
|
|
||||||
std_screen.clear()
|
|
||||||
height, width = std_screen.getmaxyx()
|
|
||||||
|
|
||||||
state.cursor.set_height(height)
|
|
||||||
state.cursor.set_width(width)
|
|
||||||
|
|
||||||
state.cursor.navigation(state.key)
|
|
||||||
|
|
||||||
state, device_menu_size = draw_device_menu(
|
|
||||||
std_screen=std_screen,
|
|
||||||
state=state,
|
|
||||||
devices=devices,
|
|
||||||
device_id_mapping=device_id_mapping,
|
|
||||||
)
|
|
||||||
|
|
||||||
swap_offset = device_menu_size + 2
|
|
||||||
|
|
||||||
swap_size_input(
|
|
||||||
std_screen=std_screen,
|
|
||||||
state=state,
|
|
||||||
swap_offset=swap_offset,
|
|
||||||
)
|
|
||||||
reserve_size_input(
|
|
||||||
std_screen=std_screen,
|
|
||||||
state=state,
|
|
||||||
reserve_offset=swap_offset + 1,
|
|
||||||
)
|
|
||||||
|
|
||||||
status_bar(std_screen, state.cursor, width, height)
|
|
||||||
|
|
||||||
debug_menu(std_screen, state.key)
|
|
||||||
|
|
||||||
std_screen.move(state.cursor.get_y(), state.cursor.get_x())
|
|
||||||
|
|
||||||
std_screen.refresh()
|
|
||||||
|
|
||||||
state.key = std_screen.getch()
|
|
||||||
|
|
||||||
return state
|
|
||||||
|
|
||||||
|
|
||||||
def main() -> None:
|
|
||||||
configure_logger("DEBUG")
|
|
||||||
|
|
||||||
state = curses.wrapper(draw_menu)
|
|
||||||
|
|
||||||
encrypt_key = getenv("ENCRYPT_KEY")
|
|
||||||
|
|
||||||
logging.info("installing_nixos")
|
|
||||||
logging.info(f"disks: {state.selected_device_ids}")
|
|
||||||
logging.info(f"swap_size: {state.swap_size}")
|
|
||||||
logging.info(f"reserve: {state.reserve_size}")
|
|
||||||
logging.info(f"encrypted: {bool(encrypt_key)}")
|
|
||||||
|
|
||||||
sleep(3)
|
|
||||||
|
|
||||||
installer(
|
|
||||||
disks=state.get_selected_devices(),
|
|
||||||
swap_size=state.swap_size,
|
|
||||||
reserve=state.reserve_size,
|
|
||||||
encrypt_key=encrypt_key,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
||||||
250
users/gaming/home/firefox.nix
Normal file
250
users/gaming/home/firefox.nix
Normal file
@@ -0,0 +1,250 @@
|
|||||||
|
{ inputs, ... }:
|
||||||
|
{
|
||||||
|
programs.firefox = {
|
||||||
|
enable = true;
|
||||||
|
profiles.richie = {
|
||||||
|
extensions = with inputs.firefox-addons.packages.x86_64-linux; [
|
||||||
|
bitwarden
|
||||||
|
darkreader
|
||||||
|
dearrow
|
||||||
|
fastforwardteam
|
||||||
|
return-youtube-dislikes
|
||||||
|
sponsorblock
|
||||||
|
ublock-origin
|
||||||
|
];
|
||||||
|
search = {
|
||||||
|
force = true;
|
||||||
|
default = "Google";
|
||||||
|
order = [ "Google" ];
|
||||||
|
};
|
||||||
|
settings = {
|
||||||
|
|
||||||
|
# SECTION: FASTFOX
|
||||||
|
# GENERAL
|
||||||
|
"content.notify.interval" = 100000;
|
||||||
|
|
||||||
|
# GFX
|
||||||
|
"gfx.canvas.accelerated.cache-items" = 4096;
|
||||||
|
"gfx.canvas.accelerated.cache-size" = 512;
|
||||||
|
"gfx.content.skia-font-cache-size" = 20;
|
||||||
|
|
||||||
|
# DISK CACHE
|
||||||
|
"browser.cache.jsbc_compression_level" = 3;
|
||||||
|
|
||||||
|
# MEDIA CACHE
|
||||||
|
"media.memory_cache_max_size" = 65536;
|
||||||
|
"media.cache_readahead_limit" = 7200;
|
||||||
|
"media.cache_resume_threshold" = 3600;
|
||||||
|
|
||||||
|
# IMAGE CACHE
|
||||||
|
"image.mem.decode_bytes_at_a_time" = 32768;
|
||||||
|
|
||||||
|
# NETWORK
|
||||||
|
"network.buffer.cache.size" = 262144;
|
||||||
|
"network.buffer.cache.count" = 128;
|
||||||
|
"network.http.max-connections" = 1800;
|
||||||
|
"network.http.max-persistent-connections-per-server" = 10;
|
||||||
|
"network.http.max-urgent-start-excessive-connections-per-host" = 5;
|
||||||
|
"network.http.pacing.requests.enabled" = false;
|
||||||
|
"network.dnsCacheExpiration" = 3600;
|
||||||
|
"network.dns.max_high_priority_threads" = 8;
|
||||||
|
"network.ssl_tokens_cache_capacity" = 10240;
|
||||||
|
|
||||||
|
# SPECULATIVE LOADING
|
||||||
|
"network.dns.disablePrefetch" = true;
|
||||||
|
"network.prefetch-next" = false;
|
||||||
|
"network.predictor.enabled" = false;
|
||||||
|
|
||||||
|
# EXPERIMENTAL
|
||||||
|
"layout.css.grid-template-masonry-value.enabled" = true;
|
||||||
|
"dom.enable_web_task_scheduling" = true;
|
||||||
|
"layout.css.has-selector.enabled" = true;
|
||||||
|
"dom.security.sanitizer.enabled" = true;
|
||||||
|
|
||||||
|
# SECTION: SECUREFOX
|
||||||
|
# TRACKING PROTECTION
|
||||||
|
"browser.contentblocking.category" = "strict";
|
||||||
|
"urlclassifier.trackingSkipURLs" = "*.reddit.com, *.twitter.com, *.twimg.com, *.tiktok.com";
|
||||||
|
"urlclassifier.features.socialtracking.skipURLs" = "*.instagram.com, *.twitter.com, *.twimg.com";
|
||||||
|
"network.cookie.sameSite.noneRequiresSecure" = true;
|
||||||
|
"browser.download.start_downloads_in_tmp_dir" = true;
|
||||||
|
"browser.helperApps.deleteTempFileOnExit" = true;
|
||||||
|
"browser.uitour.enabled" = false;
|
||||||
|
"privacy.globalprivacycontrol.enabled" = true;
|
||||||
|
|
||||||
|
# OCSP & CERTS / HPKP
|
||||||
|
"security.OCSP.enabled" = 0;
|
||||||
|
"security.remote_settings.crlite_filters.enabled" = true;
|
||||||
|
"security.pki.crlite_mode" = 2;
|
||||||
|
|
||||||
|
# SSL / TLS
|
||||||
|
"security.ssl.treat_unsafe_negotiation_as_broken" = true;
|
||||||
|
"browser.xul.error_pages.expert_bad_cert" = true;
|
||||||
|
"security.tls.enable_0rtt_data" = false;
|
||||||
|
|
||||||
|
# DISK AVOIDANCE
|
||||||
|
"browser.privatebrowsing.forceMediaMemoryCache" = true;
|
||||||
|
"browser.sessionstore.interval" = 60000;
|
||||||
|
|
||||||
|
# SHUTDOWN & SANITIZING
|
||||||
|
"privacy.history.custom" = true;
|
||||||
|
|
||||||
|
# SEARCH / URL BAR
|
||||||
|
"browser.search.separatePrivateDefault.ui.enabled" = true;
|
||||||
|
"browser.urlbar.update2.engineAliasRefresh" = true;
|
||||||
|
# PREF: restore search engine suggestions
|
||||||
|
"browser.search.suggest.enabled" = true;
|
||||||
|
"browser.urlbar.suggest.quicksuggest.sponsored" = false;
|
||||||
|
"browser.urlbar.suggest.quicksuggest.nonsponsored" = false;
|
||||||
|
"browser.formfill.enable" = false;
|
||||||
|
"security.insecure_connection_text.enabled" = true;
|
||||||
|
"security.insecure_connection_text.pbmode.enabled" = true;
|
||||||
|
"network.IDN_show_punycode" = true;
|
||||||
|
|
||||||
|
# HTTPS-FIRST POLICY
|
||||||
|
"dom.security.https_first" = true;
|
||||||
|
"dom.security.https_first_schemeless" = true;
|
||||||
|
|
||||||
|
# PASSWORDS
|
||||||
|
"signon.formlessCapture.enabled" = false;
|
||||||
|
"signon.rememberSignons" = false;
|
||||||
|
"signon.privateBrowsingCapture.enabled" = false;
|
||||||
|
"network.auth.subresource-http-auth-allow" = 1;
|
||||||
|
"editor.truncate_user_pastes" = false;
|
||||||
|
|
||||||
|
# MIXED CONTENT + CROSS-SITE
|
||||||
|
"security.mixed_content.block_display_content" = true;
|
||||||
|
"security.mixed_content.upgrade_display_content" = true;
|
||||||
|
"security.mixed_content.upgrade_display_content.image" = true;
|
||||||
|
"pdfjs.enableScripting" = false;
|
||||||
|
"extensions.postDownloadThirdPartyPrompt" = false;
|
||||||
|
|
||||||
|
# HEADERS / REFERERS
|
||||||
|
"network.http.referer.XOriginTrimmingPolicy" = 2;
|
||||||
|
|
||||||
|
# CONTAINERS
|
||||||
|
"privacy.userContext.ui.enabled" = true;
|
||||||
|
|
||||||
|
# WEBRTC
|
||||||
|
"media.peerconnection.ice.proxy_only_if_behind_proxy" = true;
|
||||||
|
"media.peerconnection.ice.default_address_only" = true;
|
||||||
|
|
||||||
|
# SAFE BROWSING
|
||||||
|
"browser.safebrowsing.downloads.remote.enabled" = false;
|
||||||
|
|
||||||
|
# MOZILLA
|
||||||
|
# PREF: allow websites to ask you to receive site notifications
|
||||||
|
"permissions.default.desktop-notification" = 0; # allow websites to ask
|
||||||
|
# PREF: allow websites to ask you for your location
|
||||||
|
"permissions.default.geo" = 0;
|
||||||
|
"geo.provider.network.url" =
|
||||||
|
"https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%";
|
||||||
|
"permissions.manager.defaultsUrl" = "";
|
||||||
|
"webchannel.allowObject.urlWhitelist" = "";
|
||||||
|
|
||||||
|
# TELEMETRY
|
||||||
|
"datareporting.policy.dataSubmissionEnabled" = false;
|
||||||
|
"datareporting.healthreport.uploadEnabled" = false;
|
||||||
|
"toolkit.telemetry.unified" = false;
|
||||||
|
"toolkit.telemetry.enabled" = false;
|
||||||
|
"toolkit.telemetry.server" = "data:,";
|
||||||
|
"toolkit.telemetry.archive.enabled" = false;
|
||||||
|
"toolkit.telemetry.newProfilePing.enabled" = false;
|
||||||
|
"toolkit.telemetry.shutdownPingSender.enabled" = false;
|
||||||
|
"toolkit.telemetry.updatePing.enabled" = false;
|
||||||
|
"toolkit.telemetry.bhrPing.enabled" = false;
|
||||||
|
"toolkit.telemetry.firstShutdownPing.enabled" = false;
|
||||||
|
"toolkit.telemetry.coverage.opt-out" = true;
|
||||||
|
"toolkit.coverage.opt-out" = true;
|
||||||
|
"toolkit.coverage.endpoint.base" = "";
|
||||||
|
"browser.ping-centre.telemetry" = false;
|
||||||
|
"browser.newtabpage.activity-stream.feeds.telemetry" = false;
|
||||||
|
"browser.newtabpage.activity-stream.telemetry" = false;
|
||||||
|
|
||||||
|
# EXPERIMENTS
|
||||||
|
"app.shield.optoutstudies.enabled" = false;
|
||||||
|
"app.normandy.enabled" = false;
|
||||||
|
"app.normandy.api_url" = "";
|
||||||
|
|
||||||
|
# CRASH REPORTS
|
||||||
|
"breakpad.reportURL" = "";
|
||||||
|
"browser.tabs.crashReporting.sendReport" = false;
|
||||||
|
"browser.crashReports.unsubmittedCheck.autoSubmit2" = false;
|
||||||
|
|
||||||
|
# DETECTION
|
||||||
|
"captivedetect.canonicalURL" = "";
|
||||||
|
"network.captive-portal-service.enabled" = false;
|
||||||
|
"network.connectivity-service.enabled" = false;
|
||||||
|
|
||||||
|
# SECTION: PESKYFOX
|
||||||
|
# MOZILLA UI
|
||||||
|
"browser.privatebrowsing.vpnpromourl" = "";
|
||||||
|
"extensions.getAddons.showPane" = false;
|
||||||
|
"extensions.htmlaboutaddons.recommendations.enabled" = false;
|
||||||
|
"browser.discovery.enabled" = false;
|
||||||
|
"browser.shell.checkDefaultBrowser" = false;
|
||||||
|
"browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons" = false;
|
||||||
|
"browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features" = false;
|
||||||
|
"browser.preferences.moreFromMozilla" = false;
|
||||||
|
"browser.tabs.tabmanager.enabled" = false;
|
||||||
|
"browser.aboutConfig.showWarning" = false;
|
||||||
|
"browser.aboutwelcome.enabled" = false;
|
||||||
|
|
||||||
|
# THEME ADJUSTMENTS
|
||||||
|
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
|
||||||
|
"browser.compactmode.show" = true;
|
||||||
|
"browser.display.focus_ring_on_anything" = true;
|
||||||
|
"browser.display.focus_ring_style" = 0;
|
||||||
|
"browser.display.focus_ring_width" = 0;
|
||||||
|
"layout.css.prefers-color-scheme.content-override" = 2;
|
||||||
|
|
||||||
|
# COOKIE BANNER HANDLING
|
||||||
|
"cookiebanners.service.mode" = 1;
|
||||||
|
"cookiebanners.service.mode.privateBrowsing" = 1;
|
||||||
|
|
||||||
|
# FULLSCREEN NOTICE
|
||||||
|
"full-screen-api.transition-duration.enter" = "0 0";
|
||||||
|
"full-screen-api.transition-duration.leave" = "0 0";
|
||||||
|
"full-screen-api.warning.delay" = -1;
|
||||||
|
"full-screen-api.warning.timeout" = 0;
|
||||||
|
|
||||||
|
# URL BAR
|
||||||
|
"browser.urlbar.suggest.calculator" = true;
|
||||||
|
"browser.urlbar.unitConversion.enabled" = true;
|
||||||
|
"browser.urlbar.trending.featureGate" = false;
|
||||||
|
|
||||||
|
# NEW TAB PAGE
|
||||||
|
"browser.newtabpage.activity-stream.feeds.topsites" = false;
|
||||||
|
"browser.newtabpage.activity-stream.feeds.section.topstories" = false;
|
||||||
|
|
||||||
|
# POCKET
|
||||||
|
"extensions.pocket.enabled" = false;
|
||||||
|
|
||||||
|
# DOWNLOADS
|
||||||
|
"browser.download.always_ask_before_handling_new_types" = true;
|
||||||
|
"browser.download.manager.addToRecentDocs" = false;
|
||||||
|
|
||||||
|
# PDF
|
||||||
|
"browser.download.open_pdf_attachments_inline" = true;
|
||||||
|
|
||||||
|
# TAB BEHAVIOR
|
||||||
|
"browser.bookmarks.openInTabClosesMenu" = false;
|
||||||
|
"browser.menu.showViewImageInfo" = true;
|
||||||
|
"findbar.highlightAll" = true;
|
||||||
|
"layout.word_select.eat_space_to_next_word" = false;
|
||||||
|
|
||||||
|
# SECTION: MY OVERRIDES
|
||||||
|
"browser.startup.homepage" = "https://google.com";
|
||||||
|
"identity.fxaccounts.enabled" = false;
|
||||||
|
|
||||||
|
# SECTION SMOOTHFOX
|
||||||
|
# OPTION: SHARPEN SCROLLING *
|
||||||
|
"apz.overscroll.enabled" = true; # DEFAULT NON-LINUX
|
||||||
|
"mousewheel.min_line_scroll_amount" = 10; # 10-40; adjust this number to your liking; default=5
|
||||||
|
"general.smoothScroll.mouseWheel.durationMinMS" = 80; # default=50
|
||||||
|
"general.smoothScroll.currentVelocityWeighting" = "0.15"; # default=.25
|
||||||
|
"general.smoothScroll.stopDecelerationWeighting" = "0.6"; # default=.4
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -2,7 +2,5 @@
|
|||||||
{
|
{
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
chromium
|
chromium
|
||||||
vscode
|
|
||||||
firefox
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
../home/global.nix
|
../home/global.nix
|
||||||
|
../home/firefox.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ in
|
|||||||
"networkmanager"
|
"networkmanager"
|
||||||
"plugdev"
|
"plugdev"
|
||||||
"scanner"
|
"scanner"
|
||||||
"transmission"
|
|
||||||
"uaccess"
|
"uaccess"
|
||||||
"wireshark"
|
"wireshark"
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
"rspace" = "'for f in *\ *; do mv \"$f\" \"\${f// /_}\"; done'";
|
"rspace" = "'for f in *\ *; do mv \"$f\" \"\${f// /_}\"; done'";
|
||||||
"rebuild" = "sudo nixos-rebuild switch --flake /home/richie/dotfiles#$HOST";
|
"rebuild" = "sudo nixos-rebuild switch --flake /home/richie/dotfiles#$HOST";
|
||||||
"nix-test" = "nixos-rebuild test --flake /home/richie/dotfiles";
|
"build_iso" = "nix build .#nixosConfigurations.installer.config.system.build.isoImage";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,8 +12,6 @@
|
|||||||
discord-canary
|
discord-canary
|
||||||
gimp
|
gimp
|
||||||
gparted
|
gparted
|
||||||
jetbrains.datagrip
|
|
||||||
ladybird
|
|
||||||
mediainfo
|
mediainfo
|
||||||
nemo
|
nemo
|
||||||
nemo-fileroller
|
nemo-fileroller
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
programs.firefox = {
|
programs.firefox = {
|
||||||
enable = true;
|
enable = true;
|
||||||
profiles.richie = {
|
profiles.richie = {
|
||||||
extensions.packages = with inputs.firefox-addons.packages.x86_64-linux; [
|
extensions = with inputs.firefox-addons.packages.x86_64-linux; [
|
||||||
bitwarden
|
bitwarden
|
||||||
darkreader
|
darkreader
|
||||||
dearrow
|
dearrow
|
||||||
@@ -19,8 +19,8 @@
|
|||||||
default = "kagi";
|
default = "kagi";
|
||||||
order = [
|
order = [
|
||||||
"kagi"
|
"kagi"
|
||||||
"ddg"
|
"DuckDuckGo"
|
||||||
"google"
|
"Google"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
settings = {
|
settings = {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
let
|
let
|
||||||
vscode_dir = "/home/richie/dotfiles/users/richie/home/gui/vscode";
|
vscode_dir = "/home/richie/projects/nix-dotfiles/users/richie/home/gui/vscode";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
# mutable symlinks to key binds and settings
|
# mutable symlinks to key binds and settings
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
"terminal.integrated.scrollback": 10000,
|
"terminal.integrated.scrollback": 10000,
|
||||||
"update.mode": "none",
|
"update.mode": "none",
|
||||||
"workbench.colorTheme": "Default Dark+",
|
"workbench.colorTheme": "Default Dark+",
|
||||||
"workbench.secondarySideBar.showLabels": false,
|
|
||||||
|
|
||||||
// turns off all sounds and announcements
|
// turns off all sounds and announcements
|
||||||
"accessibility.signals.terminalCommandFailed": {
|
"accessibility.signals.terminalCommandFailed": {
|
||||||
@@ -48,7 +47,6 @@
|
|||||||
// formatters
|
// formatters
|
||||||
"[html]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
|
"[html]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
|
||||||
"[jsonc]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
|
"[jsonc]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
|
||||||
"[json]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
|
|
||||||
"[markdown]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
|
"[markdown]": { "editor.defaultFormatter": "esbenp.prettier-vscode" },
|
||||||
"[nix]": { "editor.defaultFormatter": "jnoortheen.nix-ide" },
|
"[nix]": { "editor.defaultFormatter": "jnoortheen.nix-ide" },
|
||||||
"[python]": { "editor.defaultFormatter": "charliermarsh.ruff" },
|
"[python]": { "editor.defaultFormatter": "charliermarsh.ruff" },
|
||||||
@@ -64,9 +62,6 @@
|
|||||||
"nix.enableLanguageServer": true,
|
"nix.enableLanguageServer": true,
|
||||||
"nix.serverPath": "nil",
|
"nix.serverPath": "nil",
|
||||||
|
|
||||||
// python tools
|
|
||||||
"mypy.runUsingActiveInterpreter": true,
|
|
||||||
|
|
||||||
// force the use of rust-analyzer from dev shell
|
// force the use of rust-analyzer from dev shell
|
||||||
"rust-analyzer.server.path": "rust-analyzer",
|
"rust-analyzer.server.path": "rust-analyzer",
|
||||||
"redhat.telemetry.enabled": true,
|
"redhat.telemetry.enabled": true,
|
||||||
|
|||||||
Reference in New Issue
Block a user