Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
64fba754f1
|
@@ -1,84 +0,0 @@
|
||||
# CLAUDE.md
|
||||
|
||||
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||
|
||||
## Repository purpose
|
||||
|
||||
Personal NixOS configuration managing multiple hosts via a single flake. Each host is a separate `nixosConfiguration` output in `flake.nix`. Home Manager is wired in as a NixOS module per host. Upstream is `nixos-25.11`.
|
||||
|
||||
## Hosts
|
||||
|
||||
Defined in `flake.nix` under `nixosConfigurations`:
|
||||
|
||||
- `fuji` — x86_64 laptop, intel 13th gen, dual wireguard (one in a network namespace for ProtonVPN routed via `dnscrypt-proxy`). No desktop environment: `plasma6.enable = false`, greetd/tuigreet defaults to sway, river is offered as a second session via a hand-rolled `river-session` package. KDE *applications* (dolphin, okular, ark, kdenlive) are still installed — see the ksycoca note below.
|
||||
- `nixy` — x86_64 workstation (also builds the `nixy_iso` installer image)
|
||||
- `mediabox` — x86_64 media server (jellyfin/qbittorrent; uses the local `modules/qbittorrent.nix`)
|
||||
- `blue` — x86_64 (no sops-nix)
|
||||
- `magpie` — **aarch64**, qemu guest, runs `simple-nixos-mailserver`; the wireguard hub other hosts dial into
|
||||
|
||||
When adding a new host, follow the pattern in `flake.nix`: include `common/packages.nix`, `common/suspend.nix`, the host's `configuration.nix` + `hardware-configuration.nix`, `sops-nix.nixosModules.sops` (if secrets needed), and a home-manager block pointing at `home/<host>/home.nix`.
|
||||
|
||||
## Common commands
|
||||
|
||||
```sh
|
||||
# Rebuild the current host (uses hostname to select config)
|
||||
sudo nixos-rebuild switch --flake .#
|
||||
|
||||
# Rebuild a specific host
|
||||
sudo nixos-rebuild switch --flake .#fuji
|
||||
|
||||
# Test without making the new generation the default boot entry
|
||||
sudo nixos-rebuild test --flake .#fuji
|
||||
|
||||
# Build the nixy installer ISO
|
||||
nix build .#nixosConfigurations.nixy_iso.config.system.build.isoImage
|
||||
|
||||
# Update a single flake input
|
||||
nix flake update nixpkgs
|
||||
|
||||
# Format Nix files (formatter is alejandra)
|
||||
nix fmt
|
||||
|
||||
# Enter the dev shell (sops, ssh-to-age, age available)
|
||||
nix develop
|
||||
|
||||
# Cross-build magpie (aarch64) from x86_64 — requires binfmt or remote builder
|
||||
nix build .#nixosConfigurations.magpie.config.system.build.toplevel
|
||||
```
|
||||
|
||||
`fuji` has `boot.binfmt.emulatedSystems` for wasm32-wasi + x86_64-windows but **not** aarch64, so building magpie locally from fuji needs a remote builder or adding aarch64 to that list.
|
||||
|
||||
## Directory layout
|
||||
|
||||
- `<host>/configuration.nix` + `<host>/hardware-configuration.nix` — per-host NixOS config
|
||||
- `<host>/secrets/*.yaml` — sops-encrypted secrets, decrypted at activation via the host's SSH host key (`/etc/ssh/ssh_host_ed25519_key` → age)
|
||||
- `common/` — modules imported by every host (`packages.nix`, `suspend.nix`) plus shared wireguard pubkeys and `common/secrets/` for cross-host secrets like the wireguard preshared key
|
||||
- `home/<host>/home.nix` — entry point for that host's home-manager config
|
||||
- `home/common/` — shared home-manager modules (zsh, sway, i3, i3status-rust, firefox, etc.) imported from per-host `home.nix`
|
||||
- `modules/` — local NixOS modules not yet upstream-ready (currently `qbittorrent.nix`, `nextcloud.nix`)
|
||||
- `packages/` — derivations for packages built locally (`bubblewrap`, `viber`)
|
||||
|
||||
## Architectural notes worth knowing before editing
|
||||
|
||||
**Inputs are passed as `_module.args` to every module.** That means `configuration.nix` files receive `nvim`, `zremap`, `swaysw`, `system`, etc. as function arguments — they aren't imported explicitly. When you see an unfamiliar identifier in a host module's arg list, check `flake.nix` inputs.
|
||||
|
||||
**sops-nix wiring.** Secrets decrypt using the host's SSH ed25519 host key converted to age. Each host's `sops.secrets.<name>` references either `./secrets/<file>.yaml` (host-local) or `../common/secrets/<file>.yaml` (shared). `config.sops.secrets.<name>.path` is the runtime decrypted path — pass it to systemd units, never read the file at eval time.
|
||||
|
||||
**Fuji's split-tunnel ProtonVPN.** `fuji/configuration.nix` builds a `wg` network namespace, brings up `proton_wg` inside it, and runs `dnscrypt-proxy_proton` bound to that namespace. Anything that should egress over Proton must be launched with `ip netns exec wg ...`. The main-host `wg0` interface is unrelated and connects to magpie for the personal mesh (`10.100.0.0/24`).
|
||||
|
||||
**KDE apps outside Plasma need an XDG menu file.** `kbuildsycoca6` indexes only the `.desktop` files reachable from `"$XDG_MENU_PREFIX"applications.menu`; with no such file it builds a ksycoca containing zero applications, and every KIO consumer silently degrades — Dolphin stops honouring default handlers and its "Open With" chooser comes up empty. Plasma used to supply both halves (`XDG_MENU_PREFIX=plasma-` plus `plasma-applications.menu`); sway/river set no prefix, so `fuji/configuration.nix` installs `environment.etc."xdg/menus/applications.menu"` from `plasma-workspace` (already in the closure via the KDE portal backend, so it costs nothing). Note that `mimeapps.list` and `mimeinfo.cache` are *not* involved — `xdg-mime query default` will look correct while Dolphin is broken, so debug this with `strings -el ~/.cache/ksycoca6_* | grep -c '\.desktop'` instead.
|
||||
|
||||
**mimeapps.list is read-only.** Home-manager symlinks both `~/.config/mimeapps.list` and `~/.local/share/applications/mimeapps.list` into the store, so "Remember application association" in any chooser fails to persist. Add associations to `xdg.mimeApps` in `home/<host>/home.nix` instead.
|
||||
|
||||
**Home-manager backup extension.** `backupFileExtension = "home_backup"` is set on most hosts — if a switch fails on file conflicts, look for `*.home_backup` files in `$HOME`.
|
||||
|
||||
**Hardening already in place on fuji** (mirror to other hosts when relevant): nftables firewall, scudo allocator, AppArmor, sysctl hardening (kptr_restrict, dmesg_restrict, rp_filter, redirect blocking), `sudo.execWheelOnly`, `firewall.logRefusedConnections`, doas, firejail, no coredumps, `KillUserProcesses`, ro nix store mount, systemd-boot editor disabled.
|
||||
|
||||
## Editing secrets
|
||||
|
||||
```sh
|
||||
nix develop # gets sops + age + ssh-to-age
|
||||
sops <host>/secrets/<file>.yaml
|
||||
```
|
||||
|
||||
`.sops.yaml` (if present at repo root, otherwise inferred) defines which age keys may decrypt which paths. When adding a new host, derive its age pubkey from the SSH host key with `ssh-to-age` and add it to the `.sops.yaml` creation rules before re-encrypting.
|
||||
@@ -0,0 +1,333 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
];
|
||||
|
||||
system.stateVersion = "23.05";
|
||||
system.autoUpgrade.enable = true;
|
||||
|
||||
nix = {
|
||||
optimise.automatic = true;
|
||||
gc.automatic = true;
|
||||
gc.options = "--delete-older-than 7d";
|
||||
package = pkgs.nixVersions.latest;
|
||||
settings.experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
};
|
||||
|
||||
boot = {
|
||||
kernelPackages = pkgs.linuxPackages_latest;
|
||||
kernelParams = [ "msr.allow_writes=on" ];
|
||||
supportedFilesystems = [ "btrfs" ];
|
||||
tmpOnTmpfs = true;
|
||||
initrd.compressor = "zstd";
|
||||
loader.systemd-boot = {
|
||||
enable = true;
|
||||
editor = false;
|
||||
memtest86.enable = true;
|
||||
};
|
||||
loader.efi.canTouchEfiVariables = true;
|
||||
readOnlyNixStore = true;
|
||||
};
|
||||
|
||||
security = {
|
||||
rtkit.enable = true;
|
||||
allowSimultaneousMultithreading = true;
|
||||
sudo.enable = false;
|
||||
doas.enable = true;
|
||||
doas.extraRules = [
|
||||
{
|
||||
users = [ "akill" ];
|
||||
keepEnv = true;
|
||||
persist = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
powerManagement = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
networking = {
|
||||
firewall.enable = true;
|
||||
hostName = "blue";
|
||||
nameservers = [
|
||||
"127.0.0.1"
|
||||
"::1"
|
||||
];
|
||||
dhcpcd.extraConfig = "nohook resolv.conf";
|
||||
|
||||
networkmanager = {
|
||||
enable = true;
|
||||
dns = "none";
|
||||
# wifi.backend = "iwd";
|
||||
};
|
||||
};
|
||||
|
||||
time.timeZone = "Europe/Sarajevo";
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
environment = {
|
||||
homeBinInPath = true;
|
||||
variables = {
|
||||
PATH = "$HOME/.cargo/bin";
|
||||
};
|
||||
};
|
||||
|
||||
programs = {
|
||||
gnupg.agent = {
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
};
|
||||
zsh.enable = true;
|
||||
firejail.enable = true;
|
||||
adb.enable = true;
|
||||
wireshark.enable = true;
|
||||
sway.enable = true;
|
||||
};
|
||||
|
||||
# List services that you want to enable:
|
||||
systemd = {
|
||||
services = {
|
||||
"caps2esc" = {
|
||||
description = "Intercepts keyboard udev events";
|
||||
wants = [ "systemd-udevd.service" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig.Nice = -20;
|
||||
script = ''
|
||||
${pkgs.interception-tools}/bin/intercept \
|
||||
-g /dev/input/by-path/*-kbd | \
|
||||
/opt/caps2esc | ${pkgs.interception-tools}/bin/uinput \
|
||||
-d /dev/input/by-path/*-kbd \
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
extraConfig = ''
|
||||
DefaultTimeoutStartSec=30s
|
||||
DefaultTimeoutStopSec=30s
|
||||
'';
|
||||
};
|
||||
|
||||
services = {
|
||||
acpid.enable = true;
|
||||
btrfs.autoScrub.enable = true;
|
||||
dbus.enable = true;
|
||||
fstrim.enable = true;
|
||||
fwupd.enable = true;
|
||||
ntp.enable = true;
|
||||
openssh.enable = false;
|
||||
printing.enable = true;
|
||||
|
||||
nextcloud = {
|
||||
enable = true;
|
||||
hostName = "localhost";
|
||||
config.adminpassFile = "${pkgs.writeText "adminpass" "test123"}";
|
||||
};
|
||||
|
||||
jellyfin = {
|
||||
enable = false;
|
||||
user = "akill";
|
||||
openFirewall = false;
|
||||
};
|
||||
|
||||
pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
|
||||
xserver = {
|
||||
enable = true;
|
||||
dpi = 144;
|
||||
libinput.enable = true;
|
||||
desktopManager.xterm.enable = false;
|
||||
displayManager = {
|
||||
lightdm.enable = false;
|
||||
startx.enable = true;
|
||||
defaultSession = "none+i3";
|
||||
};
|
||||
windowManager.i3.enable = true;
|
||||
};
|
||||
|
||||
udev.packages = [
|
||||
pkgs.rtl-sdr
|
||||
pkgs.openhantek6022
|
||||
];
|
||||
|
||||
tlp = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
actkbd = {
|
||||
enable = true;
|
||||
bindings = [
|
||||
{
|
||||
keys = [ 113 ];
|
||||
events = [ "key" ];
|
||||
command = "/run/current-system/sw/bin/runuser -l akill -c 'amixer -q set Master toggle'";
|
||||
}
|
||||
|
||||
{
|
||||
keys = [ 114 ];
|
||||
events = [
|
||||
"key"
|
||||
"rep"
|
||||
];
|
||||
command = "/run/current-system/sw/bin/runuser -l akill -c 'amixer -q set Master 5%- unmute'";
|
||||
}
|
||||
|
||||
{
|
||||
keys = [ 115 ];
|
||||
events = [
|
||||
"key"
|
||||
"rep"
|
||||
];
|
||||
command = "/run/current-system/sw/bin/runuser -l akill -c 'amixer -q set Master 5%+ unmute'";
|
||||
}
|
||||
|
||||
{
|
||||
keys = [ 224 ];
|
||||
events = [ "key" ];
|
||||
command = "${pkgs.light}/bin/light -U 5";
|
||||
}
|
||||
|
||||
{
|
||||
keys = [ 225 ];
|
||||
events = [ "key" ];
|
||||
command = "${pkgs.light}/bin/light -A 5";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
mpd = {
|
||||
musicDirectory = "/home/mpd/music";
|
||||
enable = false;
|
||||
extraConfig = ''
|
||||
audio_output {
|
||||
type "pulse"
|
||||
name "pulsee srv"
|
||||
server "127.0.0.1"
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
dnscrypt-proxy2 = {
|
||||
enable = true;
|
||||
settings = {
|
||||
ipv6_servers = true;
|
||||
require_dnssec = true;
|
||||
|
||||
sources.public-resolvers = {
|
||||
urls = [
|
||||
"https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/public-resolvers.md"
|
||||
"https://download.dnscrypt.info/resolvers-list/v3/public-resolvers.md"
|
||||
];
|
||||
cache_file = "/var/lib/dnscrypt-proxy2/public-resolvers.md";
|
||||
minisign_key = "RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
journald.extraConfig = ''
|
||||
SystemMaxUse=50M
|
||||
'';
|
||||
|
||||
logind.extraConfig = ''
|
||||
KillUserProcesses=yes
|
||||
'';
|
||||
};
|
||||
|
||||
fonts = {
|
||||
fontconfig = {
|
||||
cache32Bit = true;
|
||||
allowBitmaps = true;
|
||||
useEmbeddedBitmaps = true;
|
||||
defaultFonts = {
|
||||
monospace = [ "JetBrainsMono" ];
|
||||
};
|
||||
};
|
||||
|
||||
fonts = with pkgs; [
|
||||
dejavu_fonts
|
||||
dina-font
|
||||
fira-code
|
||||
fira-code-symbols
|
||||
font-awesome
|
||||
font-awesome_4
|
||||
inconsolata
|
||||
iosevka
|
||||
jetbrains-mono
|
||||
liberation_ttf
|
||||
noto-fonts
|
||||
noto-fonts-cjk
|
||||
noto-fonts-emoji
|
||||
proggyfonts
|
||||
siji
|
||||
terminus_font
|
||||
terminus_font_ttf
|
||||
ubuntu_font_family
|
||||
];
|
||||
};
|
||||
|
||||
virtualisation = {
|
||||
containers.storage.settings = {
|
||||
storage = {
|
||||
driver = "btrfs";
|
||||
graphroot = "/var/lib/containers/storage";
|
||||
runroot = "/run/containers/storage";
|
||||
};
|
||||
};
|
||||
podman = {
|
||||
enable = true;
|
||||
dockerCompat = true;
|
||||
};
|
||||
};
|
||||
|
||||
sound.enable = true;
|
||||
|
||||
hardware = {
|
||||
bluetooth = {
|
||||
enable = true;
|
||||
settings = {
|
||||
General = {
|
||||
Enable = "Source,Sink,Media,Socket";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
opengl = {
|
||||
enable = true;
|
||||
driSupport = true;
|
||||
driSupport32Bit = true;
|
||||
extraPackages = with pkgs; [
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
zramSwap = {
|
||||
enable = false;
|
||||
algorithm = "zstd";
|
||||
};
|
||||
|
||||
users.users.akill = {
|
||||
isNormalUser = true;
|
||||
shell = pkgs.zsh;
|
||||
extraGroups = [
|
||||
"wireshark"
|
||||
"kvm"
|
||||
"tty"
|
||||
"audio"
|
||||
"sound"
|
||||
"adbusers"
|
||||
"dialout"
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"ahci"
|
||||
"nvme"
|
||||
"usbhid"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
"sr_mod"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/0af4dcb9-6e59-4946-87b2-0d2f14b808d4";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"subvol=root"
|
||||
"compress=zstd"
|
||||
"noatime"
|
||||
];
|
||||
};
|
||||
|
||||
boot.initrd.luks.devices."enc_root".device =
|
||||
"/dev/disk/by-uuid/8eb8ac22-d89d-4406-bfbd-ce43e283649f";
|
||||
|
||||
fileSystems."/home" = {
|
||||
device = "/dev/disk/by-uuid/0af4dcb9-6e59-4946-87b2-0d2f14b808d4";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"subvol=home"
|
||||
"compress=zstd"
|
||||
"noatime"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/nix" = {
|
||||
device = "/dev/disk/by-uuid/0af4dcb9-6e59-4946-87b2-0d2f14b808d4";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"subvol=nix"
|
||||
"compress=zstd"
|
||||
"noatime"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/var/log" = {
|
||||
device = "/dev/disk/by-uuid/0af4dcb9-6e59-4946-87b2-0d2f14b808d4";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"subvol=log"
|
||||
"compress=zstd"
|
||||
"noatime"
|
||||
];
|
||||
neededForBoot = true;
|
||||
};
|
||||
|
||||
fileSystems."/persist" = {
|
||||
device = "/dev/disk/by-uuid/0af4dcb9-6e59-4946-87b2-0d2f14b808d4";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"subvol=persist"
|
||||
"compress=zstd"
|
||||
"noatime"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/6C85-D29B";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp2s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
Generated
+39
-190
@@ -1,66 +1,5 @@
|
||||
{
|
||||
"nodes": {
|
||||
"att_lock": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1785700822,
|
||||
"narHash": "sha256-RZPS1tUrYjPWKKF9/tD6ZxzYHIS0Ou+bMEkXBDLo9+I=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "3e5e6c6fa8ab362272bb13ea9985f5eedec0f525",
|
||||
"revCount": 3,
|
||||
"type": "git",
|
||||
"url": "https://git.project-cloud.net/asmir/att_lock"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "https://git.project-cloud.net/asmir/att_lock"
|
||||
}
|
||||
},
|
||||
"att_menu": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1787049412,
|
||||
"narHash": "sha256-HyGiQqnmhDqRd1Qza/MYALf1fvIq/BBLmw7rY0LMSrw=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "7ff0f584e0e038d81c6757aed5dccfc53b33a5d7",
|
||||
"revCount": 6,
|
||||
"type": "git",
|
||||
"url": "https://git.project-cloud.net/asmir/att_menu"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "https://git.project-cloud.net/asmir/att_menu"
|
||||
}
|
||||
},
|
||||
"att_wm": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1787081451,
|
||||
"narHash": "sha256-X3YMUAjXbE3IeRfNSWrGr3TDC0t1c9Q1U4pp0urlDT8=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "f60dd06e7ebceb574c34a4bedbe486038ab0cbc5",
|
||||
"revCount": 8,
|
||||
"type": "git",
|
||||
"url": "https://git.project-cloud.net/asmir/att_wm"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "https://git.project-cloud.net/asmir/att_wm"
|
||||
}
|
||||
},
|
||||
"blobs": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
@@ -109,24 +48,6 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1731533236,
|
||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"git-hooks": {
|
||||
"inputs": {
|
||||
"flake-compat": [
|
||||
@@ -140,11 +61,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1778507602,
|
||||
"narHash": "sha256-kTwur1wV+01SdqskVMSo6JMEpg71ps3HpbFY2GsflKs=",
|
||||
"lastModified": 1772665116,
|
||||
"narHash": "sha256-XmjUDG/J8Z8lY5DVNVUf5aoZGc400FxcjsNCqHKiKtc=",
|
||||
"owner": "cachix",
|
||||
"repo": "git-hooks.nix",
|
||||
"rev": "61ab0e80d9c7ab14c256b5b453d8b3fb0189ba0a",
|
||||
"rev": "39f53203a8458c330f61cc0759fe243f0ac0d198",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -182,16 +103,16 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1786924861,
|
||||
"narHash": "sha256-hftabkb+73OcGzvwFAjCiQorAhprs9TnU1+FkGO5CIw=",
|
||||
"lastModified": 1772633058,
|
||||
"narHash": "sha256-SO7JapRy2HPhgmqiLbfnW1kMx5rakPMKZ9z3wtRLQjI=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "09ae1b85a6db412d841d60f924b23f881f0d0a38",
|
||||
"rev": "080657a04188aca25f8a6c70a0fb2ea7e37f1865",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"ref": "release-26.05",
|
||||
"ref": "release-25.11",
|
||||
"repo": "home-manager",
|
||||
"type": "github"
|
||||
}
|
||||
@@ -219,48 +140,32 @@
|
||||
},
|
||||
"nixos": {
|
||||
"locked": {
|
||||
"lastModified": 1786943417,
|
||||
"narHash": "sha256-b4qgjdFtlz5TAZ1Hi7DFJeqX3sjaDUnrwr9OO+O1rM0=",
|
||||
"lastModified": 1772598333,
|
||||
"narHash": "sha256-YaHht/C35INEX3DeJQNWjNaTcPjYmBwwjFJ2jdtr+5U=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "0dd31db7e6dbf9ce05697c4545f6fe01accec994",
|
||||
"rev": "fabb8c9deee281e50b1065002c9828f2cf7b2239",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-26.05",
|
||||
"ref": "nixos-25.11",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1786943417,
|
||||
"narHash": "sha256-b4qgjdFtlz5TAZ1Hi7DFJeqX3sjaDUnrwr9OO+O1rM0=",
|
||||
"lastModified": 1772598333,
|
||||
"narHash": "sha256-YaHht/C35INEX3DeJQNWjNaTcPjYmBwwjFJ2jdtr+5U=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "0dd31db7e6dbf9ce05697c4545f6fe01accec994",
|
||||
"rev": "fabb8c9deee281e50b1065002c9828f2cf7b2239",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-26.05",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1779560665,
|
||||
"narHash": "sha256-tpyBcxPpcQb8ukyNF7DoCwfSY3VPsxHoYwj00Cayv5o=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "64c08a7ca051951c8eae34e3e3cb1e202fe36786",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"ref": "nixos-25.11",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
@@ -272,11 +177,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1780737477,
|
||||
"narHash": "sha256-qT9K6+u/pl2TyKrDHDRJO+NVxcna77g6dd2BMpRUoDA=",
|
||||
"lastModified": 1769036658,
|
||||
"narHash": "sha256-bia1yOQtC8A7XZRCTdLvY0Bdv4i/V6hMqb0NM/9h/jc=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "4ef0897faf170e5b796ffc7f893b7d8cd37fd034",
|
||||
"revCount": 56,
|
||||
"rev": "9c1eb1b999522b965ce129043c7112fc9e38c75a",
|
||||
"revCount": 52,
|
||||
"type": "git",
|
||||
"url": "https://git.project-cloud.net/asmir/nvim_flake"
|
||||
},
|
||||
@@ -294,11 +199,11 @@
|
||||
"theme_deepthought": "theme_deepthought"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1781475946,
|
||||
"narHash": "sha256-yx9jU6g7/nziomtsxzSiHCMZrYfiEyDUtR4zO9mFALA=",
|
||||
"lastModified": 1729077289,
|
||||
"narHash": "sha256-z5LEPxOJq2LjhPhY4QE1IOt0lBD39cipR6Lw8vRTNlI=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "055790d9cef77d3ee119a0aac57945d34c47aea2",
|
||||
"revCount": 28,
|
||||
"rev": "eab712e42139d33911ba767c2ff1bfbdf05c254d",
|
||||
"revCount": 27,
|
||||
"type": "git",
|
||||
"url": "https://git.project-cloud.net/asmir/project-cloud"
|
||||
},
|
||||
@@ -307,58 +212,14 @@
|
||||
"url": "https://git.project-cloud.net/asmir/project-cloud"
|
||||
}
|
||||
},
|
||||
"quickshell": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"quickshell_bar",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1779430452,
|
||||
"narHash": "sha256-zTslhsxLqUlRTML506iougTGzyR38Fzhzn7t4KDEuuE=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "4b4fca3224ab977dc515ac0bb78d00b3dfa71e00",
|
||||
"revCount": 819,
|
||||
"type": "git",
|
||||
"url": "https://git.outfoxxed.me/quickshell/quickshell"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "https://git.outfoxxed.me/quickshell/quickshell"
|
||||
}
|
||||
},
|
||||
"quickshell_bar": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"quickshell": "quickshell"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1785092556,
|
||||
"narHash": "sha256-LubUaBPwlCAzS4pZ7B9q9iwBicwRBsjiKTYCtF2KYa4=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "f26574941717fa7dee8be1213f2ed7614629ce40",
|
||||
"revCount": 15,
|
||||
"type": "git",
|
||||
"url": "https://git.project-cloud.net/asmir/quickshell_bar"
|
||||
},
|
||||
"original": {
|
||||
"type": "git",
|
||||
"url": "https://git.project-cloud.net/asmir/quickshell_bar"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"att_lock": "att_lock",
|
||||
"att_menu": "att_menu",
|
||||
"att_wm": "att_wm",
|
||||
"home-manager": "home-manager",
|
||||
"nix-xilinx": "nix-xilinx",
|
||||
"nixos": "nixos",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nvim": "nvim",
|
||||
"project-cloud": "project-cloud",
|
||||
"quickshell_bar": "quickshell_bar",
|
||||
"simple-nixos-mailserver": "simple-nixos-mailserver",
|
||||
"sops-nix": "sops-nix",
|
||||
"swaysw": "swaysw",
|
||||
@@ -375,14 +236,17 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1785198005,
|
||||
"narHash": "sha256-falBPi+PJtMx0vwII8L24wjDGXNZMwRiVXsw8WTXLEo=",
|
||||
"type": "tarball",
|
||||
"url": "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/nixos-26.05/nixos-mailserver-nixos-26.05.tar.gz"
|
||||
"lastModified": 1772763116,
|
||||
"narHash": "sha256-5NUtdVWnEflm829QI0BIj2rDhI+pfagt+cxIARJEhi8=",
|
||||
"owner": "simple-nixos-mailserver",
|
||||
"repo": "nixos-mailserver",
|
||||
"rev": "c04152fa90ba5079f4517aa24383245937e43ab8",
|
||||
"type": "gitlab"
|
||||
},
|
||||
"original": {
|
||||
"type": "tarball",
|
||||
"url": "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/nixos-26.05/nixos-mailserver-nixos-26.05.tar.gz"
|
||||
"owner": "simple-nixos-mailserver",
|
||||
"repo": "nixos-mailserver",
|
||||
"type": "gitlab"
|
||||
}
|
||||
},
|
||||
"sops-nix": {
|
||||
@@ -392,11 +256,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1786629091,
|
||||
"narHash": "sha256-gkig4nPi1CWc4Z50GBsjE4ygSE7hMpl/TwID2an2Cck=",
|
||||
"lastModified": 1772495394,
|
||||
"narHash": "sha256-hmIvE/slLKEFKNEJz27IZ8BKlAaZDcjIHmkZ7GCEjfw=",
|
||||
"owner": "Mic92",
|
||||
"repo": "sops-nix",
|
||||
"rev": "a8627b21b9107c5711c96b84f32a9a4b3d45295f",
|
||||
"rev": "1d9b98a29a45abe9c4d3174bd36de9f28755e3ff",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -425,21 +289,6 @@
|
||||
"url": "https://git.project-cloud.net/asmir/swaysw"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"theme_anemone": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
@@ -479,11 +328,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1780166195,
|
||||
"narHash": "sha256-kqViUrWwIJP7xVCpcZbRk7IygAw/Tll/UmbcAW9zRPk=",
|
||||
"lastModified": 1764579633,
|
||||
"narHash": "sha256-gOD5RMHOB9Fw4T3nk2a95YdU0J24QU3uWUiZVIQza64=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "e1aecedf30f3b3cedd89d84364bd7e548a011bcd",
|
||||
"revCount": 26,
|
||||
"rev": "b0707744e2b4a077e759145cdbfa8d8d1017e732",
|
||||
"revCount": 25,
|
||||
"type": "git",
|
||||
"url": "https://git.project-cloud.net/asmir/zremap"
|
||||
},
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
description = "NixOS configuration";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05";
|
||||
nixos.url = "github:nixos/nixpkgs/nixos-26.05";
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
|
||||
nixos.url = "github:nixos/nixpkgs/nixos-25.11";
|
||||
nixpkgs_unstable.url = "nixpkgs/nixos-unstable";
|
||||
|
||||
nix-xilinx = {
|
||||
url = "gitlab:asmir.abdulahovic/nix-xilinx";
|
||||
@@ -20,25 +21,6 @@
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
quickshell_bar = {
|
||||
url = "git+https://git.project-cloud.net/asmir/quickshell_bar";
|
||||
};
|
||||
|
||||
att_wm = {
|
||||
url = "git+https://git.project-cloud.net/asmir/att_wm";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
att_lock = {
|
||||
url = "git+https://git.project-cloud.net/asmir/att_lock";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
att_menu = {
|
||||
url = "git+https://git.project-cloud.net/asmir/att_menu";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
nvim = {
|
||||
url = "git+https://git.project-cloud.net/asmir/nvim_flake";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
@@ -50,12 +32,12 @@
|
||||
};
|
||||
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager/release-26.05";
|
||||
url = "github:nix-community/home-manager/release-25.11";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
simple-nixos-mailserver = {
|
||||
url = "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/nixos-26.05/nixos-mailserver-nixos-26.05.tar.gz";
|
||||
url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
@@ -63,6 +45,11 @@
|
||||
url = "git+https://git.project-cloud.net/asmir/project-cloud";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
nixos-inventree = {
|
||||
url = "github:Gigahawk/nixos-inventree";
|
||||
inputs.nixpkgs.follows = "nixpkgs_unstable";
|
||||
};
|
||||
};
|
||||
|
||||
outputs =
|
||||
@@ -76,78 +63,133 @@
|
||||
, swaysw
|
||||
, zremap
|
||||
, nixos
|
||||
, nixos-inventree
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux.pkgs;
|
||||
inherit (nixpkgs) lib;
|
||||
|
||||
# Build a host's nixosConfiguration from the shared boilerplate.
|
||||
# Per-host differences are expressed as flags / extraModules rather
|
||||
# than copy-pasted module blocks.
|
||||
mkHost =
|
||||
{ hostname # name of the ./<hostname> and ./home/<hostname> dirs
|
||||
, system ? "x86_64-linux"
|
||||
, homeHost ? hostname # which home/<...> config to use (iso reuses nixy)
|
||||
, packages ? true # import common/packages.nix
|
||||
, suspend ? true # import common/suspend.nix
|
||||
, hardware ? true # import <hostname>/hardware-configuration.nix
|
||||
, sops ? true # wire sops-nix
|
||||
, hm ? true # wire home-manager
|
||||
, hmBackup ? true # set home-manager.backupFileExtension
|
||||
, nixosLib ? nixpkgs.lib # nixosSystem source (iso uses `nixos`)
|
||||
, extraModules ? [ ]
|
||||
}:
|
||||
nixosLib.nixosSystem {
|
||||
inherit system;
|
||||
modules =
|
||||
[
|
||||
in
|
||||
{
|
||||
nixosConfigurations = {
|
||||
nixy = nixpkgs.lib.nixosSystem rec {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
{ _module.args = inputs; }
|
||||
{ _module.args.system = system; }
|
||||
{ nix.registry.nixpkgs.flake = nixpkgs; }
|
||||
]
|
||||
++ lib.optional packages ./common/packages.nix
|
||||
++ lib.optional suspend ./common/suspend.nix
|
||||
++ [ (./. + "/${hostname}/configuration.nix") ]
|
||||
++ lib.optional hardware (./. + "/${hostname}/hardware-configuration.nix")
|
||||
++ lib.optional sops sops-nix.nixosModules.sops
|
||||
++ lib.optionals hm [
|
||||
./common/packages.nix
|
||||
./common/suspend.nix
|
||||
./nixy/configuration.nix
|
||||
./nixy/hardware-configuration.nix
|
||||
sops-nix.nixosModules.sops
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users.akill = import (./home + "/${homeHost}/home.nix");
|
||||
home-manager.users.akill = import ./home/nixy/home.nix;
|
||||
home-manager.extraSpecialArgs = { inherit inputs system; };
|
||||
home-manager.backupFileExtension = "home_backup";
|
||||
}
|
||||
]
|
||||
++ lib.optional (hm && hmBackup) { home-manager.backupFileExtension = "home_backup"; }
|
||||
++ extraModules;
|
||||
};
|
||||
in
|
||||
{
|
||||
nixosConfigurations = {
|
||||
nixy = mkHost { hostname = "nixy"; };
|
||||
|
||||
fuji = mkHost { hostname = "fuji"; };
|
||||
|
||||
nixy_iso = mkHost {
|
||||
hostname = "nixy";
|
||||
hardware = false;
|
||||
nixosLib = nixos.lib;
|
||||
extraModules = [
|
||||
{ isoImage.squashfsCompression = "gzip -Xcompression-level 1"; }
|
||||
"${nixos}/nixos/modules/installer/cd-dvd/installation-cd-minimal-new-kernel-no-zfs.nix"
|
||||
];
|
||||
};
|
||||
|
||||
magpie = mkHost {
|
||||
hostname = "magpie";
|
||||
fuji = nixpkgs.lib.nixosSystem rec {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
{ _module.args = inputs; }
|
||||
{ _module.args.system = system; }
|
||||
{ nix.registry.nixpkgs.flake = nixpkgs; }
|
||||
./common/packages.nix
|
||||
./common/suspend.nix
|
||||
./fuji/configuration.nix
|
||||
./fuji/hardware-configuration.nix
|
||||
sops-nix.nixosModules.sops
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users.akill = import ./home/fuji/home.nix;
|
||||
home-manager.extraSpecialArgs = { inherit inputs system; };
|
||||
home-manager.backupFileExtension = "home_backup";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
nixy_iso = nixos.lib.nixosSystem rec {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
{ _module.args = inputs; }
|
||||
{ _module.args.system = system; }
|
||||
{ nix.registry.nixpkgs.flake = nixpkgs; }
|
||||
{ isoImage.squashfsCompression = "gzip -Xcompression-level 1"; }
|
||||
./common/packages.nix
|
||||
./common/suspend.nix
|
||||
./nixy/configuration.nix
|
||||
"${nixos}/nixos/modules/installer/cd-dvd/installation-cd-minimal-new-kernel-no-zfs.nix"
|
||||
sops-nix.nixosModules.sops
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users.akill = import ./home/nixy/home.nix;
|
||||
home-manager.extraSpecialArgs = { inherit inputs system; };
|
||||
home-manager.backupFileExtension = "home_backup";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
mediabox = nixpkgs.lib.nixosSystem rec {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
{ _module.args = inputs; }
|
||||
{ _module.args.system = system; }
|
||||
{ nix.registry.nixpkgs.flake = nixpkgs; }
|
||||
./common/packages.nix
|
||||
./common/suspend.nix
|
||||
./mediabox/configuration.nix
|
||||
./mediabox/hardware-configuration.nix
|
||||
./modules/qbittorrent.nix
|
||||
sops-nix.nixosModules.sops
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users.akill = import ./home/mediabox/home.nix;
|
||||
home-manager.extraSpecialArgs = { inherit inputs system; };
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
blue = nixpkgs.lib.nixosSystem rec {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
{ _module.args = inputs; }
|
||||
{ _module.args.system = system; }
|
||||
{ nix.registry.nixpkgs.flake = nixpkgs; }
|
||||
./blue/configuration.nix
|
||||
./blue/hardware-configuration.nix
|
||||
./common/packages.nix
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.users.akill = import ./home/blue/home.nix;
|
||||
home-manager.extraSpecialArgs = { inherit inputs system; };
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
magpie = nixpkgs.lib.nixosSystem rec {
|
||||
system = "aarch64-linux";
|
||||
packages = false;
|
||||
suspend = false;
|
||||
hm = false;
|
||||
extraModules = [
|
||||
modules = [
|
||||
{ _module.args = inputs; }
|
||||
{ _module.args.system = system; }
|
||||
{ nix.registry.nixpkgs.flake = nixpkgs; }
|
||||
nixos-inventree.nixosModules.default
|
||||
./magpie/configuration.nix
|
||||
./magpie/hardware-configuration.nix
|
||||
simple-nixos-mailserver.nixosModule
|
||||
sops-nix.nixosModules.sops
|
||||
(builtins.toPath "${nixpkgs}/nixos/modules/profiles/qemu-guest.nix")
|
||||
];
|
||||
};
|
||||
|
||||
+168
-117
@@ -8,22 +8,9 @@
|
||||
}:
|
||||
let
|
||||
USER = "akill";
|
||||
|
||||
river-session = pkgs.runCommand "river-session"
|
||||
{ passthru.providedSessions = [ "river" ]; }
|
||||
''
|
||||
install -Dm444 ${pkgs.writeText "river.desktop" ''
|
||||
[Desktop Entry]
|
||||
Name=River
|
||||
Comment=A non-monolithic Wayland compositor
|
||||
Exec=${lib.getExe pkgs.river}
|
||||
Type=Application
|
||||
DesktopNames=river
|
||||
''} $out/share/wayland-sessions/river.desktop
|
||||
'';
|
||||
in
|
||||
{
|
||||
imports = [ ./wireguard.nix ];
|
||||
imports = [ ];
|
||||
|
||||
system = {
|
||||
stateVersion = "23.05";
|
||||
@@ -42,6 +29,22 @@ in
|
||||
group = config.users.users.nobody.group;
|
||||
};
|
||||
|
||||
"wg_privkey" = {
|
||||
sopsFile = ./secrets/wg_privkey.yaml;
|
||||
};
|
||||
|
||||
"wg_preshared/nixy" = {
|
||||
sopsFile = ../common/secrets/wg_preshared.yaml;
|
||||
};
|
||||
|
||||
"wg_privkey_proton" = {
|
||||
sopsFile = ./secrets/wg_privkey_proton.yaml;
|
||||
};
|
||||
|
||||
"wg_endpoint_proton" = {
|
||||
sopsFile = ./secrets/wg_privkey_proton.yaml;
|
||||
};
|
||||
|
||||
"borgbase_enc_key" = {
|
||||
sopsFile = ./secrets/borgbase_enc_key.yaml;
|
||||
owner = config.users.users.${USER}.name;
|
||||
@@ -55,8 +58,6 @@ in
|
||||
};
|
||||
|
||||
nix = {
|
||||
daemonCPUSchedPolicy = "idle";
|
||||
daemonIOSchedClass = "idle";
|
||||
optimise.automatic = true;
|
||||
gc.automatic = true;
|
||||
gc.options = "--delete-older-than 7d";
|
||||
@@ -80,15 +81,10 @@ in
|
||||
'';
|
||||
blacklistedKernelModules = [ ];
|
||||
|
||||
consoleLogLevel = 3;
|
||||
|
||||
initrd.compressor = "zstd";
|
||||
initrd.verbose = false;
|
||||
initrd.kernelModules = [ ];
|
||||
initrd.systemd.enable = true;
|
||||
initrd.luks.devices."cryptroot" = {
|
||||
allowDiscards = true;
|
||||
bypassWorkqueues = true;
|
||||
};
|
||||
binfmt.emulatedSystems = [
|
||||
"wasm32-wasi"
|
||||
"x86_64-windows"
|
||||
@@ -96,39 +92,18 @@ in
|
||||
kernelParams = [
|
||||
"xe.force_probe=a7a0"
|
||||
"i915.force_probe=!a7a0"
|
||||
"quiet"
|
||||
"udev.log_level=3"
|
||||
];
|
||||
kernelPackages = pkgs.linuxPackages_latest;
|
||||
kernel.sysctl = {
|
||||
"net.core.default_qdisc" = "fq";
|
||||
"net.ipv4.tcp_congestion_control" = "bbr";
|
||||
"kernel.unprivileged_userns_clone" = "1"; # Needed with harderned kernel
|
||||
"kernel.kptr_restrict" = 2;
|
||||
"kernel.dmesg_restrict" = 1;
|
||||
"kernel.kexec_load_disabled" = 1;
|
||||
"kernel.yama.ptrace_scope" = 1;
|
||||
"net.ipv4.conf.all.rp_filter" = 1;
|
||||
"net.ipv4.conf.default.rp_filter" = 1;
|
||||
"net.ipv4.conf.all.log_martians" = 1;
|
||||
"net.ipv4.conf.all.accept_redirects" = 0;
|
||||
"net.ipv4.conf.default.accept_redirects" = 0;
|
||||
"net.ipv4.conf.all.send_redirects" = 0;
|
||||
"net.ipv4.conf.default.send_redirects" = 0;
|
||||
"net.ipv6.conf.all.accept_redirects" = 0;
|
||||
"net.ipv6.conf.default.accept_redirects" = 0;
|
||||
# zram tuning (recommended by upstream zram docs)
|
||||
"vm.swappiness" = 180;
|
||||
"vm.page-cluster" = 0;
|
||||
"vm.watermark_boost_factor" = 0;
|
||||
"vm.watermark_scale_factor" = 125;
|
||||
"kernel.unprivileged_userns_clone" = "1"; /* Needed with harderned kernel */
|
||||
};
|
||||
loader.efi.canTouchEfiVariables = true;
|
||||
loader.systemd-boot = {
|
||||
editor = false;
|
||||
enable = true;
|
||||
memtest86.enable = true;
|
||||
configurationLimit = 10;
|
||||
};
|
||||
nixStoreMountOpts = [ "ro" ];
|
||||
supportedFilesystems = [
|
||||
@@ -141,7 +116,6 @@ in
|
||||
rtkit.enable = true;
|
||||
allowSimultaneousMultithreading = true;
|
||||
sudo.enable = true;
|
||||
sudo.execWheelOnly = true;
|
||||
doas.enable = true;
|
||||
doas.extraRules = [
|
||||
{
|
||||
@@ -150,10 +124,6 @@ in
|
||||
persist = true;
|
||||
}
|
||||
];
|
||||
apparmor = {
|
||||
enable = true;
|
||||
killUnconfinedConfinables = true;
|
||||
};
|
||||
};
|
||||
|
||||
powerManagement = {
|
||||
@@ -164,7 +134,6 @@ in
|
||||
nftables.enable = true;
|
||||
firewall = {
|
||||
enable = true;
|
||||
logRefusedConnections = true;
|
||||
allowedTCPPorts = [
|
||||
80
|
||||
443
|
||||
@@ -206,6 +175,21 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
wireguard.interfaces = {
|
||||
wg0 = {
|
||||
ips = [ "10.100.0.6/24" ];
|
||||
privateKeyFile = config.sops.secrets."wg_privkey".path;
|
||||
peers = [
|
||||
{
|
||||
publicKey = builtins.readFile ../magpie/wg_pubkey;
|
||||
presharedKeyFile = config.sops.secrets."wg_preshared/nixy".path;
|
||||
allowedIPs = [ "10.100.0.0/24" ];
|
||||
endpoint = "5.75.229.224:51820";
|
||||
persistentKeepalive = 25;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
time.timeZone = "Europe/Sarajevo";
|
||||
@@ -213,42 +197,24 @@ in
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
nixpkgs.overlays = [
|
||||
nvim.overlays.${system}.overlay
|
||||
(final: prev: {
|
||||
river = prev.river.overrideAttrs (_: rec {
|
||||
version = "0.4.8";
|
||||
src = prev.fetchFromGitea {
|
||||
domain = "codeberg.org";
|
||||
owner = "river";
|
||||
repo = "river";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-vqOGyd0sddjYZ47xPMFmfzDIg8mHfIBzAJQ2CcsMQ3Y=";
|
||||
};
|
||||
});
|
||||
})
|
||||
];
|
||||
environment = {
|
||||
#memoryAllocator.provider = "mimalloc";
|
||||
systemPackages = with pkgs; [
|
||||
maliit-keyboard
|
||||
android-tools
|
||||
river
|
||||
];
|
||||
systemPackages = with pkgs; [ alsa-ucm-conf maliit-keyboard ];
|
||||
variables.ALSA_CONFIG_UCM2 = "${pkgs.alsa-ucm-conf}/share/alsa/ucm2";
|
||||
|
||||
sessionVariables = {
|
||||
LIBVA_DRIVER_NAME = "iHD";
|
||||
KWIN_COMPOSE = "O2ES";
|
||||
WLR_RENDERER = "vulkan";
|
||||
NIXOS_OZONE_WL = "1";
|
||||
MOZ_ENABLE_WAYLAND = "1";
|
||||
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
|
||||
_JAVA_AWT_WM_NONREPARENTING = "1";
|
||||
};
|
||||
|
||||
etc = {
|
||||
"firejail/qutebrowser.local".text = ''
|
||||
whitelist ''${RUNUSER}/qutebrowser
|
||||
'';
|
||||
"xdg/menus/applications.menu".source =
|
||||
"${pkgs.kdePackages.plasma-workspace}/etc/xdg/menus/plasma-applications.menu";
|
||||
"xdg/autostart/powerdevil.desktop".text = ''
|
||||
[Desktop Entry]
|
||||
Hidden=true
|
||||
'';
|
||||
};
|
||||
extraInit = ''
|
||||
unset -v SSH_ASKPASS
|
||||
@@ -260,37 +226,32 @@ in
|
||||
};
|
||||
|
||||
programs = {
|
||||
appimage = {
|
||||
enable = true;
|
||||
binfmt = false;
|
||||
};
|
||||
firejail.enable = true;
|
||||
gtklock.enable = true;
|
||||
gnupg.agent = {
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
};
|
||||
steam = {
|
||||
enable = true;
|
||||
remotePlay.openFirewall = true;
|
||||
dedicatedServer.openFirewall = false;
|
||||
localNetworkGameTransfers.openFirewall = true;
|
||||
};
|
||||
sway.enable = true;
|
||||
gnupg.agent = {
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
};
|
||||
appimage = {
|
||||
enable = true;
|
||||
binfmt = true;
|
||||
};
|
||||
nix-ld = {
|
||||
enable = false;
|
||||
libraries = with pkgs; [
|
||||
stdenv.cc.cc.lib
|
||||
zlib
|
||||
];
|
||||
};
|
||||
zsh.enable = true;
|
||||
firejail.enable = true;
|
||||
adb.enable = true;
|
||||
wireshark.enable = true;
|
||||
zsh = {
|
||||
enable = true;
|
||||
promptInit = "";
|
||||
enableCompletion = false;
|
||||
setOptions = [ ];
|
||||
};
|
||||
};
|
||||
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
wlr.enable = true;
|
||||
config.river.default = [ "wlr" "gtk" ];
|
||||
extraPortals = [ pkgs.kdePackages.xdg-desktop-portal-kde ];
|
||||
sway.enable = true;
|
||||
};
|
||||
|
||||
documentation.dev.enable = true;
|
||||
@@ -319,6 +280,103 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
"netns@" = {
|
||||
description = "%I network namespace";
|
||||
before = [ "network.target" ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
ExecStart = "${pkgs.iproute2}/bin/ip netns add %I";
|
||||
ExecStop = "${pkgs.iproute2}/bin/ip netns del %I";
|
||||
};
|
||||
};
|
||||
|
||||
"wg_proton" = {
|
||||
description = "wg network interface";
|
||||
bindsTo = [ "netns@wg.service" ];
|
||||
requires = [ "network-online.target" ];
|
||||
wants = [ "dnscrypt-proxy_proton.service" ];
|
||||
after = [ "netns@wg.service" ];
|
||||
before = [ "dnscrypt-proxy_proton.service" ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
ExecStart = pkgs.writers.writeBash "wg-up" ''
|
||||
set -e
|
||||
ENDPOINT_IP=$(${pkgs.coreutils-full}/bin/cat "${config.sops.secrets."wg_endpoint_proton".path}")
|
||||
${pkgs.iproute2}/bin/ip link add proton_wg type wireguard
|
||||
${pkgs.iproute2}/bin/ip link set proton_wg netns wg
|
||||
${pkgs.iproute2}/bin/ip -n wg address add 10.2.0.2/32 dev proton_wg
|
||||
${pkgs.iproute2}/bin/ip netns exec wg \
|
||||
${pkgs.wireguard-tools}/bin/wg set "proton_wg" private-key "${
|
||||
config.sops.secrets."wg_privkey_proton".path
|
||||
}"
|
||||
${pkgs.iproute2}/bin/ip netns exec wg \
|
||||
${pkgs.wireguard-tools}/bin/wg set "proton_wg" peer "g6DkXWKI/68RsLjROIwCEcyB/ZhyK5Q7OWcz1TtqER0=" \
|
||||
endpoint "$ENDPOINT_IP:51820" \
|
||||
persistent-keepalive "25" \
|
||||
allowed-ips "0.0.0.0/0"
|
||||
${pkgs.iproute2}/bin/ip -n wg link set lo up
|
||||
${pkgs.iproute2}/bin/ip -n wg link set proton_wg up
|
||||
${pkgs.iproute2}/bin/ip -n wg route add default dev proton_wg
|
||||
'';
|
||||
ExecStop = pkgs.writers.writeBash "wg-down" ''
|
||||
${pkgs.iproute2}/bin/ip -n wg route del default dev proton_wg
|
||||
${pkgs.iproute2}/bin/ip -n wg link del proton_wg
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
"dnscrypt-proxy_proton" = {
|
||||
description = "DNSCrypt-proxy client proton";
|
||||
wants = [
|
||||
"network-online.target"
|
||||
"nss-lookup.target"
|
||||
];
|
||||
before = [ "nss-lookup.target" ];
|
||||
after = [ "wg_proton.service" ];
|
||||
partOf = [ "wg_proton.service" ];
|
||||
serviceConfig = {
|
||||
AmbientCapabilities = "CAP_NET_BIND_SERVICE";
|
||||
CacheDirectory = "dnscrypt-proxy";
|
||||
DynamicUser = true;
|
||||
ExecStart = "${pkgs.dnscrypt-proxy}/bin/dnscrypt-proxy -config ${config.services.dnscrypt-proxy.configFile}";
|
||||
LockPersonality = true;
|
||||
LogsDirectory = "dnscrypt-proxy";
|
||||
MemoryDenyWriteExecute = true;
|
||||
NetworkNamespacePath = "/var/run/netns/wg";
|
||||
NonBlocking = true;
|
||||
NoNewPrivileges = true;
|
||||
PrivateDevices = true;
|
||||
ProtectClock = true;
|
||||
ProtectControlGroups = true;
|
||||
ProtectHome = true;
|
||||
ProtectHostname = true;
|
||||
ProtectKernelLogs = true;
|
||||
ProtectKernelModules = true;
|
||||
ProtectKernelTunables = true;
|
||||
ProtectSystem = "strict";
|
||||
Restart = "always";
|
||||
RestrictAddressFamilies = [
|
||||
"AF_INET"
|
||||
"AF_INET6"
|
||||
];
|
||||
RestrictNamespaces = true;
|
||||
RestrictRealtime = true;
|
||||
RuntimeDirectory = "dnscrypt-proxy";
|
||||
StateDirectory = "dnscrypt-proxy";
|
||||
SystemCallArchitectures = "native";
|
||||
SystemCallFilter = [
|
||||
"@system-service"
|
||||
"@chown"
|
||||
"~@aio"
|
||||
"~@keyring"
|
||||
"~@memlock"
|
||||
"~@setuid"
|
||||
"~@timer"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
coredump.enable = false;
|
||||
@@ -335,19 +393,12 @@ in
|
||||
envfs.enable = true;
|
||||
fstrim.enable = true;
|
||||
fwupd.enable = true;
|
||||
journald.storage = "volatile";
|
||||
ntp.enable = true;
|
||||
openssh.enable = true;
|
||||
power-profiles-daemon.enable = false;
|
||||
printing.enable = true;
|
||||
scx = {
|
||||
enable = true;
|
||||
scheduler = "scx_lavd";
|
||||
};
|
||||
upower.enable = lib.mkForce false;
|
||||
userborn.enable = true;
|
||||
|
||||
displayManager.sessionPackages = [ river-session ];
|
||||
upower.enable = lib.mkForce false;
|
||||
|
||||
greetd = {
|
||||
enable = true;
|
||||
@@ -359,7 +410,6 @@ in
|
||||
--remember \
|
||||
--remember-session \
|
||||
--greeting 'Welcome to NixOS' \
|
||||
--sessions ${config.services.displayManager.sessionData.desktops}/share/wayland-sessions \
|
||||
--cmd sway
|
||||
'';
|
||||
user = "greeter";
|
||||
@@ -367,16 +417,12 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
logind.settings.Login = {
|
||||
HandlePowerKey = "suspend";
|
||||
HandleLidSwitch = "suspend";
|
||||
HandleLidSwitchExternalPower = "suspend";
|
||||
HandleLidSwitchDocked = "ignore";
|
||||
KillUserProcesses = true;
|
||||
logind = {
|
||||
powerKey = "suspend";
|
||||
};
|
||||
|
||||
desktopManager = {
|
||||
plasma6.enable = false;
|
||||
plasma6.enable = true;
|
||||
};
|
||||
|
||||
pipewire = {
|
||||
@@ -482,13 +528,13 @@ in
|
||||
{
|
||||
keys = [ 224 ];
|
||||
events = [ "key" ];
|
||||
command = "${pkgs.brightnessctl}/bin/brightnessctl set 5%-";
|
||||
command = "${pkgs.light}/bin/light -U 5";
|
||||
}
|
||||
|
||||
{
|
||||
keys = [ 225 ];
|
||||
events = [ "key" ];
|
||||
command = "${pkgs.brightnessctl}/bin/brightnessctl set 5%+";
|
||||
command = "${pkgs.light}/bin/light -A 5";
|
||||
}
|
||||
];
|
||||
};
|
||||
@@ -552,6 +598,10 @@ in
|
||||
SystemMaxUse=50M
|
||||
'';
|
||||
|
||||
logind.settings.Login = {
|
||||
KillUserProcesses = true;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
fonts = {
|
||||
@@ -641,6 +691,7 @@ in
|
||||
initialHashedPassword = "$y$j9T$FZnEcCEMIC0Fjj4dZi5t8.$D8ygvO19dR5nyTZxWwDgjEimHutD.sKnD1DLAyhU8.B";
|
||||
shell = pkgs.zsh;
|
||||
extraGroups = [
|
||||
"adbusers"
|
||||
"audio"
|
||||
"dialout"
|
||||
"input"
|
||||
|
||||
@@ -21,14 +21,12 @@
|
||||
{
|
||||
device = "/dev/mapper/fuji_lvm_root-root";
|
||||
fsType = "xfs";
|
||||
options = [ "noatime" "logbsize=256k" ];
|
||||
};
|
||||
|
||||
fileSystems."/home" =
|
||||
{
|
||||
device = "/dev/mapper/fuji_lvm_root-home";
|
||||
fsType = "xfs";
|
||||
options = [ "noatime" "logbsize=256k" ];
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
|
||||
@@ -1,149 +0,0 @@
|
||||
{ config
|
||||
, pkgs
|
||||
, lib
|
||||
, ...
|
||||
}:
|
||||
{
|
||||
sops.secrets = {
|
||||
"wg_privkey" = {
|
||||
sopsFile = ./secrets/wg_privkey.yaml;
|
||||
};
|
||||
|
||||
"wg_preshared/nixy" = {
|
||||
sopsFile = ../common/secrets/wg_preshared.yaml;
|
||||
};
|
||||
|
||||
"wg_privkey_proton" = {
|
||||
sopsFile = ./secrets/wg_privkey_proton.yaml;
|
||||
};
|
||||
|
||||
"wg_endpoint_proton" = {
|
||||
sopsFile = ./secrets/wg_privkey_proton.yaml;
|
||||
};
|
||||
};
|
||||
|
||||
# Personal mesh: dials into the magpie hub (10.100.0.0/24)
|
||||
networking.wireguard.interfaces = {
|
||||
wg0 = {
|
||||
ips = [ "10.100.0.6/24" ];
|
||||
privateKeyFile = config.sops.secrets."wg_privkey".path;
|
||||
peers = [
|
||||
{
|
||||
publicKey = builtins.readFile ../magpie/wg_pubkey;
|
||||
presharedKeyFile = config.sops.secrets."wg_preshared/nixy".path;
|
||||
allowedIPs = [ "10.100.0.0/24" ];
|
||||
endpoint = "5.75.229.224:51820";
|
||||
persistentKeepalive = 25;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
systemd = {
|
||||
services = {
|
||||
# ProtonVPN split tunnel: proton_wg lives inside the `wg` network
|
||||
# namespace; anything that should egress over Proton is launched
|
||||
# with `ip netns exec wg ...`.
|
||||
"netns@" = {
|
||||
description = "%I network namespace";
|
||||
before = [ "network.target" ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
ExecStart = "${pkgs.iproute2}/bin/ip netns add %I";
|
||||
ExecStop = "${pkgs.iproute2}/bin/ip netns del %I";
|
||||
};
|
||||
};
|
||||
|
||||
"wg_proton" = {
|
||||
description = "wg network interface";
|
||||
bindsTo = [ "netns@wg.service" ];
|
||||
requires = [ "network-online.target" ];
|
||||
wants = [ "dnscrypt-proxy_proton.service" ];
|
||||
after = [ "netns@wg.service" ];
|
||||
before = [ "dnscrypt-proxy_proton.service" ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
ExecStart = pkgs.writers.writeBash "wg-up" ''
|
||||
set -e
|
||||
ENDPOINT_IP=$(${pkgs.coreutils-full}/bin/cat "${config.sops.secrets."wg_endpoint_proton".path}")
|
||||
${pkgs.iproute2}/bin/ip link add proton_wg type wireguard
|
||||
${pkgs.iproute2}/bin/ip link set proton_wg netns wg
|
||||
${pkgs.iproute2}/bin/ip -n wg address add 10.2.0.2/32 dev proton_wg
|
||||
${pkgs.iproute2}/bin/ip netns exec wg \
|
||||
${pkgs.wireguard-tools}/bin/wg set "proton_wg" private-key "${
|
||||
config.sops.secrets."wg_privkey_proton".path
|
||||
}"
|
||||
${pkgs.iproute2}/bin/ip netns exec wg \
|
||||
${pkgs.wireguard-tools}/bin/wg set "proton_wg" peer "${lib.fileContents ../common/wg_pubkey_proton}" \
|
||||
endpoint "$ENDPOINT_IP:51820" \
|
||||
persistent-keepalive "25" \
|
||||
allowed-ips "0.0.0.0/0"
|
||||
${pkgs.iproute2}/bin/ip -n wg link set lo up
|
||||
${pkgs.iproute2}/bin/ip -n wg link set proton_wg up
|
||||
${pkgs.iproute2}/bin/ip -n wg route add default dev proton_wg
|
||||
'';
|
||||
ExecStop = pkgs.writers.writeBash "wg-down" ''
|
||||
${pkgs.iproute2}/bin/ip -n wg route del default dev proton_wg
|
||||
${pkgs.iproute2}/bin/ip -n wg link del proton_wg
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
"dnscrypt-proxy_proton" = {
|
||||
description = "DNSCrypt-proxy client proton";
|
||||
wants = [
|
||||
"network-online.target"
|
||||
"nss-lookup.target"
|
||||
];
|
||||
before = [ "nss-lookup.target" ];
|
||||
after = [ "wg_proton.service" ];
|
||||
partOf = [ "wg_proton.service" ];
|
||||
serviceConfig = {
|
||||
AmbientCapabilities = "CAP_NET_BIND_SERVICE";
|
||||
CacheDirectory = "dnscrypt-proxy";
|
||||
DynamicUser = true;
|
||||
ExecStart = "${pkgs.dnscrypt-proxy}/bin/dnscrypt-proxy -config ${config.services.dnscrypt-proxy.configFile}";
|
||||
LockPersonality = true;
|
||||
LogsDirectory = "dnscrypt-proxy";
|
||||
MemoryDenyWriteExecute = true;
|
||||
NetworkNamespacePath = "/var/run/netns/wg";
|
||||
NonBlocking = true;
|
||||
NoNewPrivileges = true;
|
||||
PrivateDevices = true;
|
||||
ProtectClock = true;
|
||||
ProtectControlGroups = true;
|
||||
ProtectHome = true;
|
||||
ProtectHostname = true;
|
||||
ProtectKernelLogs = true;
|
||||
ProtectKernelModules = true;
|
||||
ProtectKernelTunables = true;
|
||||
ProtectSystem = "strict";
|
||||
Restart = "always";
|
||||
RestrictAddressFamilies = [
|
||||
"AF_INET"
|
||||
"AF_INET6"
|
||||
];
|
||||
RestrictNamespaces = true;
|
||||
RestrictRealtime = true;
|
||||
RuntimeDirectory = "dnscrypt-proxy";
|
||||
StateDirectory = "dnscrypt-proxy";
|
||||
SystemCallArchitectures = "native";
|
||||
SystemCallFilter = [
|
||||
"@system-service"
|
||||
"@chown"
|
||||
"~@aio"
|
||||
"~@keyring"
|
||||
"~@memlock"
|
||||
"~@setuid"
|
||||
"~@timer"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Don't bring wg0 up at boot
|
||||
targets."wireguard-wg0".wantedBy = lib.mkForce [ ];
|
||||
};
|
||||
}
|
||||
@@ -1,111 +0,0 @@
|
||||
{ pkgs
|
||||
, inputs
|
||||
, system
|
||||
, lib
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
quickshell_bar = inputs.quickshell_bar.packages.${system}.default;
|
||||
att_wm = inputs.att_wm.packages.${system}.default;
|
||||
|
||||
cliphist_river = pkgs.writeShellScriptBin "cliphist_river" ''
|
||||
${lib.getExe pkgs.cliphist} list | \
|
||||
${lib.getExe pkgs.wofi} --dmenu --insensitive | \
|
||||
${lib.getExe pkgs.cliphist} decode | \
|
||||
${pkgs.wl-clipboard}/bin/wl-copy
|
||||
'';
|
||||
|
||||
screenshot_clip = pkgs.writeShellScriptBin "screenshot_clip" ''
|
||||
GEOM="$(${lib.getExe pkgs.slurp} -d)"
|
||||
${lib.getExe pkgs.grim} -g "$GEOM" - | ${pkgs.wl-clipboard}/bin/wl-copy
|
||||
'';
|
||||
in
|
||||
{
|
||||
# att_wm is configured at compile time, dwm-style — there is no config file to
|
||||
# generate here, and the bindings live in its own src/config.zig (Alt as mod,
|
||||
# nine tags, master/monocle/tabbed). To override them without forking, build
|
||||
# with a replacement config:
|
||||
# inputs.att_wm.packages.${system}.default.override { configFile = ./config.zig; }
|
||||
#
|
||||
# It spawns `foot` and `wmenu-run` by bare name, so both have to be on PATH;
|
||||
# cliphist_river and screenshot_clip are here for a future config.zig to spawn
|
||||
# the same way. The package also carries att_wmctl, the CLI that drives the
|
||||
# window manager over its IPC socket.
|
||||
home.packages = [
|
||||
att_wm
|
||||
pkgs.wmenu
|
||||
cliphist_river
|
||||
screenshot_clip
|
||||
];
|
||||
|
||||
# river runs $XDG_CONFIG_HOME/river/init at startup if it is executable, and
|
||||
# that is the whole of river's configuration surface — it implements no
|
||||
# window management itself, that is att_wm over river-window-management-v1.
|
||||
xdg.configFile."river/init" = {
|
||||
executable = true;
|
||||
text = ''
|
||||
#!${pkgs.runtimeShell}
|
||||
|
||||
# greetd discards the session's stdio, and river/att_wm log to stderr only
|
||||
# — without this a failing window manager is a silent blank screen.
|
||||
log="''${XDG_STATE_HOME:-$HOME/.local/state}/river.log"
|
||||
mkdir -p "$(dirname "$log")"
|
||||
exec >>"$log" 2>&1
|
||||
echo "=== river init $(date -Is) ==="
|
||||
|
||||
# river's session file sets no DesktopNames, so the portal backend
|
||||
# (xdg.portal.config.river in fuji/configuration.nix) needs this.
|
||||
export XDG_CURRENT_DESKTOP=river
|
||||
export XDG_SESSION_TYPE=wayland
|
||||
|
||||
# Hand the session env to systemd/D-Bus, then bring up the target the
|
||||
# user services hang off — same dance the home-manager sway module does.
|
||||
${pkgs.dbus}/bin/dbus-update-activation-environment --systemd \
|
||||
DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP XDG_SESSION_TYPE \
|
||||
NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE
|
||||
systemctl --user reset-failed
|
||||
systemctl --user start river-session.target
|
||||
|
||||
|
||||
# The bar (same one sway and hyprland use) picks its backend from the
|
||||
# environment alone: with no $HYPRLAND_INSTANCE_SIGNATURE and no
|
||||
# $SWAYSOCK/$I3SOCK it falls through to att_wm, so nothing needs setting
|
||||
# here. It retries the connection every second, which is why starting it
|
||||
# before att_wm is fine — and why it must start after river exported
|
||||
# WAYLAND_DISPLAY, since that name is part of the socket path. Both sides
|
||||
# derive $XDG_RUNTIME_DIR/att_wm-$WAYLAND_DISPLAY.sock independently, so
|
||||
# nothing here has to agree on it.
|
||||
${quickshell_bar}/bin/quickshell-bar &
|
||||
bar=$!
|
||||
|
||||
# att_wm comes from the flake input (git.project-cloud.net/asmir/att_wm),
|
||||
# so the session runs exactly the revision flake.lock pins. Iterating on
|
||||
# it now means `nix flake update att_wm` + rebuild; to test a working tree
|
||||
# without that, run it under a nested river via the repo's run-nested.sh.
|
||||
#
|
||||
# Not exec'd: when att_wm exits we still want to tear the target down.
|
||||
# att_wm's Alt+Ctrl+Shift+q (exit_session) ends river itself.
|
||||
echo "starting ${lib.getExe att_wm}"
|
||||
${lib.getExe att_wm}
|
||||
echo "=== att_wm exited with $? at $(date -Is) ==="
|
||||
|
||||
# The bar is a child of this script rather than of att_wm, so it outlives
|
||||
# it: reap it here so an att_wm exit doesn't leave a bar floating over a
|
||||
# session with no window manager.
|
||||
kill "$bar" 2>/dev/null || true
|
||||
|
||||
systemctl --user stop river-session.target
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
systemd.user.targets.river-session = {
|
||||
Unit = {
|
||||
Description = "river compositor session";
|
||||
Documentation = [ "man:systemd.special(7)" ];
|
||||
BindsTo = [ "graphical-session.target" ];
|
||||
Wants = [ "graphical-session-pre.target" ];
|
||||
After = [ "graphical-session-pre.target" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
+18
-8
@@ -16,15 +16,16 @@ let
|
||||
${lib.getExe pkgs.grim} -g "$GEOM" - | ${pkgs.wl-clipboard}/bin/wl-copy
|
||||
'';
|
||||
switch_laptop_mode = pkgs.writeShellScriptBin "switch_laptop_mode" ''
|
||||
${pkgs.systemd}/bin/systemctl --user stop auto-rotate.service
|
||||
${pkgs.procps}/bin/pkill rot8 && \
|
||||
${pkgs.sway}/bin/swaymsg output eDP-1 transform 0
|
||||
'';
|
||||
switch_tablet_mode = pkgs.writeShellScriptBin "switch_tablet_mode" ''
|
||||
${pkgs.systemd}/bin/systemctl --user start auto-rotate.service
|
||||
${lib.getExe pkgs.rot8} \
|
||||
--invert-y \
|
||||
--hooks ''\'systemctl --user restart lisgd.service''\'
|
||||
'';
|
||||
swaysw = inputs.swaysw.packages.${system}.swaysw;
|
||||
quickshell_bar = inputs.quickshell_bar.packages.${system}.default;
|
||||
term = "${pkgs.foot}/bin/foot";
|
||||
term = "${pkgs.foot}/bin/footclient";
|
||||
in
|
||||
{
|
||||
wayland.windowManager.sway = {
|
||||
@@ -91,10 +92,19 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
bars = [ ];
|
||||
startup = [
|
||||
{ command = "exec ${quickshell_bar}/bin/quickshell-bar"; }
|
||||
{ command = "swaymsg 'workspace 1; layout tabbed'"; }
|
||||
bars = [
|
||||
{
|
||||
position = "top";
|
||||
fonts = {
|
||||
names = [
|
||||
"Iosevka"
|
||||
"FontAwesome"
|
||||
];
|
||||
style = "Bold Semi-Condensed";
|
||||
size = 12.0;
|
||||
};
|
||||
statusCommand = "${lib.getExe pkgs.i3status-rust} ~/.config/i3status-rust/config-top.toml";
|
||||
}
|
||||
];
|
||||
|
||||
keybindings = {
|
||||
|
||||
+8
-15
@@ -10,16 +10,11 @@
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
|
||||
programs.fzf = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
|
||||
programs.zsh = {
|
||||
autocd = true;
|
||||
enableCompletion = false;
|
||||
defaultKeymap = "viins";
|
||||
dotDir = config.home.homeDirectory;
|
||||
/* dotDir = "\"$XDG_CONFIG_HOME\"/zsh"; */
|
||||
|
||||
setOptions = [
|
||||
"c_bases"
|
||||
@@ -68,6 +63,11 @@
|
||||
};
|
||||
file = "pure.plugin.zsh";
|
||||
}
|
||||
{
|
||||
name = "fzf";
|
||||
src = pkgs.fzf-zsh;
|
||||
file = "share/zsh/plugins/fzf-zsh/fzf-zsh.plugin.zsh";
|
||||
}
|
||||
{
|
||||
name = "zsh-sudo";
|
||||
src = pkgs.oh-my-zsh;
|
||||
@@ -89,7 +89,7 @@
|
||||
RPS1=""
|
||||
|
||||
function chpwd() {
|
||||
ls --color=tty;
|
||||
ls;
|
||||
}
|
||||
|
||||
function osc7-pwd() {
|
||||
@@ -104,7 +104,7 @@
|
||||
}
|
||||
add-zsh-hook -Uz chpwd chpwd-osc7-pwd
|
||||
|
||||
#eval "$(direnv hook zsh)"
|
||||
eval "$(direnv hook zsh)"
|
||||
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
|
||||
|
||||
if [[ -n "$PS1" ]] && [[ -z "$TMUX" ]] && [[ -n "$SSH_CONNECTION" ]]; then
|
||||
@@ -116,13 +116,6 @@
|
||||
RPS1="{{$BUBBLEWRAP_DIR}}"
|
||||
fi
|
||||
|
||||
autoload -Uz compinit
|
||||
if [[ -n $(print -r -- ~/.zcompdump(Nmh-24)) ]]; then
|
||||
compinit -C
|
||||
else
|
||||
compinit
|
||||
fi
|
||||
|
||||
# Recompile .zcompdump if stale
|
||||
if [[ -f ~/.zcompdump && ( ! -f ~/.zcompdump.zwc || ~/.zcompdump -nt ~/.zcompdump.zwc ) ]]; then
|
||||
zcompile ~/.zcompdump
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
{ pkgs
|
||||
, lib
|
||||
, inputs
|
||||
, system
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
att_menu = inputs.att_menu.packages.${system}.default;
|
||||
att_wm = inputs.att_wm.packages.${system}.default;
|
||||
|
||||
attwmctl = pkgs.writeShellScriptBin "attwmctl" ''
|
||||
exec ${att_wm}/bin/att_wmctl "$@"
|
||||
'';
|
||||
|
||||
tablet_mode =
|
||||
pkgs.writeShellScriptBin "tablet-mode"
|
||||
(builtins.readFile ./tablet-mode.sh);
|
||||
in
|
||||
{
|
||||
home.packages = [
|
||||
att_menu
|
||||
attwmctl
|
||||
tablet_mode
|
||||
];
|
||||
|
||||
systemd.user.services = {
|
||||
att_menu = {
|
||||
Unit = {
|
||||
Description = "att_menu touch panel (tablet mode)";
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
After = [ "graphical-session.target" ];
|
||||
StartLimitIntervalSec = 0;
|
||||
};
|
||||
Service = {
|
||||
ExecStart = lib.getExe att_menu;
|
||||
Restart = "on-failure";
|
||||
RestartSec = 3;
|
||||
};
|
||||
};
|
||||
|
||||
tablet-mode = {
|
||||
Unit = {
|
||||
Description = "Run the tablet-only services while the machine is folded";
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
After = [ "graphical-session.target" ];
|
||||
};
|
||||
Service = {
|
||||
Environment = [
|
||||
"PATH=${lib.makeBinPath [
|
||||
pkgs.evtest
|
||||
pkgs.coreutils
|
||||
pkgs.systemd
|
||||
pkgs.bash
|
||||
]}"
|
||||
];
|
||||
ExecStart = ''
|
||||
${tablet_mode}/bin/tablet-mode \
|
||||
--on 'systemctl --user start att_menu.service squeekboard.service' \
|
||||
--off 'systemctl --user stop att_menu.service squeekboard.service'
|
||||
'';
|
||||
Restart = "always";
|
||||
RestartSec = 5;
|
||||
};
|
||||
Install.WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -1,187 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# auto-rotate — rotate a wlroots output from iio-sensor-proxy orientation events.
|
||||
#
|
||||
# Unlike rot8 this does not read the accelerometer itself. iio-sensor-proxy owns
|
||||
# sensor selection (fuji has two accel_3d devices), applies its own hysteresis,
|
||||
# and reports `undefined` when the device is too flat to have a meaningful
|
||||
# orientation — so there is no dead zone in which we silently keep a stale state.
|
||||
#
|
||||
# SIGUSR1 toggle rotation lock (current transform is kept)
|
||||
# SIGUSR2 re-apply the last known orientation (e.g. after kanshi resets it)
|
||||
|
||||
set -uo pipefail
|
||||
|
||||
OUTPUT="${AUTOROTATE_OUTPUT:-eDP-1}"
|
||||
HOOKS=()
|
||||
VERBOSE=0
|
||||
|
||||
usage() {
|
||||
cat <<-EOF
|
||||
usage: auto-rotate [-o OUTPUT] [-H HOOK]... [-v]
|
||||
|
||||
-o, --output OUTPUT output to rotate (default: ${OUTPUT})
|
||||
-H, --hook CMD run CMD after each rotation; may be repeated.
|
||||
\$ORIENTATION and \$PREV_ORIENTATION are exported.
|
||||
-v, --verbose log every sensor event, not just rotations
|
||||
EOF
|
||||
}
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
-o | --output)
|
||||
OUTPUT="${2:?--output needs a value}"
|
||||
shift 2
|
||||
;;
|
||||
-H | --hook)
|
||||
HOOKS+=("${2:?--hook needs a value}")
|
||||
shift 2
|
||||
;;
|
||||
-v | --verbose)
|
||||
VERBOSE=1
|
||||
shift
|
||||
;;
|
||||
-h | --help)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
printf 'auto-rotate: unknown argument: %s\n' "$1" >&2
|
||||
usage >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
for cmd in monitor-sensor wlr-randr; do
|
||||
command -v "$cmd" >/dev/null || {
|
||||
printf 'auto-rotate: %s not found in PATH\n' "$cmd" >&2
|
||||
exit 1
|
||||
}
|
||||
done
|
||||
|
||||
log() { printf '[auto-rotate] %s\n' "$*"; }
|
||||
vlog() { [ "$VERBOSE" = 1 ] && log "$@"; return 0; }
|
||||
|
||||
# iio-sensor-proxy orientation -> wlr-randr transform.
|
||||
#
|
||||
# NOTE: if the screen ends up 180 degrees off, swap the left-up and right-up
|
||||
# lines. This mapping is the common convention but it is not something the
|
||||
# sensor tells us, so it has to be confirmed by hand once.
|
||||
transform_for() {
|
||||
case "$1" in
|
||||
normal) printf 'normal' ;;
|
||||
left-up) printf '90' ;;
|
||||
bottom-up) printf '180' ;;
|
||||
right-up) printf '270' ;;
|
||||
*) return 1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
current_transform() {
|
||||
wlr-randr 2>/dev/null |
|
||||
awk -v o="$OUTPUT" '
|
||||
$1 == o { found = 1; next }
|
||||
/^[^ \t]/ { found = 0 }
|
||||
found && $1 == "Transform:" { print $2; exit }
|
||||
'
|
||||
}
|
||||
|
||||
applied="$(current_transform)"
|
||||
[ -n "$applied" ] || {
|
||||
printf 'auto-rotate: output %s not found\n' "$OUTPUT" >&2
|
||||
exit 1
|
||||
}
|
||||
log "output ${OUTPUT}, current transform ${applied}"
|
||||
|
||||
orientation="" # last non-undefined orientation from the sensor
|
||||
prev_orientation="" # the one before that, exported to hooks
|
||||
locked=0
|
||||
|
||||
toggle_lock() {
|
||||
locked=$((1 - locked))
|
||||
[ "$locked" = 1 ] && log "rotation locked at ${applied}" || log "rotation unlocked"
|
||||
}
|
||||
|
||||
apply() {
|
||||
local target
|
||||
target="$(transform_for "$orientation")" || return 0
|
||||
[ "$target" = "$applied" ] && return 0
|
||||
|
||||
if ! wlr-randr --output "$OUTPUT" --transform "$target"; then
|
||||
# Do not advance `applied` — a failed rotation must not desync our idea
|
||||
# of the output state from reality. This was rot8's other failure mode.
|
||||
log "wlr-randr failed, keeping transform as ${applied}"
|
||||
return 0
|
||||
fi
|
||||
log "${applied} -> ${target} (${orientation})"
|
||||
applied="$target"
|
||||
|
||||
local hook
|
||||
for hook in ${HOOKS+"${HOOKS[@]}"}; do
|
||||
ORIENTATION="$orientation" PREV_ORIENTATION="$prev_orientation" \
|
||||
bash -c "$hook" || log "hook failed: ${hook}"
|
||||
done
|
||||
}
|
||||
|
||||
reapply() {
|
||||
applied="$(current_transform)"
|
||||
log "re-syncing, output is at ${applied}"
|
||||
[ "$locked" = 0 ] && [ -n "$orientation" ] && apply
|
||||
return 0
|
||||
}
|
||||
|
||||
trap toggle_lock USR1
|
||||
trap reapply USR2
|
||||
|
||||
exec 3< <(stdbuf -oL monitor-sensor 2>&1)
|
||||
monitor_pid=$!
|
||||
trap 'kill "$monitor_pid" 2>/dev/null; exit 0' INT TERM EXIT
|
||||
|
||||
while :; do
|
||||
# A signal interrupts read; that is not an error, so retry rather than exit.
|
||||
IFS= read -r line <&3 || {
|
||||
kill -0 "$monitor_pid" 2>/dev/null && continue
|
||||
break
|
||||
}
|
||||
|
||||
case "$line" in
|
||||
*"Accelerometer orientation changed: "*)
|
||||
new="${line##*: }"
|
||||
;;
|
||||
*"Has accelerometer (orientation: "*)
|
||||
# The initial state only ever arrives on this banner line; a
|
||||
# "changed" line is not emitted until the orientation moves.
|
||||
new="${line#*orientation: }"
|
||||
new="${new%%,*}"
|
||||
;;
|
||||
*"iio-sensor-proxy appeared"*)
|
||||
# The proxy restarted; our cached transform may be stale.
|
||||
reapply
|
||||
continue
|
||||
;;
|
||||
*"Compass heading changed"*)
|
||||
# ~1 Hz of noise we have no use for; drop it even when verbose.
|
||||
continue
|
||||
;;
|
||||
*)
|
||||
vlog "$line"
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
vlog "sensor says ${new}"
|
||||
|
||||
# `undefined` means the device is lying too flat to tell. Hold position.
|
||||
[ "$new" = undefined ] && continue
|
||||
[ "$new" = "$orientation" ] && continue
|
||||
|
||||
prev_orientation="$orientation"
|
||||
orientation="$new"
|
||||
|
||||
[ "$locked" = 1 ] && {
|
||||
vlog "locked, ignoring ${orientation}"
|
||||
continue
|
||||
}
|
||||
apply
|
||||
done
|
||||
|
||||
log "monitor-sensor exited"
|
||||
+41
-108
@@ -1,28 +1,20 @@
|
||||
{ config
|
||||
, lib
|
||||
{ lib
|
||||
, pkgs
|
||||
, inputs
|
||||
, system
|
||||
, config
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
qutebrowser_firejail = pkgs.writeShellScriptBin "qutebrowser" ''
|
||||
firejail -- ${lib.getExe pkgs.qutebrowser} "$@"
|
||||
'';
|
||||
|
||||
auto_rotate =
|
||||
pkgs.writeShellScriptBin "auto-rotate"
|
||||
(builtins.readFile ./auto-rotate.sh);
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
../common/zsh.nix
|
||||
../common/i3status-rust.nix
|
||||
../common/sway.nix
|
||||
../common/river.nix
|
||||
../common/i3.nix
|
||||
./home_packages.nix
|
||||
./att_menu.nix
|
||||
../common/whatsapp-for-linux.nix
|
||||
];
|
||||
|
||||
@@ -33,13 +25,8 @@ in
|
||||
xdg.enable = true;
|
||||
xdg.mimeApps = {
|
||||
enable = true;
|
||||
/*
|
||||
associations.added = {
|
||||
"application/pdf" = [ "org.pwmt.zathura-pdf-mupdf.desktop" "org.pwmt.zathura.desktop" ];
|
||||
};
|
||||
*/
|
||||
defaultApplications = {
|
||||
"application/pdf" = "okular.desktop";
|
||||
"application/pdf" = "zathura.desktop";
|
||||
"default-web-browser" = "org.qutebrowser.qutebrowser.desktop";
|
||||
"text/html" = "org.qutebrowser.qutebrowser.desktop";
|
||||
"x-scheme-handler/about" = "org.qutebrowser.qutebrowser.desktop";
|
||||
@@ -49,27 +36,18 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
gtk = {
|
||||
enable = true;
|
||||
theme = {
|
||||
name = "Adwaita-dark";
|
||||
package = pkgs.gnome-themes-extra;
|
||||
};
|
||||
gtk4.theme = config.gtk.theme;
|
||||
};
|
||||
qt = {
|
||||
enable = true;
|
||||
style.name = "breeze";
|
||||
platformTheme.name = "kde";
|
||||
};
|
||||
|
||||
fonts.fontconfig.enable = true;
|
||||
|
||||
home.sessionVariables = rec {
|
||||
BROWSER = lib.getExe qutebrowser_firejail;
|
||||
DEFAULT_BROWSER = "${BROWSER}";
|
||||
EDITOR = "nvim";
|
||||
_JAVA_AWT_WM_NONREPARENTING = "1";
|
||||
MOZ_ENABLE_WAYLAND = "1";
|
||||
NIXOS_OZONE_WL = "1";
|
||||
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
|
||||
SUDO_EDITOR = "nvim";
|
||||
WLR_RENDERER = "vulkan";
|
||||
};
|
||||
|
||||
home.pointerCursor = {
|
||||
@@ -80,6 +58,7 @@ in
|
||||
|
||||
wayland.windowManager = {
|
||||
sway.enable = true;
|
||||
hyprland.enable = false;
|
||||
};
|
||||
|
||||
programs = {
|
||||
@@ -112,9 +91,6 @@ in
|
||||
pkgs.mpvScripts.uosc
|
||||
pkgs.mpvScripts.webtorrent-mpv-hook
|
||||
];
|
||||
scriptOpts.webtorrent = {
|
||||
path = "/tmp";
|
||||
};
|
||||
config = {
|
||||
osc = "no";
|
||||
osd-bar = "no";
|
||||
@@ -123,19 +99,8 @@ in
|
||||
alang = "eng,en";
|
||||
hwdec = "auto";
|
||||
vo = "dmabuf-wayland";
|
||||
vf = "format=nv12";
|
||||
ao = "pipewire";
|
||||
ytdl-format = "bestvideo[height<=1080]+bestaudio/best[height<=1080]";
|
||||
video-osd = "yes";
|
||||
osd-back-color = "0.0/0.0/0.0/0.0";
|
||||
};
|
||||
|
||||
scriptOpts = {
|
||||
uosc = {
|
||||
disable_elements = "buffering_indicator";
|
||||
timeline_style = "bar";
|
||||
top_bar = "no-border";
|
||||
};
|
||||
};
|
||||
|
||||
bindings = {
|
||||
@@ -169,7 +134,7 @@ in
|
||||
|
||||
foot = {
|
||||
enable = true;
|
||||
server.enable = false;
|
||||
server.enable = true;
|
||||
settings = {
|
||||
main = {
|
||||
font = "JetBrainsMono:size=10";
|
||||
@@ -193,12 +158,6 @@ in
|
||||
};
|
||||
|
||||
settings = {
|
||||
qt.args = [
|
||||
"ignore-gpu-blocklist"
|
||||
"disable-gpu-memory-buffer-video-frames=false"
|
||||
"enable-features=VaapiIgnoreDriverChecks,VaapiVideoDecoder,AcceleratedVideoDecoder,AcceleratedVideoDecodeLinuxGL,AcceleratedVideoEncoder,Vulkan,DefaultANGLEVulkan,VulkanFromANGLE,FluentOverlayScrollbar,MiddleClickAutoscroll"
|
||||
];
|
||||
|
||||
content.notifications.enabled = false;
|
||||
content.pdfjs = true;
|
||||
content.webgl = false;
|
||||
@@ -220,9 +179,6 @@ in
|
||||
tabs.width = "12%";
|
||||
zoom.default = "125%";
|
||||
};
|
||||
extraConfig = ''
|
||||
c.qt.environ = {"QTWEBENGINE_FORCE_USE_GBM": "0"}
|
||||
'';
|
||||
};
|
||||
|
||||
git = {
|
||||
@@ -283,32 +239,49 @@ in
|
||||
|
||||
swayidle =
|
||||
let
|
||||
att_lock = pkgs.writeShellScriptBin "att_lock" ''
|
||||
locker = pkgs.writeShellScriptBin "swaylock_fancy" ''
|
||||
ALL_IMGS=""
|
||||
LOCK_ARGS=""
|
||||
for OUTPUT in $( ${inputs.att_wm.packages.${system}.default}/bin/att_wmctl state | ${lib.getExe pkgs.jq} -r '.outputs[].name')
|
||||
for OUTPUT in $(${pkgs.sway}/bin/swaymsg -t get_outputs | ${lib.getExe pkgs.jq} -r '.[].name')
|
||||
do
|
||||
TMP_FILE=$(${pkgs.coreutils}/bin/mktemp /tmp/.swaylock_ss_XXXXXX.ppm)
|
||||
TMP_FILE=$(${pkgs.coreutils}/bin/mktemp /tmp/.swaylock_ss_XXXXXX.jpg)
|
||||
${lib.getExe pkgs.grim} -t ppm -o $OUTPUT - | \
|
||||
${lib.getExe pkgs.ffmpeg} -y -loglevel 0 -i - -vframes 1 -vf "boxblur=10" "$TMP_FILE"
|
||||
LOCK_ARGS="$LOCK_ARGS --image $OUTPUT:$TMP_FILE"
|
||||
ALL_IMGS="$ALL_IMGS $TMP_FILE"
|
||||
done
|
||||
${lib.getExe inputs.att_lock.packages.${system}.default} -i $ALL_IMGS &
|
||||
${pkgs.coreutils}/bin/sleep 0.2
|
||||
${pkgs.coreutils}/bin/shred $ALL_IMGS &
|
||||
${pkgs.coreutils}/bin/rm $ALL_IMGS &
|
||||
${lib.getExe pkgs.swaylock} -f $LOCK_ARGS
|
||||
${pkgs.coreutils}/bin/shred $ALL_IMGS
|
||||
${pkgs.coreutils}/bin/rm $ALL_IMGS
|
||||
'';
|
||||
in
|
||||
/*
|
||||
refresh_i3status = pkgs.writeShellScriptBin "refresh_i3status" ''
|
||||
${pkgs.coreutils}/bin/sleep 1 && ${pkgs.procps}/bin/pkill -USR1 i3status-rs
|
||||
'';
|
||||
*/
|
||||
{
|
||||
enable = true;
|
||||
events = {
|
||||
before-sleep = "${att_lock}/bin/att_lock";
|
||||
lock = "${att_lock}/bin/att_lock";
|
||||
};
|
||||
events = [
|
||||
{
|
||||
event = "before-sleep";
|
||||
command = "${locker}/bin/swaylock_fancy";
|
||||
}
|
||||
{
|
||||
event = "lock";
|
||||
command = "${locker}/bin/swaylock_fancy";
|
||||
}
|
||||
/*
|
||||
{
|
||||
event = "after-resume";
|
||||
command = "${refresh_i3status}/bin/refresh_i3status";
|
||||
}
|
||||
*/
|
||||
];
|
||||
timeouts = [
|
||||
{
|
||||
timeout = 15 * 60;
|
||||
command = "${att_lock}/bin/att_lock";
|
||||
command = "${locker}/bin/swaylock_fancy";
|
||||
}
|
||||
];
|
||||
};
|
||||
@@ -348,13 +321,9 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
dconf.settings = {
|
||||
"org/gnome/desktop/input-sources".sources = [ (lib.hm.gvariant.mkTuple [ "xkb" "us" ]) ];
|
||||
"org/gnome/desktop/a11y/applications".screen-keyboard-enabled = true;
|
||||
};
|
||||
|
||||
systemd.user = {
|
||||
services = {
|
||||
|
||||
wayland-pipewire-idle-inhibit = {
|
||||
Unit.Description = "inhibit sleep while audio output is active";
|
||||
Service = {
|
||||
@@ -365,30 +334,6 @@ in
|
||||
Install.WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
auto-rotate = {
|
||||
Unit = {
|
||||
Description = "Rotate eDP-1 from iio-sensor-proxy orientation events";
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
After = [ "graphical-session.target" ];
|
||||
};
|
||||
Service = {
|
||||
Environment = [
|
||||
"PATH=${lib.makeBinPath [
|
||||
pkgs.iio-sensor-proxy # monitor-sensor
|
||||
pkgs.wlr-randr
|
||||
pkgs.coreutils # stdbuf, kill
|
||||
pkgs.gawk
|
||||
pkgs.bash # hooks run via bash -c
|
||||
]}"
|
||||
];
|
||||
ExecStart = "${auto_rotate}/bin/auto-rotate";
|
||||
ExecReload = "${pkgs.coreutils}/bin/kill -USR2 $MAINPID";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 5;
|
||||
};
|
||||
Install.WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
lisgd = {
|
||||
Unit = {
|
||||
Description = "Libinput gesture daemon";
|
||||
@@ -426,19 +371,7 @@ in
|
||||
Install.WantedBy = [ "graphical-session.target" ];
|
||||
};
|
||||
|
||||
squeekboard = {
|
||||
Unit = {
|
||||
Description = "squeekboard on-screen keyboard (tablet mode)";
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
After = [ "graphical-session.target" ];
|
||||
StartLimitIntervalSec = 0;
|
||||
};
|
||||
Service = {
|
||||
ExecStart = "${pkgs.squeekboard}/bin/squeekboard";
|
||||
Restart = "on-failure";
|
||||
RestartSec = 3;
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -84,7 +84,6 @@ in
|
||||
glaxnimate
|
||||
gnumake
|
||||
go
|
||||
go-mtpfs
|
||||
grim
|
||||
heimdall
|
||||
hyperfine
|
||||
@@ -93,14 +92,12 @@ in
|
||||
imagemagick
|
||||
imv
|
||||
inkscape
|
||||
#jellyfin-media-player
|
||||
kdePackages.ark
|
||||
kdePackages.dolphin
|
||||
kdePackages.kde-cli-tools
|
||||
kdePackages.kdegraphics-thumbnailers
|
||||
kdePackages.kdenlive
|
||||
kdePackages.kservice
|
||||
kdePackages.okular
|
||||
kdePackages.yakuake
|
||||
kicad
|
||||
kodi-wayland
|
||||
komikku
|
||||
@@ -123,10 +120,9 @@ in
|
||||
nom
|
||||
openems
|
||||
openocd
|
||||
openscad-unstable
|
||||
openscad
|
||||
pandoc
|
||||
#paraview
|
||||
karere
|
||||
pass-wayland
|
||||
patchelf
|
||||
pavucontrol
|
||||
@@ -142,6 +138,7 @@ in
|
||||
qucs-s
|
||||
radeontop
|
||||
remmina
|
||||
river-classic
|
||||
rizin
|
||||
rtorrent
|
||||
sbcl
|
||||
@@ -163,7 +160,7 @@ in
|
||||
ungoogled-chromium
|
||||
upx
|
||||
viber
|
||||
vlc
|
||||
wasistlos
|
||||
waybar
|
||||
wdisplays
|
||||
weechat
|
||||
|
||||
@@ -1,169 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
# tablet-mode — run commands as the machine is folded into, and out of, a tablet.
|
||||
#
|
||||
# sway has `bindswitch tablet:on`, but att_wm has none and river's init is a
|
||||
# startup script rather than an IPC surface, so there is nothing to bind there.
|
||||
# Reading SW_TABLET_MODE off evdev is the one mechanism that works in both
|
||||
# sessions, which is why it is the only one used here — sway's bindswitch is
|
||||
# left gating rotation and nothing else.
|
||||
#
|
||||
# evtest does the reading: without --grab it only listens, so the compositor
|
||||
# still gets the switch, and its opening dump reports the *current* state. That
|
||||
# last part is the reason it is evtest and not `libinput debug-events` — a
|
||||
# session that starts already folded has no transition to react to.
|
||||
|
||||
set -uo pipefail
|
||||
|
||||
DEVICE="${TABLET_MODE_DEVICE:-}"
|
||||
ON_CMD=""
|
||||
OFF_CMD=""
|
||||
VERBOSE=0
|
||||
|
||||
usage() {
|
||||
cat <<-EOF
|
||||
usage: tablet-mode [-d DEVICE] [--on CMD] [--off CMD] [-v]
|
||||
|
||||
-d, --device DEVICE evdev node to watch (default: found by capability)
|
||||
--on CMD run CMD when the machine enters tablet mode
|
||||
--off CMD run CMD when it leaves
|
||||
-v, --verbose log every line evtest prints
|
||||
|
||||
Both commands run through \`bash -c\` with \$TABLET_MODE set to 1 or 0.
|
||||
EOF
|
||||
}
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
-d | --device)
|
||||
DEVICE="${2:?--device needs a value}"
|
||||
shift 2
|
||||
;;
|
||||
--on)
|
||||
ON_CMD="${2:?--on needs a value}"
|
||||
shift 2
|
||||
;;
|
||||
--off)
|
||||
OFF_CMD="${2:?--off needs a value}"
|
||||
shift 2
|
||||
;;
|
||||
-v | --verbose)
|
||||
VERBOSE=1
|
||||
shift
|
||||
;;
|
||||
-h | --help)
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
printf 'tablet-mode: unknown argument: %s\n' "$1" >&2
|
||||
usage >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
command -v evtest >/dev/null || {
|
||||
printf 'tablet-mode: evtest not found in PATH\n' >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
log() { printf '[tablet-mode] %s\n' "$*"; }
|
||||
vlog() {
|
||||
[ "$VERBOSE" = 1 ] && log "$@"
|
||||
return 0
|
||||
}
|
||||
|
||||
# Find the switch by capability rather than by name or by-path: on fuji it is an
|
||||
# intel-hid device that is registered after boot, so neither its event number
|
||||
# nor its presence at our start time can be counted on. Not finding it is a
|
||||
# non-zero exit, which is what makes systemd try us again a few seconds later.
|
||||
#
|
||||
# In /proc/bus/input/devices each device ends with its capability bitmaps, and
|
||||
# SW_TABLET_MODE is bit 1 of the switch one. `H:` precedes `B:` in every record,
|
||||
# so the handler list is always already in hand by the time the bitmap arrives.
|
||||
find_device() {
|
||||
local line handlers="" bitmap handler
|
||||
while IFS= read -r line; do
|
||||
case "$line" in
|
||||
"H: Handlers="*)
|
||||
handlers="${line#H: Handlers=}"
|
||||
;;
|
||||
"B: SW="*)
|
||||
# A bitmap is hex words, most significant first; bit 1
|
||||
# lives in the last of them.
|
||||
bitmap="${line#B: SW=}"
|
||||
bitmap="${bitmap##* }"
|
||||
[ -n "$bitmap" ] || continue
|
||||
(((0x$bitmap & 2) == 0)) && continue
|
||||
for handler in $handlers; do
|
||||
case "$handler" in
|
||||
event*)
|
||||
printf '/dev/input/%s' "$handler"
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
done
|
||||
;;
|
||||
esac
|
||||
done </proc/bus/input/devices
|
||||
return 1
|
||||
}
|
||||
|
||||
if [ -z "$DEVICE" ]; then
|
||||
DEVICE="$(find_device)" || {
|
||||
printf 'tablet-mode: no input device reports SW_TABLET_MODE\n' >&2
|
||||
exit 1
|
||||
}
|
||||
fi
|
||||
[ -r "$DEVICE" ] || {
|
||||
printf 'tablet-mode: cannot read %s\n' "$DEVICE" >&2
|
||||
exit 1
|
||||
}
|
||||
log "watching ${DEVICE}"
|
||||
|
||||
state="" # last seen switch state, "" until evtest reports the first one
|
||||
|
||||
apply() {
|
||||
local cmd
|
||||
case "$1" in
|
||||
1) cmd="$ON_CMD" ;;
|
||||
0) cmd="$OFF_CMD" ;;
|
||||
*) return 0 ;;
|
||||
esac
|
||||
[ -n "$cmd" ] || return 0
|
||||
TABLET_MODE="$1" bash -c "$cmd" || log "hook failed: ${cmd}"
|
||||
}
|
||||
|
||||
exec 3< <(stdbuf -oL evtest "$DEVICE" 2>&1)
|
||||
evtest_pid=$!
|
||||
# Only kill the child here — an `exit` in an EXIT trap would overwrite the
|
||||
# status below, and systemd needs to see a failure to restart us.
|
||||
trap 'kill "$evtest_pid" 2>/dev/null' EXIT
|
||||
trap 'exit 0' INT TERM
|
||||
|
||||
while IFS= read -r line <&3; do
|
||||
case "$line" in
|
||||
# A transition:
|
||||
# Event: time ..., type 5 (EV_SW), code 1 (SW_TABLET_MODE), value 1
|
||||
*"(SW_TABLET_MODE), value "*)
|
||||
new="${line##*, value }"
|
||||
;;
|
||||
# The opening dump, which is where the state at startup comes from:
|
||||
# Event code 1 (SW_TABLET_MODE) state 0
|
||||
*"(SW_TABLET_MODE) state "*)
|
||||
new="${line##* state }"
|
||||
;;
|
||||
*)
|
||||
vlog "$line"
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
|
||||
[ "$new" = "$state" ] && continue
|
||||
state="$new"
|
||||
if [ "$state" = 1 ]; then log "tablet mode on"; else log "tablet mode off"; fi
|
||||
apply "$state"
|
||||
done
|
||||
|
||||
log "evtest exited"
|
||||
exit 1
|
||||
+99
-110
@@ -6,11 +6,6 @@
|
||||
, system
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
altSvc = ''
|
||||
add_header Alt-Svc 'h3=":443"; ma=86400' always;
|
||||
'';
|
||||
in
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
@@ -32,19 +27,6 @@ in
|
||||
boot.kernel.sysctl = {
|
||||
"net.core.default_qdisc" = "fq";
|
||||
"net.ipv4.tcp_congestion_control" = "bbr";
|
||||
"kernel.kptr_restrict" = 2;
|
||||
"kernel.dmesg_restrict" = 1;
|
||||
"kernel.kexec_load_disabled" = 1;
|
||||
"kernel.yama.ptrace_scope" = 1;
|
||||
"net.ipv4.conf.all.rp_filter" = 1;
|
||||
"net.ipv4.conf.default.rp_filter" = 1;
|
||||
"net.ipv4.conf.all.log_martians" = 1;
|
||||
"net.ipv4.conf.all.accept_redirects" = 0;
|
||||
"net.ipv4.conf.default.accept_redirects" = 0;
|
||||
"net.ipv4.conf.all.send_redirects" = 0;
|
||||
"net.ipv4.conf.default.send_redirects" = 0;
|
||||
"net.ipv6.conf.all.accept_redirects" = 0;
|
||||
"net.ipv6.conf.default.accept_redirects" = 0;
|
||||
};
|
||||
|
||||
boot.initrd = {
|
||||
@@ -59,7 +41,7 @@ in
|
||||
ssh = {
|
||||
enable = true;
|
||||
hostKeys = [ /etc/ssh_dummy_ed25519_key ];
|
||||
authorizedKeyFiles = [ ../fuji/ssh_pubkey ];
|
||||
authorizedKeyFiles = [ ../nixy/ssh_pubkey ];
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -67,9 +49,9 @@ in
|
||||
# Set your time zone.
|
||||
time.timeZone = "Europe/Berlin";
|
||||
|
||||
users.users.root.hashedPassword = "!";
|
||||
users.users.root.initialHashedPassword = "";
|
||||
users.users.root.openssh.authorizedKeys.keys = [
|
||||
(builtins.readFile ../fuji/ssh_pubkey)
|
||||
(builtins.readFile ../nixy/ssh_pubkey)
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
@@ -123,17 +105,13 @@ in
|
||||
aliases = [ "asmir.abdulahovic@project-cloud.net" ];
|
||||
};
|
||||
};
|
||||
x509.useACMEHost = "mail.project-cloud.net";
|
||||
certificateScheme = "acme-nginx";
|
||||
};
|
||||
|
||||
services.journald.extraConfig = ''SystemMaxUse=500M '';
|
||||
services.journald.extraConfig = ''SystemMaxUse=50M '';
|
||||
services.logind.settings.Login = { KillUserProcesses = true; };
|
||||
services.openssh.settings.PermitRootLogin = "prohibit-password";
|
||||
services.openssh.enable = true;
|
||||
services.openssh.settings = {
|
||||
PermitRootLogin = "prohibit-password";
|
||||
PasswordAuthentication = false;
|
||||
KbdInteractiveAuthentication = false;
|
||||
};
|
||||
services.openssh.listenAddresses = [
|
||||
{
|
||||
addr = "10.100.0.1"; # wireguard
|
||||
@@ -141,13 +119,6 @@ in
|
||||
}
|
||||
];
|
||||
|
||||
services.fail2ban = {
|
||||
enable = true;
|
||||
maxretry = 5;
|
||||
bantime = "1h";
|
||||
ignoreIP = [ "10.100.0.0/24" ];
|
||||
};
|
||||
|
||||
services.opendkim = {
|
||||
enable = true;
|
||||
selector = "mail";
|
||||
@@ -200,27 +171,6 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
services.inventree = {
|
||||
enable = true;
|
||||
domain = "inventree.project-cloud.net";
|
||||
adminPasswordFile = config.sops.secrets."inventree_admin_pw".path;
|
||||
database.createLocally = true; # local postgresql db + user
|
||||
settings = {
|
||||
INVENTREE_SITE_URL = "https://inventree.project-cloud.net";
|
||||
INVENTREE_DEBUG = "False";
|
||||
};
|
||||
};
|
||||
|
||||
services.part-db = {
|
||||
enable = true;
|
||||
virtualHost = "parts.project-cloud.net";
|
||||
enableNginx = true;
|
||||
enablePostgresql = true;
|
||||
settings = {
|
||||
DEFAULT_URL = "https://parts.project-cloud.net";
|
||||
};
|
||||
};
|
||||
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
recommendedGzipSettings = true;
|
||||
@@ -234,7 +184,6 @@ in
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
root = "${project-cloud.packages.${system}.default}/public";
|
||||
extraConfig = altSvc;
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -243,60 +192,55 @@ in
|
||||
http3 = true;
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
extraConfig = altSvc;
|
||||
};
|
||||
*/
|
||||
|
||||
virtualHosts."miniflux.project-cloud.net" = {
|
||||
quic = true;
|
||||
http3 = true;
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
extraConfig = altSvc;
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:5001";
|
||||
};
|
||||
};
|
||||
*/
|
||||
|
||||
virtualHosts.${config.services.gitea.settings.server.DOMAIN} = {
|
||||
quic = true;
|
||||
http3 = true;
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
extraConfig = altSvc;
|
||||
locations."/" = {
|
||||
proxyPass = "http://unix:${toString config.services.gitea.settings.server.HTTP_ADDR}";
|
||||
};
|
||||
};
|
||||
|
||||
virtualHosts.${config.mailserver.fqdn}.enableACME = true;
|
||||
|
||||
virtualHosts."inventree.project-cloud.net" = {
|
||||
quic = true;
|
||||
http3 = true;
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
extraConfig = altSvc;
|
||||
};
|
||||
|
||||
virtualHosts."parts.project-cloud.net" = {
|
||||
quic = true;
|
||||
http3 = true;
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
extraConfig = altSvc;
|
||||
};
|
||||
|
||||
virtualHosts."stats.project-cloud.net" = {
|
||||
quic = true;
|
||||
http3 = true;
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
extraConfig = altSvc;
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:8002/";
|
||||
};
|
||||
};
|
||||
|
||||
virtualHosts."inventree.project-cloud.net" = {
|
||||
quic = true;
|
||||
http3 = true;
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:8004";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
locations."/static/" = {
|
||||
alias = "/var/lib/inventree/static/";
|
||||
};
|
||||
locations."/media/" = {
|
||||
alias = "/var/lib/inventree/media/";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.gitea = {
|
||||
@@ -351,7 +295,7 @@ in
|
||||
vers4.1 = false
|
||||
'';
|
||||
services.nfs.server.exports = ''
|
||||
/export/fuji 10.100.0.1/24(rw,nohide,insecure,no_subtree_check,all_squash,anonuid=1000,anongid=100)
|
||||
/export/nixy 10.100.0.1/24(rw,nohide,insecure,no_subtree_check,all_squash,anonuid=1000,anongid=100)
|
||||
'';
|
||||
|
||||
services.borgbackup.jobs."borgbase" = {
|
||||
@@ -369,36 +313,80 @@ in
|
||||
startAt = "daily";
|
||||
};
|
||||
|
||||
services.inventree = {
|
||||
enable = true;
|
||||
|
||||
# IP and port for gunicorn to bind to
|
||||
bindIp = "127.0.0.1";
|
||||
bindPort = 8004;
|
||||
# Or override the full bind string for e.g. unix sockets:
|
||||
# serverBind = "unix:/run/inventree/inventree.sock";
|
||||
|
||||
# Where InvenTree stores its data (default: /var/lib/inventree)
|
||||
dataDir = "/var/lib/inventree";
|
||||
|
||||
# Systemd timeout for migrations (can be slow on upgrades)
|
||||
serverStartTimeout = "10min";
|
||||
serverStopTimeout = "5min";
|
||||
|
||||
# config.yaml options — freeform, so any key from
|
||||
# https://docs.inventree.org/en/stable/start/config/ works here
|
||||
config = {
|
||||
site_url = "https://inventree.project-cloud.net";
|
||||
allowed_hosts = [ "*" ];
|
||||
|
||||
# Database — defaults to SQLite if not specified
|
||||
database = {
|
||||
ENGINE = "django.db.backends.postgresql";
|
||||
NAME = "inventree";
|
||||
USER = "inventree";
|
||||
HOST = "/run/postgresql"; # peer auth via unix socket
|
||||
PORT = "";
|
||||
};
|
||||
|
||||
# Static/media/backup paths
|
||||
static_root = "/var/lib/inventree/static";
|
||||
media_root = "/var/lib/inventree/media";
|
||||
backup_dir = "/var/lib/inventree/backup";
|
||||
|
||||
};
|
||||
|
||||
plugins = {
|
||||
inventree-kicad-plugin = [];
|
||||
};
|
||||
|
||||
# Declarative user management
|
||||
users = {
|
||||
admin = {
|
||||
email = "asmir@project-cloud.net";
|
||||
is_superuser = true;
|
||||
password_file = "/tmp/inventree-admin-password";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# If using PostgreSQL:
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
ensureDatabases = [ "inventree" ];
|
||||
ensureUsers = [{
|
||||
name = "inventree";
|
||||
ensureDBOwnership = true;
|
||||
}];
|
||||
};
|
||||
|
||||
# needed for sendmail mail functionality
|
||||
users.users.gitea.extraGroups = [ "postdrop" ];
|
||||
systemd.services.gitea.serviceConfig = {
|
||||
RestrictAddressFamilies = [ "AF_NETLINK" ];
|
||||
ProtectSystem = lib.mkForce false;
|
||||
};
|
||||
systemd.services.part-db-migrate.environment.LD_PRELOAD = lib.mkForce "";
|
||||
systemd.services.phpfpm-part-db.environment.LD_PRELOAD = lib.mkForce "";
|
||||
|
||||
security.acme = {
|
||||
acceptTerms = true;
|
||||
defaults.email = "asmir.abdulahovic@gmail.com";
|
||||
};
|
||||
|
||||
security.sudo.execWheelOnly = true;
|
||||
|
||||
#environment.memoryAllocator.provider = "jemalloc";
|
||||
|
||||
systemd.coredump.enable = false;
|
||||
|
||||
# The upstream part-db module points APP_SHARE_DIR at /var/lib/part-db/share
|
||||
# (where Symfony writes its cache pools) but never creates it, so every cache
|
||||
# write fails and pages fall into a recompute storm that eventually 502s.
|
||||
systemd.tmpfiles.settings."part-db-share"."/var/lib/part-db/share".d = {
|
||||
mode = "0750";
|
||||
user = "part-db";
|
||||
group = "part-db";
|
||||
};
|
||||
|
||||
|
||||
sops = {
|
||||
age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
||||
secrets = {
|
||||
@@ -406,11 +394,8 @@ in
|
||||
"borgbase_enc_key".sopsFile = ./secrets/borgbase_enc_key.yaml;
|
||||
"borgbase_ssh_key".sopsFile = ./secrets/borgbase_ssh_key.yaml;
|
||||
"gitea_mail_pw_hash".sopsFile = ./secrets/gitea_mail_pw_hash.yaml;
|
||||
"inventree_admin_pw" = {
|
||||
sopsFile = ./secrets/inventree_admin_pw.yaml;
|
||||
owner = config.users.users.inventree.name;
|
||||
};
|
||||
"miniflux_env".sopsFile = ./secrets/miniflux.yaml;
|
||||
"wg_preshared/mediabox".sopsFile = ../common/secrets/wg_preshared.yaml;
|
||||
"wg_preshared/nixy".sopsFile = ../common/secrets/wg_preshared.yaml;
|
||||
"wg_preshared/workstation".sopsFile = ../common/secrets/wg_preshared.yaml;
|
||||
"wg_privkey".sopsFile = ./secrets/wg_privkey.yaml;
|
||||
@@ -435,13 +420,14 @@ in
|
||||
80
|
||||
443
|
||||
587
|
||||
]; # http, https, submission
|
||||
2049
|
||||
]; # http, mail, mail, nfs
|
||||
allowedUDPPorts = [
|
||||
443
|
||||
51820
|
||||
]; # http3, wireguard
|
||||
]; # mail, wireguard
|
||||
allowPing = true;
|
||||
logRefusedConnections = lib.mkDefault true;
|
||||
logRefusedConnections = lib.mkDefault false;
|
||||
};
|
||||
|
||||
networking.nat = {
|
||||
@@ -451,7 +437,7 @@ in
|
||||
};
|
||||
|
||||
networking.networkmanager.enable = true;
|
||||
networking.wireless.enable = lib.mkForce false;
|
||||
networking.wireless.enable = false;
|
||||
|
||||
networking.wireguard.interfaces = {
|
||||
wg0 = {
|
||||
@@ -471,10 +457,15 @@ in
|
||||
|
||||
peers = [
|
||||
{
|
||||
publicKey = builtins.readFile ../fuji/wg_pubkey;
|
||||
publicKey = builtins.readFile ../nixy/wg_pubkey;
|
||||
presharedKeyFile = config.sops.secrets."wg_preshared/nixy".path;
|
||||
allowedIPs = [ "10.100.0.6/32" ];
|
||||
}
|
||||
{
|
||||
publicKey = builtins.readFile ../mediabox/wg_pubkey;
|
||||
presharedKeyFile = config.sops.secrets."wg_preshared/mediabox".path;
|
||||
allowedIPs = [ "10.100.0.5/32" ];
|
||||
}
|
||||
{
|
||||
publicKey = builtins.readFile ../common/wg_pubkey_workstation;
|
||||
presharedKeyFile = config.sops.secrets."wg_preshared/workstation".path;
|
||||
@@ -492,12 +483,10 @@ in
|
||||
rebootTime = "30s";
|
||||
};
|
||||
|
||||
/*
|
||||
sleep.extraConfig = ''
|
||||
AllowSuspend=no
|
||||
AllowHibernation=no
|
||||
'';
|
||||
*/
|
||||
};
|
||||
|
||||
system.stateVersion = "22.11";
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
inventree_admin_pw: ENC[AES256_GCM,data:HWjIhHhzLyBxvRdZm2VMANf49qu29n3A,iv:UGvzypdH6RFzBqNG3XRewlszCFhRciZAl1LLkBPtuzU=,tag:poBopBDDkfcLF2iM9z8DjQ==,type:str]
|
||||
sops:
|
||||
age:
|
||||
- enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBvYytXMlgzTUtxcm5LcXJ3
|
||||
VURETHIvRTlIaWx6eVhoRFlhdGl5UGRGYVNjClM4UzRKMFRnNzljK0t6emZOYXJt
|
||||
RkJiYlBPNTRTaEgrMVVkb0xZWFlYRGsKLS0tIGxRZ2UyaDE2Ly9CVUF3Q1JMWGJV
|
||||
eUNDZ0JsRUdUcHJqNTBNVkFjaGZnK3cKgy79yyoUOI34Ixdy2v0tG510LD300GoE
|
||||
JgpJnem9BQiDJmu6+hrJJRKhVONrnZwkOj3GRz1TQX9fglo956rLPg==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
recipient: age153y8mz6gqy5t54q4fnrdvjj4v5ls9cgp3hhpd2hzf5tvkcnncf6q4xns0j
|
||||
- enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBhRVdwam1jaFYvTGpFeGpx
|
||||
b0FMcVNoMDRKWldDUk9PZmdkQ1pEZUJzVWxNCnhmeis4RENCT1hYcVFYV0R5eGlD
|
||||
WVg5R3RFR0VvZ1VrbW5qTVBSd0VwQUkKLS0tIDJUYURneDE2UFpvQzJ0alZPbit4
|
||||
Q29UTFQvQVdRTUxFS3VsbXVuVUhMOTQKxPuwQc5w0sgJ1/pU1aOOZt7tZRO0mSAo
|
||||
XqDN732B0N9vjIG/3bVg+EBpgP4+1OQ5z+06zg9lhyAq6DwS1GXQnA==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
recipient: age1geqqmsnng2e9sja6uxxmtlwlm4c6e5v6ch3l3yjenstq6tjq4fusr0305s
|
||||
lastmodified: "2026-06-16T20:36:07Z"
|
||||
mac: ENC[AES256_GCM,data:4/psCipXWIN9PoGK/ueemgPKzgcFxaeQy4tXZ3nXCStvvBxisyF+l9tf4wM/F25CzPezPQtTex2jqFDreVnznO3ksX6T9PD7lssOqH0wM0PuhNzs8/93CPyJYaRr3OgtVGdu7k0SlGuWH1Dv8QNsEacCSLL3aaHNgFDwdA53Jng=,iv:+N2bk73kjZjHztDGB37dWZUVIw7UxGNK2Nd9vx5+0eA=,tag:KoYWRJ+LYCJK3oJVuJVcQA==,type:str]
|
||||
unencrypted_suffix: _unencrypted
|
||||
version: 3.13.1
|
||||
@@ -0,0 +1,474 @@
|
||||
{ config
|
||||
, nvim
|
||||
, pkgs
|
||||
, system
|
||||
, zremap
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
USER = "akill";
|
||||
in
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
system.stateVersion = "23.05";
|
||||
system.autoUpgrade.enable = false;
|
||||
system.switch = {
|
||||
enable = true;
|
||||
enableNg = true;
|
||||
};
|
||||
|
||||
sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
||||
sops.secrets."peerix/private" = {
|
||||
sopsFile = ./secrets/peerix.yaml;
|
||||
mode = "0400";
|
||||
owner = config.users.users.nobody.name;
|
||||
group = config.users.users.nobody.group;
|
||||
};
|
||||
|
||||
sops.secrets."wg_privkey" = {
|
||||
sopsFile = ./secrets/wg_privkey.yaml;
|
||||
};
|
||||
|
||||
sops.secrets."wg_preshared/mediabox" = {
|
||||
sopsFile = ../common/secrets/wg_preshared.yaml;
|
||||
};
|
||||
|
||||
nix = {
|
||||
optimise.automatic = true;
|
||||
gc.automatic = true;
|
||||
gc.options = "--delete-older-than 7d";
|
||||
package = pkgs.nixVersions.latest;
|
||||
settings = {
|
||||
experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
trusted-users = [ "akill" "root" ];
|
||||
};
|
||||
};
|
||||
|
||||
boot = {
|
||||
initrd = {
|
||||
compressor = "zstd";
|
||||
availableKernelModules = [ "e1000e" ];
|
||||
network = {
|
||||
enable = true;
|
||||
udhcpc.enable = true;
|
||||
ssh = {
|
||||
enable = true;
|
||||
hostKeys = [ /etc/ssh_dummy_ed25519_key ];
|
||||
authorizedKeys = [ (builtins.readFile ../nixy/ssh_pubkey) ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
kernelModules = [ "acpi_call" ];
|
||||
kernelPackages = pkgs.linuxPackages_latest;
|
||||
kernelParams = [ "msr.allow_writes=on" ];
|
||||
kernel.sysctl = {
|
||||
"net.core.default_qdisc" = "fq";
|
||||
"net.ipv4.tcp_congestion_control" = "bbr";
|
||||
};
|
||||
loader.systemd-boot = {
|
||||
editor = false;
|
||||
enable = true;
|
||||
memtest86.enable = true;
|
||||
};
|
||||
readOnlyNixStore = true;
|
||||
supportedFilesystems = [ "btrfs" ];
|
||||
tmp.useTmpfs = true;
|
||||
};
|
||||
|
||||
security = {
|
||||
rtkit.enable = true;
|
||||
allowSimultaneousMultithreading = true;
|
||||
sudo.enable = true;
|
||||
doas.enable = true;
|
||||
doas.extraRules = [
|
||||
{
|
||||
users = [ USER ];
|
||||
keepEnv = true;
|
||||
persist = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
powerManagement = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
networking = {
|
||||
nftables.enable = true;
|
||||
firewall = {
|
||||
enable = true;
|
||||
allowedTCPPorts = [
|
||||
80
|
||||
443
|
||||
51820
|
||||
8020
|
||||
];
|
||||
};
|
||||
|
||||
hostName = "mediabox";
|
||||
interfaces.enp0s25.useDHCP = true;
|
||||
interfaces.wlp3s0.useDHCP = false;
|
||||
useDHCP = false;
|
||||
wireless.enable = false;
|
||||
wireless.interfaces = [ "wlp3s0" ];
|
||||
nameservers = [
|
||||
"127.0.0.1"
|
||||
"::1"
|
||||
];
|
||||
dhcpcd.extraConfig = "nohook resolv.conf";
|
||||
|
||||
extraHosts = ''
|
||||
192.168.1.173 nixy.lan
|
||||
192.168.88.171 jellyfin.mediabox.lan
|
||||
192.168.88.171 jellyseerr.mediabox.lan
|
||||
192.168.88.171 mediabox.lan
|
||||
192.168.88.171 qbittorrent.mediabox.lan
|
||||
192.168.88.1 router.lan
|
||||
192.168.88.231 workstation.lan
|
||||
192.168.88.121 ender.lan
|
||||
'';
|
||||
|
||||
wireguard.interfaces = {
|
||||
wg0 = {
|
||||
ips = [ "10.100.0.5/24" ];
|
||||
privateKeyFile = config.sops.secrets."wg_privkey".path;
|
||||
peers = [
|
||||
{
|
||||
publicKey = builtins.readFile ../magpie/wg_pubkey;
|
||||
presharedKeyFile = config.sops.secrets."wg_preshared/mediabox".path;
|
||||
allowedIPs = [ "10.100.0.0/24" ];
|
||||
endpoint = "5.75.229.224:51820";
|
||||
persistentKeepalive = 25;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
time.timeZone = "Europe/Sarajevo";
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
nixpkgs.overlays = [ nvim.overlays.${system}.overlay ];
|
||||
environment = {
|
||||
homeBinInPath = true;
|
||||
variables = {
|
||||
PATH = "$HOME/.cargo/bin";
|
||||
};
|
||||
};
|
||||
|
||||
programs = {
|
||||
steam = {
|
||||
enable = true;
|
||||
remotePlay.openFirewall = true;
|
||||
dedicatedServer.openFirewall = false;
|
||||
localNetworkGameTransfers.openFirewall = true;
|
||||
};
|
||||
gnupg.agent = {
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
};
|
||||
appimage = {
|
||||
enable = true;
|
||||
binfmt = true;
|
||||
};
|
||||
nix-ld = {
|
||||
enable = false;
|
||||
libraries = with pkgs; [
|
||||
stdenv.cc.cc.lib
|
||||
zlib
|
||||
];
|
||||
};
|
||||
zsh.enable = true;
|
||||
firejail.enable = true;
|
||||
};
|
||||
|
||||
# List services that you want to enable:
|
||||
systemd = {
|
||||
services = {
|
||||
"zremap@" = {
|
||||
enable = true;
|
||||
restartIfChanged = true;
|
||||
serviceConfig.Nice = -20;
|
||||
unitConfig = {
|
||||
Description = "zremap on %I";
|
||||
ConditionPathExists = "%I";
|
||||
};
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart = "${zremap.defaultPackage.${system}}/bin/zremap %I";
|
||||
};
|
||||
};
|
||||
|
||||
"wakeonlan" = {
|
||||
description = "Reenable wake on lan every boot";
|
||||
after = [ "network.target" ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${pkgs.ethtool}/sbin/ethtool -s enp0s25 wol m";
|
||||
};
|
||||
wantedBy = [
|
||||
"default.target"
|
||||
"suspend.target"
|
||||
"shutdown.target"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
coredump.enable = false;
|
||||
extraConfig = ''
|
||||
DefaultTimeoutStartSec=30s
|
||||
DefaultTimeoutStopSec=30s
|
||||
'';
|
||||
};
|
||||
|
||||
services = {
|
||||
acpid.enable = true;
|
||||
btrfs.autoScrub.enable = true;
|
||||
dbus.enable = true;
|
||||
dbus.implementation = "broker";
|
||||
envfs.enable = true;
|
||||
fstrim.enable = true;
|
||||
fwupd.enable = true;
|
||||
ntp.enable = true;
|
||||
openssh.enable = true;
|
||||
openssh.settings.PermitRootLogin = "yes";
|
||||
thinkfan.enable = false;
|
||||
|
||||
xrdp = {
|
||||
enable = true;
|
||||
defaultWindowManager = "icewm";
|
||||
openFirewall = true;
|
||||
};
|
||||
|
||||
logind = {
|
||||
lidSwitch = "ignore";
|
||||
};
|
||||
|
||||
jellyfin = {
|
||||
enable = false;
|
||||
user = "akill";
|
||||
openFirewall = true;
|
||||
};
|
||||
|
||||
jellyseerr = {
|
||||
enable = false;
|
||||
openFirewall = true;
|
||||
};
|
||||
|
||||
pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
|
||||
avahi = {
|
||||
enable = false;
|
||||
nssmdns4 = false;
|
||||
openFirewall = true;
|
||||
};
|
||||
|
||||
libinput.enable = true;
|
||||
xserver = {
|
||||
enable = true;
|
||||
dpi = 144;
|
||||
desktopManager.xterm.enable = false;
|
||||
desktopManager.plasma5.bigscreen.enable = true;
|
||||
#desktopManager.plasma6.enable = true;
|
||||
displayManager = {
|
||||
lightdm.enable = false;
|
||||
startx.enable = true;
|
||||
sddm.enable = true;
|
||||
sddm.wayland.enable = true;
|
||||
};
|
||||
windowManager.i3.enable = false;
|
||||
};
|
||||
|
||||
udev = {
|
||||
packages = [ ];
|
||||
extraRules = ''
|
||||
#zremap on new keyboard
|
||||
ACTION=="add", SUBSYSTEM=="input", ATTRS{phys}!="", KERNEL=="event[0-9]*", ENV{ID_INPUT_KEY}=="1", ENV{ID_INPUT_KEYBOARD}=="1", TAG+="systemd", ENV{SYSTEMD_WANTS}+="zremap@$env{DEVNAME}.service"
|
||||
'';
|
||||
};
|
||||
|
||||
tlp = {
|
||||
enable = false;
|
||||
};
|
||||
|
||||
batteryNotifier = {
|
||||
enable = false;
|
||||
notifyCapacity = 20;
|
||||
suspendCapacity = 10;
|
||||
};
|
||||
|
||||
actkbd = {
|
||||
enable = true;
|
||||
bindings = [
|
||||
{
|
||||
keys = [ 115 ];
|
||||
events = [ "key" ];
|
||||
command = "XDG_RUNTIME_DIR=/run/user/$(id -u ${USER}) ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+";
|
||||
}
|
||||
|
||||
{
|
||||
keys = [ 114 ];
|
||||
events = [
|
||||
"key"
|
||||
"rep"
|
||||
];
|
||||
command = "XDG_RUNTIME_DIR=/run/user/$(id -u ${USER}) ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-";
|
||||
}
|
||||
|
||||
{
|
||||
keys = [ 113 ];
|
||||
events = [
|
||||
"key"
|
||||
"rep"
|
||||
];
|
||||
command = "XDG_RUNTIME_DIR=/run/user/$(id -u ${USER}) ${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
|
||||
}
|
||||
|
||||
{
|
||||
keys = [ 224 ];
|
||||
events = [ "key" ];
|
||||
command = "${pkgs.light}/bin/light -U 5";
|
||||
}
|
||||
|
||||
{
|
||||
keys = [ 225 ];
|
||||
events = [ "key" ];
|
||||
command = "${pkgs.light}/bin/light -A 5";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
dnscrypt-proxy2 = {
|
||||
enable = true;
|
||||
settings = {
|
||||
ipv6_servers = true;
|
||||
require_dnssec = true;
|
||||
require_nolog = true;
|
||||
require_nofilter = true;
|
||||
http3 = true;
|
||||
|
||||
sources.public-resolvers = {
|
||||
urls = [
|
||||
"https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/public-resolvers.md"
|
||||
"https://download.dnscrypt.info/resolvers-list/v3/public-resolvers.md"
|
||||
];
|
||||
cache_file = "/var/lib/dnscrypt-proxy/public-resolvers.md";
|
||||
minisign_key = "RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
journald.extraConfig = ''
|
||||
SystemMaxUse=50M
|
||||
'';
|
||||
|
||||
logind.extraConfig = ''
|
||||
KillUserProcesses=yes
|
||||
'';
|
||||
|
||||
};
|
||||
|
||||
fonts = {
|
||||
fontconfig = {
|
||||
cache32Bit = true;
|
||||
allowBitmaps = true;
|
||||
useEmbeddedBitmaps = true;
|
||||
defaultFonts = {
|
||||
monospace = [ "JetBrainsMono" ];
|
||||
};
|
||||
};
|
||||
|
||||
packages = with pkgs; [
|
||||
dejavu_fonts
|
||||
dina-font
|
||||
fira-code
|
||||
fira-code-symbols
|
||||
font-awesome_6
|
||||
inconsolata
|
||||
iosevka
|
||||
jetbrains-mono
|
||||
liberation_ttf
|
||||
libertine
|
||||
noto-fonts
|
||||
noto-fonts-cjk-sans
|
||||
noto-fonts-color-emoji
|
||||
noto-fonts-emoji
|
||||
proggyfonts
|
||||
siji
|
||||
terminus_font
|
||||
terminus_font_ttf
|
||||
ubuntu_font_family
|
||||
vistafonts
|
||||
];
|
||||
};
|
||||
|
||||
virtualisation = {
|
||||
podman = {
|
||||
enable = false;
|
||||
autoPrune.enable = true;
|
||||
dockerCompat = true;
|
||||
};
|
||||
};
|
||||
|
||||
hardware = {
|
||||
bluetooth = {
|
||||
enable = true;
|
||||
settings = {
|
||||
General = {
|
||||
Enable = "Source,Sink,Media,Socket";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
graphics = {
|
||||
enable = true;
|
||||
extraPackages = [ ];
|
||||
};
|
||||
};
|
||||
|
||||
zramSwap = {
|
||||
enable = false;
|
||||
algorithm = "zstd";
|
||||
};
|
||||
|
||||
users.users.${USER} = {
|
||||
isNormalUser = true;
|
||||
shell = pkgs.zsh;
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"tty"
|
||||
"audio"
|
||||
"sound"
|
||||
];
|
||||
openssh.authorizedKeys.keys = [
|
||||
(builtins.readFile ../nixy/ssh_pubkey)
|
||||
];
|
||||
};
|
||||
|
||||
users.users.ado = {
|
||||
isNormalUser = true;
|
||||
shell = pkgs.zsh;
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"tty"
|
||||
"audio"
|
||||
"sound"
|
||||
];
|
||||
};
|
||||
|
||||
users.users.mediauser = {
|
||||
isNormalUser = true;
|
||||
shell = pkgs.bash;
|
||||
extraGroups = [ ];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{
|
||||
lib,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"ehci_pci"
|
||||
"ahci"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
"rtsx_pci_sdmmc"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/ae774285-60dc-4b08-ab26-8208e8f4e81e";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"subvol=root"
|
||||
"compress=lzo"
|
||||
"noatime"
|
||||
];
|
||||
};
|
||||
|
||||
boot.initrd.luks.devices."enc".device = "/dev/disk/by-uuid/60aa7671-bfee-451b-b871-ac7c5a4a9f3a";
|
||||
|
||||
fileSystems."/home" = {
|
||||
device = "/dev/disk/by-uuid/ae774285-60dc-4b08-ab26-8208e8f4e81e";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"subvol=home"
|
||||
"compress=lzo"
|
||||
"noatime"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/nix" = {
|
||||
device = "/dev/disk/by-uuid/ae774285-60dc-4b08-ab26-8208e8f4e81e";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"subvol=nix"
|
||||
"compress=lzo"
|
||||
"noatime"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/persist" = {
|
||||
device = "/dev/disk/by-uuid/ae774285-60dc-4b08-ab26-8208e8f4e81e";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"subvol=persist"
|
||||
"compress=lzo"
|
||||
"noatime"
|
||||
];
|
||||
};
|
||||
|
||||
fileSystems."/var/log" = {
|
||||
device = "/dev/disk/by-uuid/ae774285-60dc-4b08-ab26-8208e8f4e81e";
|
||||
fsType = "btrfs";
|
||||
options = [
|
||||
"subvol=log"
|
||||
"compress=lzo"
|
||||
"noatime"
|
||||
];
|
||||
neededForBoot = true;
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/4B94-6E7B";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{ device = "/dev/disk/by-uuid/7b44ab02-84ff-4ffd-be26-58247cf5a982"; }
|
||||
];
|
||||
|
||||
hardware.cpu.intel.updateMicrocode = true;
|
||||
nix.settings.max-jobs = lib.mkDefault 8;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
peerix-mediabox:UDgG3xdQYv7bmx2l4ZPNRPJtp2zMmY++H/fnGeJ9BQw=
|
||||
@@ -0,0 +1,31 @@
|
||||
peerix:
|
||||
private: ENC[AES256_GCM,data:m76hyDWzcIlczegZyPyTtOYOgOGeyX++SeGsqEWS5b3ZbR2M9RqUGYEscLRX3/Dlff2vgs+hI4cOjiMnhq9pnLzP25Xh4XAiJNMkD43fFCCb7zj2RUWEyLAzzmWpR8fSB1mXTpciUGM=,iv:s9EXpkGYR0kI5xQZ8wAmkobK1q4XlVdFH4irEVwy1bs=,tag:L7AF6mFsxss6NDantbqXMw==,type:str]
|
||||
sops:
|
||||
kms: []
|
||||
gcp_kms: []
|
||||
azure_kv: []
|
||||
hc_vault: []
|
||||
age:
|
||||
- recipient: age19yrl6pr73cv067ksfz0txp3zm2au25jfyjeerw23ml55ps5cyyfqtm3kmt
|
||||
enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB2Zmc0c1AxMVEzdi94L0Nh
|
||||
dHJFSHVSbG1vay9NUDBEVkM4ZWNoT3h4Q1c0CkhWdWVzTEJxZENZYXVFT2RhV3pT
|
||||
aDZIUUdWVUVRUDc4ZEFDTkdnaDJxdVkKLS0tIDd6TE56REdjRVdtSXB1dkJrVVNj
|
||||
dUxhRnB4dVFRam9xNlFiY2VOSXpNamcKNzRghHeyPtltKH4GkJQ0ef4apr5gziq9
|
||||
dhXy6Qil48QJd4hnyr7GW1n7eRIq24OWO3WglLbVAUSQr/gzM2TWiA==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
- recipient: age1geqqmsnng2e9sja6uxxmtlwlm4c6e5v6ch3l3yjenstq6tjq4fusr0305s
|
||||
enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBSMjVQZkVVQmZFbCt3Z2ZI
|
||||
Q3NVZUJ0VkZjK0E5SFpqWE50c2dOeFNsUm1jCmdDZGxZYk13emhhanRzWjhvZFM1
|
||||
UWNpNm5malkrU1Rkak9PNWk2bW5nRDQKLS0tIE9UdXg4L0hMRzJuUERIMytvc2pr
|
||||
Y1BBZFJseUNIeTVtTjBGazk5WE1ZcUUKs9pEtDbCYRfSP0Rh9ENo9A6nUFkYHr4D
|
||||
3DvOKSyLL33FBoEddDBd7Si1mpjY2bunueBAe+diDgOrol6tWIMoUw==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
lastmodified: "2023-09-30T14:18:57Z"
|
||||
mac: ENC[AES256_GCM,data:R0TJ/7uihpsCHwPLXFYKi+ZaEUtbZVz02utDF7vO7gYDN1MFa0c5nZ/mAnJJtTJI41GdAu9ezTUiU6H1HTHLxYMeUoNAAvNlSCkvGc/oMQofXidL34hq1X2vG05N3UQlkbAXTlCBkYc20oVVOVmT/lq7USEx29oB/ytxZzKYFvM=,iv:qpz0g+O4kwChct1ddiT3D8rZBg08YUr4Ba5pJ4WQyzo=,tag:pWLFiQWl1QSzveBxnq4uXw==,type:str]
|
||||
pgp: []
|
||||
unencrypted_suffix: _unencrypted
|
||||
version: 3.8.0
|
||||
@@ -0,0 +1,30 @@
|
||||
wg_privkey: ENC[AES256_GCM,data:ovAxwZEcmRzt/zb42ortPwPyREC16E5YNfDBguZK7uByR4BgJi8kNeoG+GY=,iv:Cv50+JB5S+44U3L9od4zwrEKHi/LM38LnA94DkvCer4=,tag:ehKQrqWwA6daxc2yASDWNQ==,type:str]
|
||||
sops:
|
||||
kms: []
|
||||
gcp_kms: []
|
||||
azure_kv: []
|
||||
hc_vault: []
|
||||
age:
|
||||
- recipient: age19yrl6pr73cv067ksfz0txp3zm2au25jfyjeerw23ml55ps5cyyfqtm3kmt
|
||||
enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBKSGxudng1enhDa281S0pm
|
||||
Q0kwQmc1T2hUK0dHd3B4cUh3RzZPZ1dGaXo4CkdPMzNnQWMyYjJiUWk4WEYyODFp
|
||||
b2FTbnZwMHh6SHhIcjVNbnBKSVk3TWMKLS0tIFBZOW56K2Y5Q3I4dmh5dXBieEF2
|
||||
SWQwcmkzQU5aeEliS29QN3Y0V04zNU0KF0WmF8BDvZ2DyJFztKJv8YmDuqVsAoO4
|
||||
QEVLwrJDurRxcNIVGLs5W+60Osa5XMpNc74e23rU7mucB5wPA/84dg==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
- recipient: age1geqqmsnng2e9sja6uxxmtlwlm4c6e5v6ch3l3yjenstq6tjq4fusr0305s
|
||||
enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBWMUtUYyswV3czWDdXWG1x
|
||||
cnh5QTZpdlBZYlZ2b2oweXJ5SkZSQldhQmpZCmFrQVlyYnNqZ01kVTVNQTlBRFNR
|
||||
WDlITEJOUFZGa0U2NG8xMGpkSnNOQTAKLS0tIDNlK0dxWnB3a3dkTnRmTm5oTlFD
|
||||
eGV1VE1tL1c0a3hUdXM2bExmV1l3RnMK8aOugY3XHTCfeBDJVOyGljuuu6hQGJ7W
|
||||
ZGoxOz+hhYIHj/04J9DIIOUyt81m8LNCbxcacFKyW7Sqosfj+7N7Gg==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
lastmodified: "2024-04-14T19:25:26Z"
|
||||
mac: ENC[AES256_GCM,data:vcyglyYG93K3KBISpIESGlNCs5ojWZAL0gyDUzBNCxG5H8RKEz1Y7yOtr5EXnnP66qcBHlKhb81Iyrc071pmJL9dIttiqmvjSWf0zZ9RuV0uYcO/42cqk3J4tBJ6iYCi64y58jifDObbRni6jiGVEGEkSk8cXFqR8UXoSTeXWtU=,iv:avpWr8SeHK1VHz9XhkO7Nd7VOfMP7JXcQaXJA8Xiuhs=,tag:ixJsw/snZEWXGhdPLU1cGg==,type:str]
|
||||
pgp: []
|
||||
unencrypted_suffix: _unencrypted
|
||||
version: 3.8.1
|
||||
@@ -0,0 +1 @@
|
||||
S+tL/pTm4D7bsWj/dhpPXHYxcye/DuNMguLD5l1ACEU=
|
||||
@@ -0,0 +1,659 @@
|
||||
{ config
|
||||
, nvim
|
||||
, pkgs
|
||||
, system
|
||||
, zremap
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
USER = "akill";
|
||||
in
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
system = {
|
||||
stateVersion = "23.05";
|
||||
autoUpgrade.enable = false;
|
||||
etc.overlay.enable = true;
|
||||
nixos-init.enable = true;
|
||||
};
|
||||
|
||||
sops = {
|
||||
age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
||||
secrets = {
|
||||
"peerix/private" = {
|
||||
sopsFile = ./secrets/peerix.yaml;
|
||||
mode = "0400";
|
||||
owner = config.users.users.nobody.name;
|
||||
group = config.users.users.nobody.group;
|
||||
};
|
||||
|
||||
"wg_privkey" = {
|
||||
sopsFile = ./secrets/wg_privkey.yaml;
|
||||
};
|
||||
|
||||
"wg_preshared/nixy" = {
|
||||
sopsFile = ../common/secrets/wg_preshared.yaml;
|
||||
};
|
||||
|
||||
"wg_privkey_proton" = {
|
||||
sopsFile = ./secrets/wg_privkey_proton.yaml;
|
||||
};
|
||||
|
||||
"wg_endpoint_proton" = {
|
||||
sopsFile = ./secrets/wg_privkey_proton.yaml;
|
||||
};
|
||||
|
||||
"borgbase_enc_key" = {
|
||||
sopsFile = ./secrets/borgbase_enc_key.yaml;
|
||||
owner = config.users.users.${USER}.name;
|
||||
};
|
||||
|
||||
"borgbase_ssh_key" = {
|
||||
sopsFile = ./secrets/borgbase_ssh_key.yaml;
|
||||
owner = config.users.users.${USER}.name;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
nix = {
|
||||
optimise.automatic = true;
|
||||
gc.automatic = true;
|
||||
gc.options = "--delete-older-than 7d";
|
||||
package = pkgs.nixVersions.latest;
|
||||
settings = {
|
||||
sandbox = true;
|
||||
experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
boot = {
|
||||
extraModulePackages = with config.boot.kernelPackages; [
|
||||
usbip
|
||||
v4l2loopback
|
||||
];
|
||||
initrd.compressor = "zstd";
|
||||
initrd.kernelModules = [ ];
|
||||
initrd.systemd.enable = true;
|
||||
binfmt.emulatedSystems = [
|
||||
"wasm32-wasi"
|
||||
"x86_64-windows"
|
||||
];
|
||||
kernelParams = [
|
||||
"psmouse.synaptics_intertouch=0"
|
||||
"mem_sleep_default=deep"
|
||||
"amdgpu.sg_display=0"
|
||||
"amdgpu.gttsize=2048"
|
||||
];
|
||||
kernelPackages = pkgs.linuxPackages_latest;
|
||||
kernel.sysctl = {
|
||||
"net.core.default_qdisc" = "fq";
|
||||
"net.ipv4.tcp_congestion_control" = "bbr";
|
||||
"kernel.unprivileged_userns_clone" = "1"; /* Needed with harderned kernel */
|
||||
};
|
||||
loader.efi.canTouchEfiVariables = true;
|
||||
loader.systemd-boot = {
|
||||
editor = false;
|
||||
enable = true;
|
||||
memtest86.enable = true;
|
||||
};
|
||||
nixStoreMountOpts = [ "ro" ];
|
||||
supportedFilesystems = [
|
||||
"xfs"
|
||||
];
|
||||
tmp.useTmpfs = true;
|
||||
};
|
||||
|
||||
security = {
|
||||
rtkit.enable = true;
|
||||
allowSimultaneousMultithreading = true;
|
||||
sudo.enable = true;
|
||||
doas.enable = true;
|
||||
doas.extraRules = [
|
||||
{
|
||||
users = [ USER ];
|
||||
keepEnv = true;
|
||||
persist = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
powerManagement = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
networking = {
|
||||
nftables.enable = true;
|
||||
firewall = {
|
||||
enable = true;
|
||||
allowedTCPPorts = [
|
||||
80
|
||||
443
|
||||
51820
|
||||
8020
|
||||
];
|
||||
};
|
||||
|
||||
hostName = "nixy";
|
||||
nameservers = [
|
||||
"127.0.0.1"
|
||||
"::1"
|
||||
];
|
||||
dhcpcd.extraConfig = "nohook resolv.conf";
|
||||
|
||||
extraHosts = ''
|
||||
192.168.88.171 jellyfin.mediabox.lan
|
||||
192.168.88.171 jellyseerr.mediabox.lan
|
||||
192.168.88.171 mediabox.lan
|
||||
192.168.88.171 qbittorrent.mediabox.lan
|
||||
192.168.88.1 router.lan
|
||||
192.168.88.231 workstation.lan
|
||||
192.168.88.121 ender.lan
|
||||
'';
|
||||
|
||||
networkmanager = {
|
||||
enable = true;
|
||||
dns = "none";
|
||||
wifi.backend = "iwd";
|
||||
};
|
||||
|
||||
wireless.iwd = {
|
||||
enable = true;
|
||||
settings = {
|
||||
General = {
|
||||
AddressRandomization = "network";
|
||||
#EnableNetworkConfiguration = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
wireguard.interfaces = {
|
||||
wg0 = {
|
||||
ips = [ "10.100.0.6/24" ];
|
||||
privateKeyFile = config.sops.secrets."wg_privkey".path;
|
||||
peers = [
|
||||
{
|
||||
publicKey = builtins.readFile ../magpie/wg_pubkey;
|
||||
presharedKeyFile = config.sops.secrets."wg_preshared/nixy".path;
|
||||
allowedIPs = [ "10.100.0.0/24" ];
|
||||
endpoint = "5.75.229.224:51820";
|
||||
persistentKeepalive = 25;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
neox_wg = {
|
||||
ips = [ "192.168.51.2/32" ];
|
||||
privateKeyFile = config.sops.secrets."wg_privkey".path;
|
||||
peers = [
|
||||
{
|
||||
publicKey = builtins.readFile ../nixy/wg_pubkey_nx;
|
||||
allowedIPs = [ "192.168.2.0/24" ];
|
||||
endpoint = "185.194.64.26:51820";
|
||||
persistentKeepalive = 25;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
time.timeZone = "Europe/Sarajevo";
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
nixpkgs.overlays = [
|
||||
nvim.overlays.${system}.overlay
|
||||
];
|
||||
environment = {
|
||||
etc = {
|
||||
"firejail/qutebrowser.local".text = ''
|
||||
whitelist ''${RUNUSER}/qutebrowser
|
||||
'';
|
||||
};
|
||||
extraInit = ''
|
||||
unset -v SSH_ASKPASS
|
||||
'';
|
||||
homeBinInPath = true;
|
||||
variables = {
|
||||
PATH = "$HOME/.cargo/bin";
|
||||
};
|
||||
};
|
||||
|
||||
programs = {
|
||||
steam = {
|
||||
enable = true;
|
||||
remotePlay.openFirewall = true;
|
||||
dedicatedServer.openFirewall = false;
|
||||
localNetworkGameTransfers.openFirewall = true;
|
||||
};
|
||||
gnupg.agent = {
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
};
|
||||
appimage = {
|
||||
enable = true;
|
||||
binfmt = true;
|
||||
};
|
||||
nix-ld = {
|
||||
enable = false;
|
||||
libraries = with pkgs; [
|
||||
stdenv.cc.cc.lib
|
||||
zlib
|
||||
];
|
||||
};
|
||||
zsh.enable = true;
|
||||
firejail.enable = true;
|
||||
adb.enable = true;
|
||||
wireshark.enable = true;
|
||||
sway.enable = true;
|
||||
};
|
||||
|
||||
documentation.dev.enable = true;
|
||||
|
||||
# List services that you want to enable:
|
||||
systemd = {
|
||||
#sysusers.enable = true;
|
||||
services = {
|
||||
# Fix issue where systemd-vconsole-setup failes to find keymap
|
||||
systemd-vconsole-setup = {
|
||||
unitConfig = {
|
||||
After = "local-fs.target";
|
||||
};
|
||||
};
|
||||
|
||||
"zremap@" = {
|
||||
enable = true;
|
||||
restartIfChanged = true;
|
||||
serviceConfig.Nice = -20;
|
||||
unitConfig = {
|
||||
Description = "zremap on %I";
|
||||
ConditionPathExists = "%I";
|
||||
};
|
||||
serviceConfig = {
|
||||
Type = "simple";
|
||||
ExecStart = "${zremap.defaultPackage.${system}}/bin/zremap %I";
|
||||
};
|
||||
};
|
||||
|
||||
"netns@" = {
|
||||
description = "%I network namespace";
|
||||
before = [ "network.target" ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
ExecStart = "${pkgs.iproute2}/bin/ip netns add %I";
|
||||
ExecStop = "${pkgs.iproute2}/bin/ip netns del %I";
|
||||
};
|
||||
};
|
||||
|
||||
"wg_proton" = {
|
||||
description = "wg network interface";
|
||||
bindsTo = [ "netns@wg.service" ];
|
||||
requires = [ "network-online.target" ];
|
||||
wants = [ "dnscrypt-proxy_proton.service" ];
|
||||
after = [ "netns@wg.service" ];
|
||||
before = [ "dnscrypt-proxy_proton.service" ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
ExecStart = pkgs.writers.writeBash "wg-up" ''
|
||||
set -e
|
||||
ENDPOINT_IP=$(${pkgs.coreutils-full}/bin/cat "${config.sops.secrets."wg_endpoint_proton".path}")
|
||||
${pkgs.iproute2}/bin/ip link add proton_wg type wireguard
|
||||
${pkgs.iproute2}/bin/ip link set proton_wg netns wg
|
||||
${pkgs.iproute2}/bin/ip -n wg address add 10.2.0.2/32 dev proton_wg
|
||||
${pkgs.iproute2}/bin/ip netns exec wg \
|
||||
${pkgs.wireguard-tools}/bin/wg set "proton_wg" private-key "${
|
||||
config.sops.secrets."wg_privkey_proton".path
|
||||
}"
|
||||
${pkgs.iproute2}/bin/ip netns exec wg \
|
||||
${pkgs.wireguard-tools}/bin/wg set "proton_wg" peer "g6DkXWKI/68RsLjROIwCEcyB/ZhyK5Q7OWcz1TtqER0=" \
|
||||
endpoint "$ENDPOINT_IP:51820" \
|
||||
persistent-keepalive "25" \
|
||||
allowed-ips "0.0.0.0/0"
|
||||
${pkgs.iproute2}/bin/ip -n wg link set lo up
|
||||
${pkgs.iproute2}/bin/ip -n wg link set proton_wg up
|
||||
${pkgs.iproute2}/bin/ip -n wg route add default dev proton_wg
|
||||
'';
|
||||
ExecStop = pkgs.writers.writeBash "wg-down" ''
|
||||
${pkgs.iproute2}/bin/ip -n wg route del default dev proton_wg
|
||||
${pkgs.iproute2}/bin/ip -n wg link del proton_wg
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
"dnscrypt-proxy_proton" = {
|
||||
description = "DNSCrypt-proxy client proton";
|
||||
wants = [
|
||||
"network-online.target"
|
||||
"nss-lookup.target"
|
||||
];
|
||||
before = [ "nss-lookup.target" ];
|
||||
after = [ "wg_proton.service" ];
|
||||
partOf = [ "wg_proton.service" ];
|
||||
serviceConfig = {
|
||||
AmbientCapabilities = "CAP_NET_BIND_SERVICE";
|
||||
CacheDirectory = "dnscrypt-proxy";
|
||||
DynamicUser = true;
|
||||
ExecStart = "${pkgs.dnscrypt-proxy}/bin/dnscrypt-proxy -config ${config.services.dnscrypt-proxy.configFile}";
|
||||
LockPersonality = true;
|
||||
LogsDirectory = "dnscrypt-proxy";
|
||||
MemoryDenyWriteExecute = true;
|
||||
NetworkNamespacePath = "/var/run/netns/wg";
|
||||
NonBlocking = true;
|
||||
NoNewPrivileges = true;
|
||||
PrivateDevices = true;
|
||||
ProtectClock = true;
|
||||
ProtectControlGroups = true;
|
||||
ProtectHome = true;
|
||||
ProtectHostname = true;
|
||||
ProtectKernelLogs = true;
|
||||
ProtectKernelModules = true;
|
||||
ProtectKernelTunables = true;
|
||||
ProtectSystem = "strict";
|
||||
Restart = "always";
|
||||
RestrictAddressFamilies = [
|
||||
"AF_INET"
|
||||
"AF_INET6"
|
||||
];
|
||||
RestrictNamespaces = true;
|
||||
RestrictRealtime = true;
|
||||
RuntimeDirectory = "dnscrypt-proxy";
|
||||
StateDirectory = "dnscrypt-proxy";
|
||||
SystemCallArchitectures = "native";
|
||||
SystemCallFilter = [
|
||||
"@system-service"
|
||||
"@chown"
|
||||
"~@aio"
|
||||
"~@keyring"
|
||||
"~@memlock"
|
||||
"~@setuid"
|
||||
"~@timer"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
coredump.enable = false;
|
||||
settings.Manager = {
|
||||
DefaultTimeoutStartSec = "30s";
|
||||
DefaultTimeoutStopSec = "30s";
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
acpid.enable = true;
|
||||
dbus.enable = true;
|
||||
dbus.implementation = "broker";
|
||||
envfs.enable = true;
|
||||
fstrim.enable = true;
|
||||
fwupd.enable = true;
|
||||
ntp.enable = true;
|
||||
openssh.enable = true;
|
||||
printing.enable = true;
|
||||
userborn.enable = true;
|
||||
|
||||
pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
|
||||
avahi = {
|
||||
enable = true;
|
||||
nssmdns4 = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
|
||||
libinput.enable = true;
|
||||
xserver = {
|
||||
enable = true;
|
||||
dpi = 144;
|
||||
desktopManager.xterm.enable = false;
|
||||
displayManager = {
|
||||
lightdm.enable = false;
|
||||
startx.enable = true;
|
||||
};
|
||||
windowManager.i3.enable = false;
|
||||
};
|
||||
|
||||
udev = {
|
||||
packages = [
|
||||
pkgs.openhantek6022
|
||||
pkgs.openocd
|
||||
];
|
||||
extraRules = ''
|
||||
#Xilinx FTDI
|
||||
ACTION=="add", ATTR{idVendor}=="0403", ATTR{manufacturer}=="Xilinx", MODE:="666"
|
||||
|
||||
#Xilinx Digilent
|
||||
ATTR{idVendor}=="1443", MODE:="666"
|
||||
ACTION=="add", ATTR{idVendor}=="0403", ATTR{manufacturer}=="Digilent", MODE:="666"
|
||||
|
||||
#Arduino UNO r4
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", MODE:="0666"
|
||||
|
||||
#zremap on new keyboard
|
||||
ACTION=="add", SUBSYSTEM=="input", ATTRS{phys}!="", KERNEL=="event[0-9]*", ENV{ID_INPUT_KEY}=="1", ENV{ID_INPUT_KEYBOARD}=="1", TAG+="systemd", ENV{SYSTEMD_WANTS}+="zremap@$env{DEVNAME}.service"
|
||||
'';
|
||||
};
|
||||
|
||||
tlp = {
|
||||
enable = true;
|
||||
settings = {
|
||||
START_CHARGE_THRESH_BAT0 = 70;
|
||||
STOP_CHARGE_THRESH_BAT0 = 86;
|
||||
};
|
||||
};
|
||||
|
||||
batteryNotifier = {
|
||||
enable = true;
|
||||
notifyCapacity = 12;
|
||||
suspendCapacity = 5;
|
||||
};
|
||||
|
||||
actkbd = {
|
||||
enable = true;
|
||||
bindings = [
|
||||
{
|
||||
keys = [ 115 ];
|
||||
events = [ "key" ];
|
||||
command = "XDG_RUNTIME_DIR=/run/user/$(id -u ${USER}) ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+";
|
||||
}
|
||||
|
||||
{
|
||||
keys = [ 114 ];
|
||||
events = [
|
||||
"key"
|
||||
"rep"
|
||||
];
|
||||
command = "XDG_RUNTIME_DIR=/run/user/$(id -u ${USER}) ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-";
|
||||
}
|
||||
|
||||
{
|
||||
keys = [ 113 ];
|
||||
events = [
|
||||
"key"
|
||||
"rep"
|
||||
];
|
||||
command = "XDG_RUNTIME_DIR=/run/user/$(id -u ${USER}) ${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle";
|
||||
}
|
||||
|
||||
{
|
||||
keys = [ 224 ];
|
||||
events = [ "key" ];
|
||||
command = "${pkgs.light}/bin/light -U 5";
|
||||
}
|
||||
|
||||
{
|
||||
keys = [ 225 ];
|
||||
events = [ "key" ];
|
||||
command = "${pkgs.light}/bin/light -A 5";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
dnscrypt-proxy = {
|
||||
enable = true;
|
||||
settings = {
|
||||
ipv6_servers = true;
|
||||
require_dnssec = true;
|
||||
require_nolog = true;
|
||||
require_nofilter = true;
|
||||
http3 = true;
|
||||
|
||||
sources.public-resolvers = {
|
||||
urls = [
|
||||
"https://raw.githubusercontent.com/DNSCrypt/dnscrypt-resolvers/master/v3/public-resolvers.md"
|
||||
"https://download.dnscrypt.info/resolvers-list/v3/public-resolvers.md"
|
||||
];
|
||||
cache_file = "/var/lib/dnscrypt-proxy/public-resolvers.md";
|
||||
minisign_key = "RWQf6LRCGA9i53mlYecO4IzT51TGPpvWucNSCh1CBM0QTaLn73Y7GFO3";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
borgbackup.jobs."borgbase" =
|
||||
let
|
||||
user = config.users.users.${USER};
|
||||
home = user.home;
|
||||
in
|
||||
{
|
||||
user = user.name;
|
||||
paths = [
|
||||
(home + "/pic/priv")
|
||||
(home + "/pproj")
|
||||
(home + "/videos/priv")
|
||||
];
|
||||
exclude = [
|
||||
"**/.ccls_cache"
|
||||
"**/*.d"
|
||||
"**/*.map"
|
||||
"**/*.o"
|
||||
"**/zig-cache"
|
||||
"**/zig-out"
|
||||
];
|
||||
repo = "ssh://oda929rv@oda929rv.repo.borgbase.com/./repo";
|
||||
encryption = {
|
||||
mode = "repokey-blake2";
|
||||
passCommand = "${pkgs.coreutils-full}/bin/cat ${config.sops.secrets."borgbase_enc_key".path}";
|
||||
};
|
||||
environment.BORG_RSH = "${pkgs.openssh}/bin/ssh -i ${config.sops.secrets."borgbase_ssh_key".path}";
|
||||
compression = "auto,zstd";
|
||||
startAt = "daily";
|
||||
};
|
||||
|
||||
nix-serve = {
|
||||
enable = false;
|
||||
secretKeyFile = "/var/cache-priv-key.pem";
|
||||
};
|
||||
|
||||
journald.extraConfig = ''
|
||||
SystemMaxUse=50M
|
||||
'';
|
||||
|
||||
logind.settings.Login = {
|
||||
KillUserProcesses = true;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
fonts = {
|
||||
fontconfig = {
|
||||
cache32Bit = true;
|
||||
allowBitmaps = true;
|
||||
useEmbeddedBitmaps = true;
|
||||
defaultFonts = {
|
||||
monospace = [ "JetBrainsMono" ];
|
||||
};
|
||||
};
|
||||
|
||||
packages = with pkgs; [
|
||||
dejavu_fonts
|
||||
dina-font
|
||||
fira-code
|
||||
fira-code-symbols
|
||||
font-awesome_6
|
||||
inconsolata
|
||||
iosevka
|
||||
jetbrains-mono
|
||||
liberation_ttf
|
||||
libertine
|
||||
noto-fonts
|
||||
noto-fonts-cjk-sans
|
||||
noto-fonts-color-emoji
|
||||
proggyfonts
|
||||
siji
|
||||
terminus_font
|
||||
terminus_font_ttf
|
||||
ubuntu-classic
|
||||
vista-fonts
|
||||
];
|
||||
};
|
||||
|
||||
virtualisation = {
|
||||
waydroid.enable = false;
|
||||
libvirtd = {
|
||||
enable = true;
|
||||
allowedBridges = [
|
||||
"virbr0"
|
||||
"br0"
|
||||
];
|
||||
};
|
||||
spiceUSBRedirection.enable = true;
|
||||
containers.storage.settings = {
|
||||
storage = {
|
||||
graphroot = "/var/lib/containers/storage";
|
||||
runroot = "/run/containers/storage";
|
||||
};
|
||||
};
|
||||
podman = {
|
||||
enable = true;
|
||||
autoPrune.enable = true;
|
||||
dockerCompat = true;
|
||||
};
|
||||
};
|
||||
|
||||
hardware = {
|
||||
bluetooth = {
|
||||
enable = true;
|
||||
settings = {
|
||||
General = {
|
||||
Experimental = true;
|
||||
Enable = "Source,Sink,Media,Socket";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
graphics = {
|
||||
enable = true;
|
||||
extraPackages = [ ];
|
||||
};
|
||||
rtl-sdr.enable = true;
|
||||
};
|
||||
|
||||
zramSwap = {
|
||||
enable = true;
|
||||
algorithm = "zstd";
|
||||
};
|
||||
|
||||
users.users.${USER} = {
|
||||
isNormalUser = true;
|
||||
initialHashedPassword = "$y$j9T$XGffGsmN/u.wO5wZ.cBml/$9iCw3eWY0GSUH/aA8ESCAxKeTCAMqY21XQF7b5ujxD6";
|
||||
shell = pkgs.zsh;
|
||||
extraGroups = [
|
||||
"adbusers"
|
||||
"audio"
|
||||
"dialout"
|
||||
"kvm"
|
||||
"plugdev"
|
||||
"sound"
|
||||
"tty"
|
||||
"wheel"
|
||||
"wireshark"
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.luks.devices."crypt_dev".device =
|
||||
"/dev/disk/by-uuid/e10821b9-5426-4f03-b716-1645a64fcd6a";
|
||||
boot.initrd.luks.devices."crypt_dev".allowDiscards = true;
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
"ehci_pci"
|
||||
"xhci_pci"
|
||||
"uas"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
"rtsx_pci_sdmmc"
|
||||
];
|
||||
boot.initrd.kernelModules = [ "dm-snapshot" ];
|
||||
boot.kernelModules = [
|
||||
"kvm-amd"
|
||||
"amd-gpu"
|
||||
];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/c461c971-54ca-4fb7-91e8-6ac70de53ef2";
|
||||
fsType = "xfs";
|
||||
};
|
||||
|
||||
fileSystems."/nix" = {
|
||||
device = "/dev/disk/by-uuid/eeaa6fab-d67d-400f-b6d4-b1f44c2e0047";
|
||||
fsType = "xfs";
|
||||
};
|
||||
|
||||
fileSystems."/home" = {
|
||||
device = "/dev/disk/by-uuid/aeaa71ca-a439-4ef3-9ab8-db7ae8f59376";
|
||||
fsType = "xfs";
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/828E-F3C3";
|
||||
fsType = "vfat";
|
||||
options = [
|
||||
"fmask=0022"
|
||||
"dmask=0022"
|
||||
];
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = true;
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
peerix-nixy:8THqS0R2zWF/47ai0RFmqJnieYTZ1jaWOD9tnzpvA6s=
|
||||
@@ -0,0 +1,21 @@
|
||||
borgbase_enc_key: ENC[AES256_GCM,data:AD+JghEOX25tBGYhoU1ge1fqrA+5AK8N4yg=,iv:u05GVeWbL3xdZQgGkXSPkxlATd2M9MX4uSZiLOHMMRE=,tag:pmTQIJWmz+ePmSNzO/EO4Q==,type:str]
|
||||
sops:
|
||||
kms: []
|
||||
gcp_kms: []
|
||||
azure_kv: []
|
||||
hc_vault: []
|
||||
age:
|
||||
- recipient: age1geqqmsnng2e9sja6uxxmtlwlm4c6e5v6ch3l3yjenstq6tjq4fusr0305s
|
||||
enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBEaDhSZVVibVl1NU84NG9U
|
||||
aEVQbThIcC9CajNHS25SVW1SMFFwMUsvMmxJCkpTVThpZ0JZdEpLTnJlQWFqM244
|
||||
LzFaUFVvWWxIcU4wRlhXalF5TkNpVHMKLS0tIExXMUx5cDBBbDloQ0sxbEY0eGdj
|
||||
bE5vNHVHekI2RzY5M3JNcTdCa3pNeUUK8C04wF1te6epA97sNrhoz0VUn+MC7SML
|
||||
6N1CZK3MuRARBqcj4c/W1aXuTysvuV1o/Fl5xOk/gbumcfwnDYj28A==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
lastmodified: "2024-04-21T08:14:25Z"
|
||||
mac: ENC[AES256_GCM,data:7M+akGH09E2JYyKLmwpjx0VCEBmXqO6bNHFNRCO+9LdSIqsEw8MD4WGO0zwHOD9ls7+1OPFeoU+MVbtfMhmvN4g6rg+tFkXbxPSXCPkTA4tL90ZLXoBIpUBxKKhFMxtdOnjXxES3rTzjXGAvxocFOiNv/7pKbzeqMJUnH9FgAcM=,iv:h0+OpLmutMyPN3YFhyuHFgWSqxVK5WmBAE0k5ezEo9A=,tag:UKOXnTOjWaLDEOYk5YK4Aw==,type:str]
|
||||
pgp: []
|
||||
unencrypted_suffix: _unencrypted
|
||||
version: 3.8.1
|
||||
@@ -0,0 +1,21 @@
|
||||
borgbase_ssh_key: ENC[AES256_GCM,data:lLHIBmw/03An3SRJUjYS2pn0g7XEW0kTXtSObhIGwjBwlRypU7uQDz4JseOA2GbSm+GqsGK8U3Ifgirb7t8AsGy6DPxO+2sm+ByJ1S46G6cwkO2GateJw4Zg0mmhUBBuB/eXQMLuBLKZM2WGta5+6O0SWxDtsrTsBhlo5qbwwYILu0gg2zsBWFSn1OBGgvjYYRTd7N85WX8+S7oNYVAL2HjCmhHHtYrLnua4ajBY9dQEzrKdZaQW4v39HV9MyoilEz17fFLU8S2KbJ1iw8HgoAc9W81hpQNNd8fWKY+e0iWxD9X5H7UTs8YP/bsKeWyG4OAwr99zIZ1Lqzi0EuZI+PYkIz4Q4WBmv1wD6Py274iug3kr1OqvaIOmIT/9j2C3mOZTqxuFaF5T4NMkcIeViCBmRwUMTl/8a36X+n/MYxRoznHCQmg8zKubDuykVJfBmFwxbUc9tx8PeodnWeiASOV7FvBie47yq+NyBGItJXAK14SxLE9T2sxRchJWcrQBcekZdZ5Mej20lfUlcAGkwfUc0e54xsv1K3oY,iv:5157BQmbfuF5EYbDHCy/TmnTYErIwmgXO8RaX6f18xs=,tag:T2eZN46Qd6RgLWk4kbYgPQ==,type:str]
|
||||
sops:
|
||||
kms: []
|
||||
gcp_kms: []
|
||||
azure_kv: []
|
||||
hc_vault: []
|
||||
age:
|
||||
- recipient: age1geqqmsnng2e9sja6uxxmtlwlm4c6e5v6ch3l3yjenstq6tjq4fusr0305s
|
||||
enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB5b2YzSDdaU3R5TUdqS3Nv
|
||||
eUYraFBiZlZ1TXBqYzlWNUNYOFlyMzJvWEE4ClJ6R25CRXRUZ2FDTFY2ZmJIRkRX
|
||||
WVJCSy83N2JUNzRuT3VuSUF1OTV2TUkKLS0tIEZ5cVg1V2o0MkdmWEx1emJVdjZ0
|
||||
RkZFL2tRNW9RdnAwalE2ZzVQcnljRFUKRyN8ahv9ZI63m8ycl74GZ59lyAXUsKmi
|
||||
tfPqQvL1oTtJr3hzwy2bkctXQLYjGvsMyZt2tiWpy5vLc1MrxlqVDQ==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
lastmodified: "2024-04-21T08:16:40Z"
|
||||
mac: ENC[AES256_GCM,data:VkXpCPQB4RypDrK31pYWXeOcl8ulis6fMF1q/SLCg2wXnL0jFrmAFp78C+ers9xFhbnUnMbVc/ZJIVKfa0g94WV3jJbn4+HB0GPWQCz7LwhmG5XEY5O5sFLuDCcHb/epZvDbCsEQeiq+TGDHp6TtdL8qDF+hE2k8qfsy570wocU=,iv:HQleJtHWQ5uk4+Witn2aaqh0SvXqomfiSO/ExgPzVag=,tag:hlBmboddR8GDAmBpETi0Ow==,type:str]
|
||||
pgp: []
|
||||
unencrypted_suffix: _unencrypted
|
||||
version: 3.8.1
|
||||
@@ -0,0 +1,22 @@
|
||||
peerix:
|
||||
private: ENC[AES256_GCM,data:Oi8H5nqJ0Bf45wQepCjdZNHBOv4AlPxNN7L5Th3gcRQlW1FS77nusIWGSUvlmL2a5LTN0FV36o2GFPrrhiwmvnkQwuSZKc9VeDTf7SX0RRL1NLmRR/zy4WsRNJFxlqtjahieqg==,iv:6hJwqcdPayZaYZhJ0OfYLAtmeVndLEfeYZjUq5/3qJE=,tag:MiAfg8aZAHNYbB0JwcdStg==,type:str]
|
||||
sops:
|
||||
kms: []
|
||||
gcp_kms: []
|
||||
azure_kv: []
|
||||
hc_vault: []
|
||||
age:
|
||||
- recipient: age1geqqmsnng2e9sja6uxxmtlwlm4c6e5v6ch3l3yjenstq6tjq4fusr0305s
|
||||
enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBSMEIyck1xbVJ4Zm56Z3dM
|
||||
OGsxa1p0TGIvRE5DYXZzTDM3YUZFVTAxbUUwCllPd0FOUlRiZW5wT2QvLzZXYjRr
|
||||
S1A5WjZxLzNYQ1ZWVFFQTzRwMFQweFEKLS0tIHNoZUpHS2dDNmFKc3ZVNFZuUFU4
|
||||
L0M0MitMeDg1ZWYxcDNCQlVGUjRKeFkKvD2SKnuh517o2knPr2SOWq3kubMyI7UV
|
||||
j6HgXVbHUDjmKl2dY+YVTnmxrK54E+Q6iiu7mQnvLdzxYBK/EiNt9w==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
lastmodified: "2024-04-21T08:17:51Z"
|
||||
mac: ENC[AES256_GCM,data:v4KQq3Y5ZxsyMxR+FS1BZkH/bPTIIHfQu800U44odaNycIbWnuwCnLWGyJK6Por76bWALycGppDbHPKKW/N1I1XLy/EAXo02+nhHNvKVi2cXSXciuEPc/Cl+6TbP39lx4+EOM8CZoNZ8HAiS3QPy2bwZdMjEw/OHl8TqlN07q9s=,iv:PIcv/b6t+54/yCTZj+12Yep15ors/wXNUnaXjLjpVbM=,tag:JxO5M3OYaWzqgf4gUhCzzg==,type:str]
|
||||
pgp: []
|
||||
unencrypted_suffix: _unencrypted
|
||||
version: 3.8.1
|
||||
@@ -0,0 +1,21 @@
|
||||
wg_preshared: ENC[AES256_GCM,data:k+aFYDNMojf5kktn6KJ4F5mH5oGdqxdF0MO88NcYpai9USnH394XRL9ASvs=,iv:L5LIXbADhrivKjK/V0E5QpRT7BDsktwIuKHgY+2qr84=,tag:pCW1naU/ygxAIDYWV2hHPQ==,type:str]
|
||||
sops:
|
||||
kms: []
|
||||
gcp_kms: []
|
||||
azure_kv: []
|
||||
hc_vault: []
|
||||
age:
|
||||
- recipient: age1geqqmsnng2e9sja6uxxmtlwlm4c6e5v6ch3l3yjenstq6tjq4fusr0305s
|
||||
enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBZSHZvYy9TTmVEb2ZSTncy
|
||||
ckJ1bXZGWVdJSkVHMGx2Vk5ZNlZ3Q2wzVFQ0Cmg1M3hKNFhnZk5nTE54RTdyR0Vs
|
||||
NVRiTEltSnkxdmhhdGlycHNPWjFLbncKLS0tIE02NVJRZTd0VmowT1c4cjhKNlZk
|
||||
Q01BQWNSVWtIMnFXRWpxR3JDMU8zYTAKIbfpM8uUb09cUlA8YWtgEOL5zvWf5omv
|
||||
baZINiAu0/f1avYmW6Qb+aLa2ALrSZaotj46Uwd9Lb5mtjJ/8v9IOg==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
lastmodified: "2024-04-20T18:12:20Z"
|
||||
mac: ENC[AES256_GCM,data:4PWjwxOO0UuNsevCbzCLaiW7C+So4mEGivd9GzyLKx2JlkNFVB8wqPrY1Rl1ANMrT+7LKc8tVOA4zbweNc9idFG4y5DcvnDSieqKu9v1MeEMHqNpz5TTLbCP81g7qegjI/WKul2kaWIdPaioI/f5x2E6rEYnzFv+Di2mc3W+Qcc=,iv:iE9sali0O3sQIhOw30RGR/4ZQsAPcSxq1qxosfasojU=,tag:+9AOwph5A4oDXsK6Z3YeZA==,type:str]
|
||||
pgp: []
|
||||
unencrypted_suffix: _unencrypted
|
||||
version: 3.8.1
|
||||
@@ -0,0 +1,21 @@
|
||||
wg_privkey: ENC[AES256_GCM,data:XL9FU1kZXvBJfwyt3HpQe8k8zg9HT6Xm0BdjNMduSu9uAgcHbglpLc/qTB0=,iv:QgX1VsmLUsDozFXmzDVPukjPNTa4Lnh806AQ4qdgpa8=,tag:RNVlDbtx8vAAbG0rinLVOw==,type:str]
|
||||
sops:
|
||||
kms: []
|
||||
gcp_kms: []
|
||||
azure_kv: []
|
||||
hc_vault: []
|
||||
age:
|
||||
- recipient: age1geqqmsnng2e9sja6uxxmtlwlm4c6e5v6ch3l3yjenstq6tjq4fusr0305s
|
||||
enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBBSnkyM1ZrcnEvM3VHL0Nk
|
||||
THhUUDdGU2s5UFgrVGZ3WXhkYTRIVTlaeGs4CjR4eVpmRy9qUkZSWkpFZDZHRDZI
|
||||
ZWRXSmMzL2RWZkVrSlFPcC9ueGpDVFkKLS0tIDZWbENyS2hrSCtlNlBHaE56QTha
|
||||
eFJmWXk1SVJEbDJOc1Q1VFlzVS8yODgKFXRAtR+67x0dkQTqZPtMT0Hd+aW+5K17
|
||||
S/lhuHRhITt3woQnecVPMYklgJJlsyQ6blKhJw8dvhbVWWThZ853rQ==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
lastmodified: "2024-04-21T08:18:59Z"
|
||||
mac: ENC[AES256_GCM,data:xPKsGZD5RKT/WMRupe4YTgoiUQRFq77KQyGaazeY1GEPI117gWxRHEpiyCLnfhZWcaekPWoXosm32wRLwDAXM/Femk567i5uKKG2wAqApWbc+FXTQ71w/CFr9uEWFApBjpEHpuBBaFV23qJfylsqeMp9r52d9Sp5eDQC4RJead0=,iv:oiNoZ/bqQUe+luqeuldw1M0KB2d4C5T7kXy+mLFZNZQ=,tag:5pK22TYGwbBNyWlfd/Ufxw==,type:str]
|
||||
pgp: []
|
||||
unencrypted_suffix: _unencrypted
|
||||
version: 3.8.1
|
||||
@@ -0,0 +1,22 @@
|
||||
wg_privkey_proton: ENC[AES256_GCM,data:qVVd+1s2T3sKDi03V+eMvgqW8LAVl/yEKwtG2EMn8NhBCN7RvlttC5SeIDM=,iv:/QcrtmMjCzZRulumIz5u9oxyaRt+HUq96ZiP8ecpvAo=,tag:1DCaJqVGfg3sfvKTQnmzZA==,type:str]
|
||||
wg_endpoint_proton: ENC[AES256_GCM,data:ggoWnB6nGjGc/kSOaCo=,iv:1r5J6SO5JYH7+bMhE2lGwfFETVFeS61eCXtej0Pl07M=,tag:p+0hhQ/vqZzZML24YReA0g==,type:str]
|
||||
sops:
|
||||
kms: []
|
||||
gcp_kms: []
|
||||
azure_kv: []
|
||||
hc_vault: []
|
||||
age:
|
||||
- recipient: age1geqqmsnng2e9sja6uxxmtlwlm4c6e5v6ch3l3yjenstq6tjq4fusr0305s
|
||||
enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAxdXZpL1lrOEYyYVdFTzNJ
|
||||
SHhXRVc5Y0o4ZzN2THRjM215UWczVjZOTXg4CjBJZ2VxN0t0ZFgzTmJMeXo5SWZk
|
||||
UjRlNmdRTVVPbHVEeXM3TWhoS0pSUTQKLS0tIEtkTURBc1A3d2lTalhmeEoxUkZj
|
||||
K3BHZnUzN3ZrL1dFQk8rWFpZR05pbFUKObrnIpY3NR1o3/lKhTfVpQU+eQRTi7wF
|
||||
SAjGZ5BRdCi5x1VWRxiT1Fvjqkm7kBEQFvdSvbqW2UK6lVHtWgt2Vg==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
lastmodified: "2024-05-12T13:30:18Z"
|
||||
mac: ENC[AES256_GCM,data:3UqJGcNGPZDlLA3a0uNHUI0ykDC0ByxAR2ZsrsbWQMv3BS6zyBuc+zpTHQZoIPGsAMUetuB3OuA0IQNll3abg6u2AadEQBUf1PYMWlo58txLYlAs/q0g+575F+LhDSgmDMKOFXz4HqbFP0RYTHkPnmjWPMWWY3G9o6B3Iaw5+Kc=,iv:massJRpGcH4pDZxJrpQYy80XVViyw+qFsZ8Sk9Xze08=,tag:eDvuNadKGKBS/3jauvnuFQ==,type:str]
|
||||
pgp: []
|
||||
unencrypted_suffix: _unencrypted
|
||||
version: 3.8.1
|
||||
@@ -0,0 +1 @@
|
||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMPNCxE/8z02lVOC1unJbPMH+Ma+KRJfmz33oUfz3hKc root@nixy
|
||||
@@ -0,0 +1 @@
|
||||
oHVmhw80daHjDjo7nwt/Y9eKBaH5FoTiVeukwDObijM=
|
||||
@@ -0,0 +1 @@
|
||||
eoYSDh27qQFpvOcDmuVFzSTuPnrHQYXDMqatKmDAth0=
|
||||
@@ -27,10 +27,6 @@ stdenv.mkDerivation rec {
|
||||
--replace "/var/tmp" "$TMPDIR"
|
||||
'';
|
||||
|
||||
# GCC 15 (nixpkgs 26.05) defaults to -std=gnu23, where `bool`/`true`/`false`
|
||||
# are keywords; this old bubblewrap fork still does `typedef int bool;`.
|
||||
env.NIX_CFLAGS_COMPILE = "-std=gnu17";
|
||||
|
||||
nativeBuildInputs = [
|
||||
docbook_xsl
|
||||
libxslt
|
||||
|
||||
Reference in New Issue
Block a user