Compare commits

...

11 Commits

Author SHA1 Message Date
Tom Alexander
d9bc4f15d8
Add powertop. 2024-12-31 07:44:02 -05:00
Tom Alexander
77ae96ca7a
Set up python. 2024-12-31 07:37:48 -05:00
Tom Alexander
d2f908005c
Persist the .ssh known_hosts. 2024-12-31 07:00:41 -05:00
Tom Alexander
5e74a874ba
Persist sound settings (for example, muted status) and do not enable wireguard in built ISO. 2024-12-29 15:45:52 -05:00
Tom Alexander
fe820e5843
Move remaining nix configs into folders. 2024-12-29 15:27:03 -05:00
Tom Alexander
81315e4c7b
Add a snes emulator. 2024-12-29 15:12:31 -05:00
Tom Alexander
ce8718b042
Add wgh wireguard network. 2024-12-28 21:05:45 -05:00
Tom Alexander
720164497d
More attempts to fix gpg decrypt with yubikey. 2024-12-27 20:53:43 -05:00
Tom Alexander
0b31b91c69
Set up wireguard. 2024-12-27 15:44:00 -05:00
Tom Alexander
2ef181cfab
Attempt to fix gpg decrypt with yubikey. Did not succeed. 2024-12-27 13:09:13 -05:00
Tom Alexander
5a3450fdf8
Add gvfs and git-crypt. 2024-12-26 21:28:31 -05:00
17 changed files with 233 additions and 12 deletions

View File

@ -18,9 +18,9 @@
sha256 = "0j76ar4qz320fakdii4659w5lww8wiz6yb7g47npywqvf2lbp388"; sha256 = "0j76ar4qz320fakdii4659w5lww8wiz6yb7g47npywqvf2lbp388";
} }
}/module.nix" }/module.nix"
./boot.nix ./roles/boot
./zfs.nix ./roles/zfs
./network.nix ./roles/network
./roles/firewall ./roles/firewall
./roles/zsh ./roles/zsh
./roles/graphics ./roles/graphics
@ -35,6 +35,10 @@
./roles/gpg ./roles/gpg
./roles/waybar ./roles/waybar
./roles/qemu ./roles/qemu
./roles/wireguard
./roles/bsnes
./roles/ssh
./roles/python
]; ];
nix.settings.experimental-features = [ nix.settings.experimental-features = [
@ -122,6 +126,7 @@
ripgrep ripgrep
strace strace
tcpdump tcpdump
git-crypt
]; ];
services.openssh = { services.openssh = {

View File

@ -181,11 +181,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1734991663, "lastModified": 1735141468,
"narHash": "sha256-8T660guvdaOD+2/Cj970bWlQwAyZLKrrbkhYOFcY1YE=", "narHash": "sha256-VIAjBr1qGcEbmhLwQJD6TABppPMggzOvqFsqkDoMsAY=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "6c90912761c43e22b6fb000025ab96dd31c971ff", "rev": "4005c3ff7505313cbc21081776ad0ce5dfd7a3ce",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -345,7 +345,7 @@
}, },
"locked": { "locked": {
"lastModified": 1, "lastModified": 1,
"narHash": "sha256-Cf8NVSnjPiAi29Df1Tb1Ea6uqISWps5nx3qJl5yAbOo=", "narHash": "sha256-TFks1dvPwAXKQeePh9jmxj06ZfXArH1pN9yXVQWeL6w=",
"path": "flakes/zsh-histdb", "path": "flakes/zsh-histdb",
"type": "path" "type": "path"
}, },

View File

@ -20,11 +20,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1734991663, "lastModified": 1735141468,
"narHash": "sha256-8T660guvdaOD+2/Cj970bWlQwAyZLKrrbkhYOFcY1YE=", "narHash": "sha256-VIAjBr1qGcEbmhLwQJD6TABppPMggzOvqFsqkDoMsAY=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "6c90912761c43e22b6fb000025ab96dd31c971ff", "rev": "4005c3ff7505313cbc21081776ad0ce5dfd7a3ce",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -4,6 +4,7 @@
./hardware-configuration.nix ./hardware-configuration.nix
./disk-config.nix ./disk-config.nix
./optimized_build.nix ./optimized_build.nix
./power_management.nix
]; ];
# Generate with `head -c4 /dev/urandom | od -A none -t x4` # Generate with `head -c4 /dev/urandom | od -A none -t x4`
@ -14,4 +15,10 @@
time.timeZone = "America/New_York"; time.timeZone = "America/New_York";
me.secureBoot.enable = true; me.secureBoot.enable = true;
# Early KMS
boot.initrd.kernelModules = [ "amdgpu" ];
# Mount tmpfs at /tmp
boot.tmp.useTmpfs = true;
} }

View File

@ -2,11 +2,29 @@
config, config,
lib, lib,
pkgs, pkgs,
pkgs-unstable,
... ...
}: }:
{ {
imports = [ ]; imports = [ ];
nix.settings.system-features = lib.mkForce [
"gccarch-znver4"
"gccarch-skylake"
# "gccarch-alderlake" missing pkgwait
"gccarch-x86-64-v3"
"benchmark"
"big-parallel"
"kvm"
"nixos-test"
];
# nixpkgs.hostPlatform = {
# gcc.arch = "znver4";
# gcc.tune = "znver4";
# system = "x86_64-linux";
# };
nixpkgs.overlays = [ nixpkgs.overlays = [
( (
self: super: self: super:
@ -24,6 +42,9 @@
]; ];
} }
) )
(final: prev: {
linux-firmware = pkgs-unstable.linux-firmware;
})
]; ];
boot.kernelPackages = lib.mkIf (!config.me.buildingIso) (pkgs.linuxPackagesFor pkgs.linux_znver4); boot.kernelPackages = lib.mkIf (!config.me.buildingIso) (pkgs.linuxPackagesFor pkgs.linux_znver4);

View File

@ -0,0 +1,14 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [ ];
environment.systemPackages = with pkgs; [
powertop
];
}

View File

@ -0,0 +1,14 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [ ];
environment.systemPackages = with pkgs; [
bsnes-hd
];
}

View File

@ -2,6 +2,7 @@
config, config,
lib, lib,
pkgs, pkgs,
pkgs-unstable,
... ...
}: }:
@ -13,9 +14,36 @@
# #
# gpg -vvv --auto-key-locate local,wkd --locate-keys tom@fizz.buzz # gpg -vvv --auto-key-locate local,wkd --locate-keys tom@fizz.buzz
hardware.gpgSmartcards.enable = true;
services.udev.packages = [ pkgs.yubikey-personalization ];
services.pcscd.enable = true;
# services.gnome.gnome-keyring.enable = true;
# services.dbus.packages = [ pkgs.gcr ];
# services.pcscd.plugins = lib.mkForce [ ];
# programs.gpg.scdaemonSettings = {
# disable-ccid = true;
# };
# .gnupg/scdaemon.conf
home-manager.users.talexander =
{ pkgs, ... }:
{
home.file.".gnupg/scdaemon.conf" = {
source = ./files/scdaemon.conf;
};
};
programs.gnupg.dirmngr.enable = true;
programs.gnupg.agent = { programs.gnupg.agent = {
enable = true; enable = true;
enableSSHSupport = true; enableSSHSupport = true;
pinentryPackage = pkgs.pinentry-qt;
# settings = {
# disable-ccid = true;
# };
}; };
environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) { environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) {
@ -32,4 +60,40 @@
}; };
}; };
# nixpkgs.overlays = [
# (final: prev: {
# pcsclite = prev.pcsclite.overrideAttrs (old: {
# postPatch = ''
# substituteInPlace src/libredirect.c src/spy/libpcscspy.c \
# --replace-fail "libpcsclite_real.so.1" "$lib/lib/libpcsclite_real.so.1"
# '';
# });
# })
# ];
# security.polkit.extraConfig = ''
# polkit.addRule(function(action, subject) {
# if (action.id == "org.debian.pcsc-lite.access_card") {
# return polkit.Result.YES;
# }
# });
# polkit.addRule(function(action, subject) {
# if (action.id == "org.debian.pcsc-lite.access_pcsc") {
# return polkit.Result.YES;
# }
# });
# '';
environment.systemPackages = with pkgs; [
pcsctools
];
# nixpkgs.overlays = [
# (final: prev: {
# gnupg = pkgs-unstable.gnupg;
# scdaemon = pkgs-unstable.scdaemon;
# })
# ];
} }

View File

@ -0,0 +1,2 @@
reader-port Yubico Yubi
disable-ccid

View File

@ -16,7 +16,7 @@
]; ];
services.resolved = { services.resolved = {
enable = true; enable = true;
dnssec = "true"; # dnssec = "true";
domains = [ "~." ]; domains = [ "~." ];
fallbackDns = [ ]; fallbackDns = [ ];
dnsovertls = "true"; dnsovertls = "true";
@ -25,7 +25,14 @@
# Without this, systemd-resolved will send DNS requests for <X>.home.arpa to the per-link DNS server (172.16.0.1) which does not support DNS-over-TLS. This leads to the connection anging and timing out. This causes firefox startup to take an extra 10+ seconds. # Without this, systemd-resolved will send DNS requests for <X>.home.arpa to the per-link DNS server (172.16.0.1) which does not support DNS-over-TLS. This leads to the connection anging and timing out. This causes firefox startup to take an extra 10+ seconds.
# #
# Test with: drill @127.0.0.53 odo.home.arpa # Test with: drill @127.0.0.53 odo.home.arpa
networking.extraHosts = "127.0.0.1 odo.home.arpa"; networking.extraHosts = ''
127.0.0.1 odo.home.arpa
10.216.1.1 homeserver
10.216.1.6 media
10.216.1.12 odo
10.217.1.1 drmario
10.217.2.1 mrmanager
'';
networking.wireless.iwd = { networking.wireless.iwd = {
enable = true; enable = true;

View File

@ -0,0 +1,18 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [ ];
environment.systemPackages = with pkgs; [
python3
poetry
pyright
isort
black
];
}

View File

@ -60,4 +60,14 @@
'') '')
]; ];
}; };
environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) {
hideMounts = true;
users.talexander = {
directories = [
".local/state/wireplumber" # Sound settings
];
};
};
} }

View File

@ -0,0 +1,19 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [ ];
environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) {
hideMounts = true;
users.talexander = {
files = [
".ssh/known_hosts"
];
};
};
}

View File

@ -374,4 +374,7 @@ in
}; };
}; };
}; };
# For mounting drives in pcmanfm
services.gvfs.enable = true;
} }

View File

@ -0,0 +1,37 @@
{
config,
lib,
pkgs,
...
}:
{
imports = [ ];
config = lib.mkIf (!config.me.buildingIso) {
networking.firewall.allowedUDPPorts = [ 51821 ];
networking.wireguard.enable = true;
networking.wg-quick.interfaces.drmario.configFile = "/persist/manual/wireguard/drmario.conf";
systemd.services."wg-quick-drmario".after = [
"nss-lookup.target"
"systemd-resolved.service"
"multi-user.target"
];
systemd.services."wg-quick-drmario".preStart = "${pkgs.toybox}/bin/sleep 10";
networking.wg-quick.interfaces.wgh.configFile = "/persist/manual/wireguard/wgh.conf";
systemd.services."wg-quick-wgh".after = [
"nss-lookup.target"
"systemd-resolved.service"
"multi-user.target"
];
systemd.services."wg-quick-wgh".preStart = "${pkgs.toybox}/bin/sleep 10";
};
# environment.systemPackages = with pkgs; [
# wireguard-tools
# ];
}