This commit is contained in:
Henri Dohmen 2025-05-30 22:46:27 +02:00
parent a992a7b701
commit b61bb970a5
30 changed files with 69 additions and 34 deletions

15
pc/audio.nix Normal file
View file

@ -0,0 +1,15 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
pavucontrol
alsa-utils
];
services.pulseaudio.enable = false;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
}

21
pc/default.nix Normal file
View file

@ -0,0 +1,21 @@
{
inputs,
lib,
config,
...
}:
{
imports = [
./audio.nix
./fonts.nix
./gpg.nix
./home-manager.nix
./network.nix
./nix.nix
./security.nix
./services.nix
./software
./sync.nix
inputs.nixos-config-hidden.nixosModules.pc
];
}

13
pc/fonts.nix Normal file
View file

@ -0,0 +1,13 @@
{ pkgs, ... }:
{
fonts = {
packages = with pkgs; [
noto-fonts
noto-fonts-cjk-sans
noto-fonts-emoji
nerd-fonts.noto
];
fontDir.enable = true;
fontconfig.defaultFonts.monospace = [ "Noto Nerd Font Mono" ];
};
}

9
pc/gpg.nix Normal file
View file

@ -0,0 +1,9 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [ seahorse ];
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
pinentryPackage = pkgs.pinentry-gtk2;
};
}

29
pc/home-manager.nix Normal file
View file

@ -0,0 +1,29 @@
{
inputs,
lib,
options,
config,
...
}:
{
options.home = lib.mkOption {
type = lib.types.attrsOf lib.types.str;
default = { };
description = "home-manager configuration.";
};
imports = [
inputs.home-manager.nixosModules.home-manager
{
home-manager.users."hd" = lib.mkAliasDefinitions options.home;
# install to /etc/profiles, not ~/.nix-profile
home-manager.useUserPackages = true;
# dont use home.nixpkgs
home-manager.useGlobalPkgs = true;
}
];
config = {
home.home.stateVersion = config.system.stateVersion;
};
}

81
pc/network.nix Normal file
View file

@ -0,0 +1,81 @@
{
host,
var,
lib,
...
}:
{
hardware.bluetooth.enable = true;
systemd.network.wait-online.enable = false;
services = {
mullvad-vpn.enable = true;
blueman.enable = true;
resolved = {
enable = true;
dnssec = "true";
dnsovertls = "true";
fallbackDns = [ ];
};
};
networking = {
nameservers = [
"1.1.1.1#one.one.one.one"
"1.0.0.1#one.one.one.one"
];
enableIPv6 = true;
wireguard.enable = true;
wg-quick = {
interfaces = {
"onet" = {
address = var.wg.wireguard-network.${host}.ips;
privateKeyFile = var.wg.keyFile;
peers = [ (lib.removeAttrs var.wg.wireguard-network."roam" [ "ips" ]) ];
};
};
};
networkmanager = {
enable = true;
wifi.macAddress = "random";
ensureProfiles.profiles = {
"tuda-vpn" = {
connection = {
autoconnect = "false";
id = "tuda-vpn";
type = "vpn";
};
ipv4 = {
method = "auto";
};
ipv6 = {
addr-gen-mode = "stable-privacy";
method = "auto";
};
vpn = {
authtype = "password";
autoconnect-flags = "0";
certsigs-flags = "0";
cookie-flags = "2";
disable_udp = "no";
enable_csd_trojan = "no";
gateway = "vpn.hrz.tu-darmstadt.de";
gateway-flags = "2";
gwcert-flags = "2";
lasthost-flags = "0";
pem_passphrase_fsid = "no";
prevent_invalid_cert = "no";
protocol = "anyconnect";
resolve-flags = "2";
service-type = "org.freedesktop.NetworkManager.openconnect";
stoken_source = "disabled";
xmlconfig-flags = "0";
password-flags = 0;
};
};
};
};
};
}

18
pc/nix.nix Normal file
View file

@ -0,0 +1,18 @@
{ lib, ... }:
{
nixpkgs.config.allowUnfreePredicate =
pkg:
builtins.elem (lib.getName pkg) [
"nvidia-x11"
"nvidia-settings"
"vscode"
"obsidian"
"steam"
"steam-unwrapped"
"gateway" # jetbrains
"spotify"
"rust-rover"
];
programs.nix-ld.enable = true;
}

4
pc/security.nix Normal file
View file

@ -0,0 +1,4 @@
{ ... }:
{
security.protectKernelImage = true;
}

14
pc/services.nix Normal file
View file

@ -0,0 +1,14 @@
{ ... }:
{
services = {
printing.enable = true;
avahi = {
enable = true;
nssmdns4 = true;
openFirewall = true;
};
udisks2.enable = true;
emacs.enable = true;
protonmail-bridge.enable = true;
};
}

9
pc/software/default.nix Normal file
View file

@ -0,0 +1,9 @@
{ ... }:
{
imports = [
./development.nix
./editors.nix
./programs.nix
./window-manager.nix
];
}

View file

@ -0,0 +1,18 @@
{ pkgs, ... }:
{
documentation.dev.enable = true;
environment.systemPackages = with pkgs; [
rustup
python313
python313Packages.mypy
gcc
clang
gdb
gnumake
binutils
nixfmt-rfc-style
man-pages
man-pages-posix
];
}

9
pc/software/editors.nix Normal file
View file

@ -0,0 +1,9 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
vscode
emacs
jetbrains.gateway
jetbrains.rust-rover
];
}

43
pc/software/programs.nix Normal file
View file

@ -0,0 +1,43 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
signal-desktop
element-desktop
zulip
vesktop
wireguard-tools
bitwarden
kitty
nil
vlc
spotify
calibre
zotero
obsidian
];
virtualisation = {
docker.enable = true;
};
programs = {
firefox.enable = true;
};
home = {
programs.thunderbird = {
enable = true;
package = pkgs.thunderbird-latest;
profiles.default = {
isDefault = true;
settings = {
"mail.openpgp.allow_external_gnupg" = true;
"mail.openpgp.fetch_pubkeys_from_gnupg" = true;
};
};
};
};
# Some excludes
services.xserver.excludePackages = [ pkgs.xterm ];
}

View file

@ -0,0 +1,9 @@
{ pkgs, ... }:
{
# Enable the KDE Plasma Desktop Environment.
services.displayManager.sddm = {
enable = true;
wayland.enable = true;
};
services.desktopManager.plasma6.enable = true;
}

16
pc/sync.nix Normal file
View file

@ -0,0 +1,16 @@
{ pkgs, ... }:
{
home.services.unison = {
enable = true;
pairs = {
"docs".roots = [
"/home/hd/Documents"
"ssh://roam//home/hd/Documents"
];
"desktop".roots = [
"/home/hd/Desktop"
"ssh://roam//home/hd/Desktop"
];
};
};
}