2024-12-20 22:37:44 -05:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
home-manager,
|
|
|
|
...
|
|
|
|
}:
|
2024-12-17 15:26:10 -05:00
|
|
|
|
|
|
|
{
|
2024-12-20 22:37:44 -05:00
|
|
|
imports = [
|
|
|
|
./roles/reset
|
2025-01-20 19:27:49 -05:00
|
|
|
./roles/global_options
|
2025-01-11 13:48:46 -05:00
|
|
|
./util/unfree_polyfill
|
2024-12-21 10:18:28 -05:00
|
|
|
./roles/iso
|
2024-12-20 22:37:44 -05:00
|
|
|
"${
|
|
|
|
builtins.fetchTarball {
|
|
|
|
url = "https://github.com/nix-community/disko/archive/refs/tags/v1.9.0.tar.gz";
|
|
|
|
sha256 = "0j76ar4qz320fakdii4659w5lww8wiz6yb7g47npywqvf2lbp388";
|
|
|
|
}
|
|
|
|
}/module.nix"
|
2024-12-29 15:27:03 -05:00
|
|
|
./roles/boot
|
|
|
|
./roles/zfs
|
|
|
|
./roles/network
|
2024-12-20 22:37:44 -05:00
|
|
|
./roles/firewall
|
2024-12-23 11:14:18 -05:00
|
|
|
./roles/zsh
|
2025-01-13 17:59:03 -05:00
|
|
|
./roles/zrepl
|
2024-12-20 22:37:44 -05:00
|
|
|
./roles/graphics
|
|
|
|
./roles/sound
|
|
|
|
./roles/sway
|
2025-01-14 20:16:06 -05:00
|
|
|
./roles/kanshi
|
2024-12-20 22:37:44 -05:00
|
|
|
./roles/alacritty
|
|
|
|
./roles/firefox
|
2024-12-22 00:48:57 -05:00
|
|
|
./roles/chromium
|
2024-12-20 22:37:44 -05:00
|
|
|
./roles/emacs
|
|
|
|
./roles/git
|
|
|
|
./roles/fonts
|
|
|
|
./roles/gpg
|
2024-12-21 10:18:28 -05:00
|
|
|
./roles/waybar
|
|
|
|
./roles/qemu
|
2024-12-27 15:44:00 -05:00
|
|
|
./roles/wireguard
|
2025-01-11 12:09:02 -05:00
|
|
|
./roles/ares
|
2024-12-31 06:59:22 -05:00
|
|
|
./roles/ssh
|
2024-12-31 07:37:48 -05:00
|
|
|
./roles/python
|
2025-01-01 14:10:08 -05:00
|
|
|
./roles/docker
|
2025-01-01 14:14:55 -05:00
|
|
|
./roles/kubernetes
|
2025-01-01 19:16:08 -05:00
|
|
|
./roles/rust
|
2025-01-10 22:54:32 -05:00
|
|
|
./roles/media
|
2025-01-11 13:48:46 -05:00
|
|
|
./roles/steam
|
2025-01-14 18:04:04 -05:00
|
|
|
./roles/latex
|
2025-01-14 20:16:06 -05:00
|
|
|
./roles/launch_keyboard
|
2025-01-14 21:54:21 -05:00
|
|
|
./roles/lvfs
|
2025-01-14 21:51:53 -05:00
|
|
|
./roles/nvme
|
2025-01-14 23:17:26 -05:00
|
|
|
./roles/terraform
|
2025-01-14 23:50:24 -05:00
|
|
|
./roles/vscode
|
2025-01-14 23:55:27 -05:00
|
|
|
./roles/wasm
|
2025-01-17 20:30:16 -05:00
|
|
|
./roles/vnc_client
|
2025-01-19 13:44:01 -05:00
|
|
|
./roles/chromecast
|
2025-01-19 21:29:24 -05:00
|
|
|
./roles/memtest86
|
2025-01-20 19:40:54 -05:00
|
|
|
./roles/kodi
|
2025-01-21 20:56:48 -05:00
|
|
|
./roles/ansible
|
2025-01-21 22:19:28 -05:00
|
|
|
./roles/bluetooth
|
2025-01-24 20:08:10 -05:00
|
|
|
./roles/sm64ex
|
2025-01-24 20:23:49 -05:00
|
|
|
./roles/shipwright
|
2025-01-24 21:25:41 -05:00
|
|
|
./roles/2ship2harkinian
|
2025-01-25 20:18:10 -05:00
|
|
|
./roles/nix_index
|
2025-02-01 11:30:52 -05:00
|
|
|
./roles/flux
|
2025-02-01 11:32:25 -05:00
|
|
|
./roles/tekton
|
2024-12-20 22:37:44 -05:00
|
|
|
];
|
2024-12-17 15:26:10 -05:00
|
|
|
|
2024-12-20 22:37:44 -05:00
|
|
|
nix.settings.experimental-features = [
|
|
|
|
"nix-command"
|
|
|
|
"flakes"
|
|
|
|
];
|
2024-12-19 18:09:48 -05:00
|
|
|
nix.settings.trusted-users = [ "@wheel" ];
|
2024-12-17 15:26:10 -05:00
|
|
|
|
2024-12-23 10:00:01 -05:00
|
|
|
# boot.kernelPackages = pkgs.linuxPackages_6_11;
|
2024-12-19 19:52:27 -05:00
|
|
|
hardware.enableRedistributableFirmware = true;
|
2024-12-19 19:36:10 -05:00
|
|
|
|
2024-12-21 17:15:54 -05:00
|
|
|
services.getty = {
|
|
|
|
autologinUser = "talexander"; # I use full disk encryption so the user password is irrelevant.
|
|
|
|
autologinOnce = true;
|
|
|
|
};
|
2024-12-17 15:26:10 -05:00
|
|
|
users.mutableUsers = false;
|
|
|
|
users.users.talexander = {
|
|
|
|
isNormalUser = true;
|
|
|
|
createHome = true; # https://github.com/NixOS/nixpkgs/issues/6481
|
2024-12-20 15:22:46 -05:00
|
|
|
group = "talexander";
|
2024-12-17 15:26:10 -05:00
|
|
|
extraGroups = [ "wheel" ];
|
2024-12-20 15:22:46 -05:00
|
|
|
uid = 11235;
|
2024-12-17 15:26:10 -05:00
|
|
|
packages = with pkgs; [
|
|
|
|
tree
|
|
|
|
];
|
|
|
|
# Generate with `mkpasswd -m scrypt`
|
|
|
|
hashedPassword = "$7$CU..../....VXvNQ8za3wSGpdzGXNT50/$HcFtn/yvwPMCw4888BelpiAPLAxe/zU87fD.d/N6U48";
|
|
|
|
openssh.authorizedKeys.keys = [
|
|
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGu+k5lrirokdW5zVdRVBOqEOAvAPlIkG/MdJNc9g5ky"
|
|
|
|
"sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIEI6mu6I5Jp+Ib0vJxapGHbEShZjyvzV8jz5DnzDrI39AAAABHNzaDo="
|
|
|
|
"sk-ssh-ed25519@openssh.com AAAAGnNrLXNzaC1lZDI1NTE5QG9wZW5zc2guY29tAAAAIAFNcSXwvy+brYTOGo56G93Ptuq2MmZsjvRWAfMqbmMLAAAABHNzaDo="
|
|
|
|
];
|
|
|
|
};
|
2024-12-20 15:22:46 -05:00
|
|
|
users.groups.talexander.gid = 11235;
|
2024-12-20 22:37:44 -05:00
|
|
|
home-manager.users.talexander =
|
|
|
|
{ pkgs, ... }:
|
|
|
|
{
|
|
|
|
home.packages = [
|
|
|
|
pkgs.atool
|
|
|
|
pkgs.httpie
|
|
|
|
];
|
|
|
|
programs.bash.enable = true;
|
|
|
|
|
|
|
|
# The state version is required and should stay at the version you
|
|
|
|
# originally installed.
|
|
|
|
home.stateVersion = "24.11";
|
|
|
|
};
|
2024-12-17 15:26:10 -05:00
|
|
|
|
|
|
|
# Automatic garbage collection
|
2025-01-18 11:33:39 -05:00
|
|
|
nix.gc = lib.mkIf (!config.me.buildingIso) {
|
2024-12-17 15:26:10 -05:00
|
|
|
# Runs nix-collect-garbage --delete-older-than 5d
|
|
|
|
automatic = true;
|
|
|
|
randomizedDelaySec = "14m";
|
2025-01-01 13:31:45 -05:00
|
|
|
options = "--delete-older-than 30d";
|
2024-12-17 15:26:10 -05:00
|
|
|
};
|
2025-01-19 10:35:31 -05:00
|
|
|
nix.settings.auto-optimise-store = !config.me.buildingIso;
|
2024-12-17 15:26:10 -05:00
|
|
|
|
|
|
|
# Use doas instead of sudo
|
|
|
|
security.doas.enable = true;
|
|
|
|
security.doas.wheelNeedsPassword = false;
|
|
|
|
security.sudo.enable = false;
|
2024-12-20 22:37:44 -05:00
|
|
|
security.doas.extraRules = [
|
|
|
|
{
|
|
|
|
# Retain environment (for example NIX_PATH)
|
|
|
|
keepEnv = true;
|
|
|
|
persist = true; # Only ask for a password the first time.
|
|
|
|
}
|
|
|
|
];
|
2024-12-17 15:26:10 -05:00
|
|
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
wget
|
|
|
|
mg
|
|
|
|
rsync
|
|
|
|
libinput
|
|
|
|
htop
|
|
|
|
tmux
|
|
|
|
file
|
|
|
|
usbutils # for lsusb
|
|
|
|
pciutils # for lspci
|
2024-12-20 17:06:02 -05:00
|
|
|
ripgrep
|
2024-12-20 21:06:04 -05:00
|
|
|
strace
|
2025-01-15 21:12:28 -05:00
|
|
|
ltrace
|
|
|
|
trace-cmd # ftrace
|
2024-12-20 21:06:04 -05:00
|
|
|
tcpdump
|
2024-12-26 21:28:31 -05:00
|
|
|
git-crypt
|
2025-01-12 18:29:48 -05:00
|
|
|
gnumake
|
2025-01-19 11:05:00 -05:00
|
|
|
ncdu
|
2025-01-24 19:01:51 -05:00
|
|
|
nix-tree
|
2025-01-24 20:58:03 -05:00
|
|
|
libarchive # bsdtar
|
2025-01-29 19:40:44 -05:00
|
|
|
lsof
|
2025-01-31 21:29:05 -05:00
|
|
|
doas-sudo-shim # To support --use-remote-sudo for remote builds
|
2024-12-17 15:26:10 -05:00
|
|
|
];
|
|
|
|
|
|
|
|
services.openssh = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
PasswordAuthentication = false;
|
|
|
|
KbdInteractiveAuthentication = false;
|
|
|
|
};
|
|
|
|
hostKeys = [
|
|
|
|
{
|
|
|
|
path = "/persist/ssh/ssh_host_ed25519_key";
|
|
|
|
type = "ed25519";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
path = "/persist/ssh/ssh_host_rsa_key";
|
|
|
|
type = "rsa";
|
|
|
|
bits = 4096;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2024-12-21 10:18:28 -05:00
|
|
|
environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) {
|
2024-12-17 15:26:10 -05:00
|
|
|
hideMounts = true;
|
|
|
|
directories = [
|
|
|
|
"/var/lib/iwd" # Wifi settings
|
|
|
|
"/var/lib/nixos" # Contains user information (uids/gids)
|
2024-12-21 10:18:28 -05:00
|
|
|
"/var/lib/systemd" # Systemd state directory for random seed, persistent timers, core dumps, persist hardware state like backlight and rfkill
|
|
|
|
"/var/log/journal" # Logs, alternatively set `services.journald.storage = "volatile";` to write to /run/log/journal
|
2024-12-17 15:26:10 -05:00
|
|
|
];
|
|
|
|
files = [
|
2024-12-21 10:18:28 -05:00
|
|
|
"/etc/machine-id" # Systemd unique machine id "otherwise, the system journal may fail to list earlier boots, etc"
|
2024-12-17 15:26:10 -05:00
|
|
|
"/etc/ssh/ssh_host_rsa_key"
|
|
|
|
"/etc/ssh/ssh_host_rsa_key.pub"
|
|
|
|
"/etc/ssh/ssh_host_ed25519_key"
|
|
|
|
"/etc/ssh/ssh_host_ed25519_key.pub"
|
|
|
|
];
|
2025-01-24 20:36:37 -05:00
|
|
|
users.talexander = {
|
|
|
|
directories = [
|
|
|
|
{
|
|
|
|
directory = "persist";
|
|
|
|
user = "talexander";
|
|
|
|
group = "talexander";
|
|
|
|
mode = "0700";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2024-12-17 15:26:10 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
# Write a list of the currently installed packages to /etc/current-system-packages
|
|
|
|
environment.etc."current-system-packages".text =
|
|
|
|
let
|
|
|
|
packages = builtins.map (p: "${p.name}") config.environment.systemPackages;
|
|
|
|
sortedUnique = builtins.sort builtins.lessThan (lib.unique packages);
|
|
|
|
formatted = builtins.concatStringsSep "\n" sortedUnique;
|
|
|
|
in
|
2024-12-20 22:37:44 -05:00
|
|
|
formatted;
|
2024-12-17 15:26:10 -05:00
|
|
|
|
2025-01-24 18:53:57 -05:00
|
|
|
# environment.etc."system-packages-with-source".text = builtins.concatStringsSep "\n\n" (
|
|
|
|
# builtins.map (
|
|
|
|
# x: x.file + "\n" + builtins.concatStringsSep "\n" (builtins.map (s: " " + s) x.value)
|
|
|
|
# ) config.environment.systemPackages.definitionsWithLocations
|
|
|
|
# );
|
|
|
|
|
2024-12-17 15:26:10 -05:00
|
|
|
# nixpkgs.overlays = [
|
|
|
|
# (final: prev: {
|
|
|
|
# nix = pkgs-unstable.nix;
|
|
|
|
# })
|
|
|
|
# ];
|
|
|
|
|
2025-01-24 18:36:14 -05:00
|
|
|
# nixpkgs.overlays = [
|
|
|
|
# (final: prev: {
|
|
|
|
# foot = throw "foo";
|
|
|
|
# })
|
|
|
|
# ];
|
|
|
|
|
2024-12-17 15:26:10 -05:00
|
|
|
# Copy the NixOS configuration file and link it from the resulting system
|
|
|
|
# (/run/current-system/configuration.nix). This is useful in case you
|
|
|
|
# accidentally delete configuration.nix.
|
|
|
|
# system.copySystemConfiguration = true;
|
|
|
|
|
|
|
|
# This option defines the first version of NixOS you have installed on this particular machine,
|
|
|
|
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
|
|
|
|
#
|
|
|
|
# Most users should NEVER change this value after the initial install, for any reason,
|
|
|
|
# even if you've upgraded your system to a new NixOS release.
|
|
|
|
#
|
|
|
|
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
|
|
|
|
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
|
|
|
|
# to actually do that.
|
|
|
|
#
|
|
|
|
# This value being lower than the current NixOS release does NOT mean your system is
|
|
|
|
# out of date, out of support, or vulnerable.
|
|
|
|
#
|
|
|
|
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
|
|
|
|
# and migrated your data accordingly.
|
|
|
|
#
|
|
|
|
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
|
|
|
|
system.stateVersion = "24.11"; # Did you read the comment?
|
|
|
|
|
|
|
|
}
|