Compare commits
22 Commits
inventree
...
06eea6c576
| Author | SHA1 | Date | |
|---|---|---|---|
|
06eea6c576
|
|||
|
44c8cf333a
|
|||
|
3ad90e1d73
|
|||
|
8a6eac625d
|
|||
|
bdae9d7696
|
|||
|
2f7f408466
|
|||
|
874ea27f89
|
|||
|
b160263549
|
|||
|
dfd2573cb2
|
|||
|
7dec24203b
|
|||
|
af1b425732
|
|||
|
1b7c445e4a
|
|||
|
9ffe730f1b
|
|||
|
f8283e61df
|
|||
|
f1b03824b2
|
|||
|
bf12adcdf3
|
|||
|
cbc56857c2
|
|||
|
a855afd3ad
|
|||
|
19ef289cf3
|
|||
|
d9d9e8f802
|
|||
|
f693b7230a
|
|||
|
963afc2c3e
|
80
CLAUDE.md
Normal file
80
CLAUDE.md
Normal file
@@ -0,0 +1,80 @@
|
||||
# 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, Plasma6 + Sway, intel 13th gen, dual wireguard (one in a network namespace for ProtonVPN routed via `dnscrypt-proxy`)
|
||||
- `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`).
|
||||
|
||||
**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.
|
||||
124
flake.lock
generated
124
flake.lock
generated
@@ -61,11 +61,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1772665116,
|
||||
"narHash": "sha256-XmjUDG/J8Z8lY5DVNVUf5aoZGc400FxcjsNCqHKiKtc=",
|
||||
"lastModified": 1778507602,
|
||||
"narHash": "sha256-kTwur1wV+01SdqskVMSo6JMEpg71ps3HpbFY2GsflKs=",
|
||||
"owner": "cachix",
|
||||
"repo": "git-hooks.nix",
|
||||
"rev": "39f53203a8458c330f61cc0759fe243f0ac0d198",
|
||||
"rev": "61ab0e80d9c7ab14c256b5b453d8b3fb0189ba0a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -103,16 +103,16 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1772633058,
|
||||
"narHash": "sha256-SO7JapRy2HPhgmqiLbfnW1kMx5rakPMKZ9z3wtRLQjI=",
|
||||
"lastModified": 1779726825,
|
||||
"narHash": "sha256-RUkMrREjKDQrA+dA9+xZviGAxM5W1aVdyOr/bSYpHrE=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "080657a04188aca25f8a6c70a0fb2ea7e37f1865",
|
||||
"rev": "b179bde238977f7d4454fc770b1a727eaf55111c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"ref": "release-25.11",
|
||||
"ref": "release-26.05",
|
||||
"repo": "home-manager",
|
||||
"type": "github"
|
||||
}
|
||||
@@ -140,32 +140,48 @@
|
||||
},
|
||||
"nixos": {
|
||||
"locked": {
|
||||
"lastModified": 1772598333,
|
||||
"narHash": "sha256-YaHht/C35INEX3DeJQNWjNaTcPjYmBwwjFJ2jdtr+5U=",
|
||||
"lastModified": 1779971959,
|
||||
"narHash": "sha256-R5nauXyqyfRUFiZycFFZdkF7wl6eaUpPLst35+2nJQY=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "fabb8c9deee281e50b1065002c9828f2cf7b2239",
|
||||
"rev": "ec942ba042dad5ef097e2ef3a3effc034241f011",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-25.11",
|
||||
"ref": "nixos-26.05",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1772598333,
|
||||
"narHash": "sha256-YaHht/C35INEX3DeJQNWjNaTcPjYmBwwjFJ2jdtr+5U=",
|
||||
"lastModified": 1779971959,
|
||||
"narHash": "sha256-R5nauXyqyfRUFiZycFFZdkF7wl6eaUpPLst35+2nJQY=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "fabb8c9deee281e50b1065002c9828f2cf7b2239",
|
||||
"rev": "ec942ba042dad5ef097e2ef3a3effc034241f011",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-25.11",
|
||||
"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",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
@@ -177,11 +193,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1769036658,
|
||||
"narHash": "sha256-bia1yOQtC8A7XZRCTdLvY0Bdv4i/V6hMqb0NM/9h/jc=",
|
||||
"lastModified": 1780213167,
|
||||
"narHash": "sha256-50MzkuYn590Tk89/YivGZ8Z8ZtKRXcP+iHqpLv6TYXA=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "9c1eb1b999522b965ce129043c7112fc9e38c75a",
|
||||
"revCount": 52,
|
||||
"rev": "a5224c23744b0a89e32992442bba4cfaa8464d59",
|
||||
"revCount": 54,
|
||||
"type": "git",
|
||||
"url": "https://git.project-cloud.net/asmir/nvim_flake"
|
||||
},
|
||||
@@ -212,6 +228,46 @@
|
||||
"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": 1780212524,
|
||||
"narHash": "sha256-r+zAR7SijYiQlanbuOKLEItYXfIOnkyQBPl3QoMWLIg=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "f8a4536a02e9ce2d78eabf8df0b7ccc59b8ebb15",
|
||||
"revCount": 1,
|
||||
"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": {
|
||||
"home-manager": "home-manager",
|
||||
@@ -220,6 +276,7 @@
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nvim": "nvim",
|
||||
"project-cloud": "project-cloud",
|
||||
"quickshell_bar": "quickshell_bar",
|
||||
"simple-nixos-mailserver": "simple-nixos-mailserver",
|
||||
"sops-nix": "sops-nix",
|
||||
"swaysw": "swaysw",
|
||||
@@ -236,17 +293,14 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1772763116,
|
||||
"narHash": "sha256-5NUtdVWnEflm829QI0BIj2rDhI+pfagt+cxIARJEhi8=",
|
||||
"owner": "simple-nixos-mailserver",
|
||||
"repo": "nixos-mailserver",
|
||||
"rev": "c04152fa90ba5079f4517aa24383245937e43ab8",
|
||||
"type": "gitlab"
|
||||
"lastModified": 1779651513,
|
||||
"narHash": "sha256-lUmq8sXQzihreq9UMqAkSBy9z9ueZbRnFyltzYVfQ2I=",
|
||||
"type": "tarball",
|
||||
"url": "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/nixos-26.05/nixos-mailserver-nixos-26.05.tar.gz"
|
||||
},
|
||||
"original": {
|
||||
"owner": "simple-nixos-mailserver",
|
||||
"repo": "nixos-mailserver",
|
||||
"type": "gitlab"
|
||||
"type": "tarball",
|
||||
"url": "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/nixos-26.05/nixos-mailserver-nixos-26.05.tar.gz"
|
||||
}
|
||||
},
|
||||
"sops-nix": {
|
||||
@@ -256,11 +310,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1772495394,
|
||||
"narHash": "sha256-hmIvE/slLKEFKNEJz27IZ8BKlAaZDcjIHmkZ7GCEjfw=",
|
||||
"lastModified": 1777944972,
|
||||
"narHash": "sha256-VfGRo1qTBKOe3s2gOv8LSoA6Fk19PvBlwQ1ECN0Evn8=",
|
||||
"owner": "Mic92",
|
||||
"repo": "sops-nix",
|
||||
"rev": "1d9b98a29a45abe9c4d3174bd36de9f28755e3ff",
|
||||
"rev": "c591bf665727040c6cc5cb409079acb22dcce33c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -328,11 +382,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1764579633,
|
||||
"narHash": "sha256-gOD5RMHOB9Fw4T3nk2a95YdU0J24QU3uWUiZVIQza64=",
|
||||
"lastModified": 1780166195,
|
||||
"narHash": "sha256-kqViUrWwIJP7xVCpcZbRk7IygAw/Tll/UmbcAW9zRPk=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "b0707744e2b4a077e759145cdbfa8d8d1017e732",
|
||||
"revCount": 25,
|
||||
"rev": "e1aecedf30f3b3cedd89d84364bd7e548a011bcd",
|
||||
"revCount": 26,
|
||||
"type": "git",
|
||||
"url": "https://git.project-cloud.net/asmir/zremap"
|
||||
},
|
||||
|
||||
12
flake.nix
12
flake.nix
@@ -2,8 +2,8 @@
|
||||
description = "NixOS configuration";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
|
||||
nixos.url = "github:nixos/nixpkgs/nixos-25.11";
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05";
|
||||
nixos.url = "github:nixos/nixpkgs/nixos-26.05";
|
||||
|
||||
nix-xilinx = {
|
||||
url = "gitlab:asmir.abdulahovic/nix-xilinx";
|
||||
@@ -20,6 +20,10 @@
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
quickshell_bar = {
|
||||
url = "git+https://git.project-cloud.net/asmir/quickshell_bar";
|
||||
};
|
||||
|
||||
nvim = {
|
||||
url = "git+https://git.project-cloud.net/asmir/nvim_flake";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
@@ -31,12 +35,12 @@
|
||||
};
|
||||
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager/release-25.11";
|
||||
url = "github:nix-community/home-manager/release-26.05";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
simple-nixos-mailserver = {
|
||||
url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
|
||||
url = "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/nixos-26.05/nixos-mailserver-nixos-26.05.tar.gz";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
|
||||
@@ -93,11 +93,24 @@ in
|
||||
"xe.force_probe=a7a0"
|
||||
"i915.force_probe=!a7a0"
|
||||
];
|
||||
kernelPackages = pkgs.linuxPackages_latest;
|
||||
#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;
|
||||
};
|
||||
loader.efi.canTouchEfiVariables = true;
|
||||
loader.systemd-boot = {
|
||||
@@ -116,6 +129,7 @@ in
|
||||
rtkit.enable = true;
|
||||
allowSimultaneousMultithreading = true;
|
||||
sudo.enable = true;
|
||||
sudo.execWheelOnly = true;
|
||||
doas.enable = true;
|
||||
doas.extraRules = [
|
||||
{
|
||||
@@ -124,6 +138,10 @@ in
|
||||
persist = true;
|
||||
}
|
||||
];
|
||||
apparmor = {
|
||||
enable = true;
|
||||
killUnconfinedConfinables = true;
|
||||
};
|
||||
};
|
||||
|
||||
powerManagement = {
|
||||
@@ -134,6 +152,7 @@ in
|
||||
nftables.enable = true;
|
||||
firewall = {
|
||||
enable = true;
|
||||
logRefusedConnections = true;
|
||||
allowedTCPPorts = [
|
||||
80
|
||||
443
|
||||
@@ -199,8 +218,8 @@ in
|
||||
nvim.overlays.${system}.overlay
|
||||
];
|
||||
environment = {
|
||||
systemPackages = with pkgs; [ alsa-ucm-conf maliit-keyboard ];
|
||||
variables.ALSA_CONFIG_UCM2 = "${pkgs.alsa-ucm-conf}/share/alsa/ucm2";
|
||||
#memoryAllocator.provider = "mimalloc";
|
||||
systemPackages = with pkgs; [ maliit-keyboard android-tools ];
|
||||
|
||||
sessionVariables = {
|
||||
LIBVA_DRIVER_NAME = "iHD";
|
||||
@@ -238,7 +257,7 @@ in
|
||||
};
|
||||
appimage = {
|
||||
enable = true;
|
||||
binfmt = true;
|
||||
binfmt = false;
|
||||
};
|
||||
nix-ld = {
|
||||
enable = false;
|
||||
@@ -247,9 +266,13 @@ in
|
||||
zlib
|
||||
];
|
||||
};
|
||||
zsh.enable = true;
|
||||
zsh = {
|
||||
enable = true;
|
||||
promptInit = "";
|
||||
enableCompletion = false;
|
||||
setOptions = [ ];
|
||||
};
|
||||
firejail.enable = true;
|
||||
adb.enable = true;
|
||||
wireshark.enable = true;
|
||||
sway.enable = true;
|
||||
};
|
||||
@@ -417,8 +440,12 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
logind = {
|
||||
powerKey = "suspend";
|
||||
logind.settings.Login = {
|
||||
HandlePowerKey = "suspend";
|
||||
HandleLidSwitch = "suspend";
|
||||
HandleLidSwitchExternalPower = "suspend";
|
||||
HandleLidSwitchDocked = "ignore";
|
||||
KillUserProcesses = true;
|
||||
};
|
||||
|
||||
desktopManager = {
|
||||
@@ -528,13 +555,13 @@ in
|
||||
{
|
||||
keys = [ 224 ];
|
||||
events = [ "key" ];
|
||||
command = "${pkgs.light}/bin/light -U 5";
|
||||
command = "${pkgs.brightnessctl}/bin/brightnessctl set 5%-";
|
||||
}
|
||||
|
||||
{
|
||||
keys = [ 225 ];
|
||||
events = [ "key" ];
|
||||
command = "${pkgs.light}/bin/light -A 5";
|
||||
command = "${pkgs.brightnessctl}/bin/brightnessctl set 5%+";
|
||||
}
|
||||
];
|
||||
};
|
||||
@@ -598,10 +625,6 @@ in
|
||||
SystemMaxUse=50M
|
||||
'';
|
||||
|
||||
logind.settings.Login = {
|
||||
KillUserProcesses = true;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
fonts = {
|
||||
@@ -691,7 +714,6 @@ in
|
||||
initialHashedPassword = "$y$j9T$FZnEcCEMIC0Fjj4dZi5t8.$D8ygvO19dR5nyTZxWwDgjEimHutD.sKnD1DLAyhU8.B";
|
||||
shell = pkgs.zsh;
|
||||
extraGroups = [
|
||||
"adbusers"
|
||||
"audio"
|
||||
"dialout"
|
||||
"input"
|
||||
|
||||
@@ -21,12 +21,14 @@
|
||||
{
|
||||
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" =
|
||||
|
||||
@@ -25,6 +25,7 @@ let
|
||||
--hooks ''\'systemctl --user restart lisgd.service''\'
|
||||
'';
|
||||
swaysw = inputs.swaysw.packages.${system}.swaysw;
|
||||
quickshell_bar = inputs.quickshell_bar.packages.${system}.default;
|
||||
term = "${pkgs.foot}/bin/footclient";
|
||||
in
|
||||
{
|
||||
@@ -92,19 +93,9 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
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";
|
||||
}
|
||||
bars = [ ];
|
||||
startup = [
|
||||
{ command = "exec ${quickshell_bar}/bin/quickshell-bar"; }
|
||||
];
|
||||
|
||||
keybindings = {
|
||||
|
||||
@@ -10,9 +10,14 @@
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
|
||||
programs.fzf = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
|
||||
programs.zsh = {
|
||||
autocd = true;
|
||||
enableCompletion = false;
|
||||
enableCompletion = true;
|
||||
defaultKeymap = "viins";
|
||||
/* dotDir = "\"$XDG_CONFIG_HOME\"/zsh"; */
|
||||
|
||||
@@ -63,11 +68,6 @@
|
||||
};
|
||||
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;
|
||||
ls --color=tty;
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
@@ -36,6 +36,16 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
gtk = {
|
||||
enable = true;
|
||||
theme = { name = "Adwaita-dark"; package = pkgs.gnome-themes-extra; };
|
||||
};
|
||||
qt = {
|
||||
enable = true;
|
||||
style.name = "adwaita-dark";
|
||||
platformTheme.name = "gtk";
|
||||
};
|
||||
|
||||
fonts.fontconfig.enable = true;
|
||||
|
||||
home.sessionVariables = rec {
|
||||
@@ -91,6 +101,9 @@ in
|
||||
pkgs.mpvScripts.uosc
|
||||
pkgs.mpvScripts.webtorrent-mpv-hook
|
||||
];
|
||||
scriptOpts.webtorrent = {
|
||||
path = "/tmp";
|
||||
};
|
||||
config = {
|
||||
osc = "no";
|
||||
osd-bar = "no";
|
||||
@@ -101,6 +114,16 @@ in
|
||||
vo = "dmabuf-wayland";
|
||||
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 = {
|
||||
@@ -158,6 +181,12 @@ in
|
||||
};
|
||||
|
||||
settings = {
|
||||
# Workaround for QtWebEngine screen flicker/flash on Wayland+Intel
|
||||
qt.args = [
|
||||
"disable-gpu-compositing"
|
||||
"enable-features=VaapiVideoDecoder,VaapiVideoEncoder"
|
||||
];
|
||||
colors.webpage.preferred_color_scheme = "dark";
|
||||
content.notifications.enabled = false;
|
||||
content.pdfjs = true;
|
||||
content.webgl = false;
|
||||
@@ -262,22 +291,13 @@ in
|
||||
*/
|
||||
{
|
||||
enable = true;
|
||||
events = [
|
||||
{
|
||||
event = "before-sleep";
|
||||
command = "${locker}/bin/swaylock_fancy";
|
||||
}
|
||||
{
|
||||
event = "lock";
|
||||
command = "${locker}/bin/swaylock_fancy";
|
||||
}
|
||||
events = {
|
||||
before-sleep = "${locker}/bin/swaylock_fancy";
|
||||
lock = "${locker}/bin/swaylock_fancy";
|
||||
/*
|
||||
{
|
||||
event = "after-resume";
|
||||
command = "${refresh_i3status}/bin/refresh_i3status";
|
||||
}
|
||||
after-resume = "${refresh_i3status}/bin/refresh_i3status";
|
||||
*/
|
||||
];
|
||||
};
|
||||
timeouts = [
|
||||
{
|
||||
timeout = 15 * 60;
|
||||
|
||||
@@ -160,7 +160,7 @@ in
|
||||
ungoogled-chromium
|
||||
upx
|
||||
viber
|
||||
wasistlos
|
||||
karere
|
||||
waybar
|
||||
wdisplays
|
||||
weechat
|
||||
|
||||
@@ -27,6 +27,19 @@
|
||||
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 = {
|
||||
@@ -49,7 +62,7 @@
|
||||
# Set your time zone.
|
||||
time.timeZone = "Europe/Berlin";
|
||||
|
||||
users.users.root.initialHashedPassword = "";
|
||||
users.users.root.hashedPassword = "!";
|
||||
users.users.root.openssh.authorizedKeys.keys = [
|
||||
(builtins.readFile ../nixy/ssh_pubkey)
|
||||
];
|
||||
@@ -108,10 +121,14 @@
|
||||
certificateScheme = "acme-nginx";
|
||||
};
|
||||
|
||||
services.journald.extraConfig = ''SystemMaxUse=50M '';
|
||||
services.journald.extraConfig = ''SystemMaxUse=500M '';
|
||||
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
|
||||
@@ -119,6 +136,13 @@
|
||||
}
|
||||
];
|
||||
|
||||
services.fail2ban = {
|
||||
enable = true;
|
||||
maxretry = 5;
|
||||
bantime = "1h";
|
||||
ignoreIP = [ "10.100.0.0/24" ];
|
||||
};
|
||||
|
||||
services.opendkim = {
|
||||
enable = true;
|
||||
selector = "mail";
|
||||
@@ -308,6 +332,12 @@
|
||||
defaults.email = "asmir.abdulahovic@gmail.com";
|
||||
};
|
||||
|
||||
security.sudo.execWheelOnly = true;
|
||||
|
||||
environment.memoryAllocator.provider = "jemalloc";
|
||||
|
||||
systemd.coredump.enable = false;
|
||||
|
||||
sops = {
|
||||
age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
|
||||
secrets = {
|
||||
@@ -341,14 +371,13 @@
|
||||
80
|
||||
443
|
||||
587
|
||||
2049
|
||||
]; # http, mail, mail, nfs
|
||||
]; # http, https, submission
|
||||
allowedUDPPorts = [
|
||||
443
|
||||
51820
|
||||
]; # mail, wireguard
|
||||
]; # http3, wireguard
|
||||
allowPing = true;
|
||||
logRefusedConnections = lib.mkDefault false;
|
||||
logRefusedConnections = lib.mkDefault true;
|
||||
};
|
||||
|
||||
networking.nat = {
|
||||
|
||||
@@ -27,6 +27,10 @@ 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