Organize configuration better

This commit is contained in:
thiloho
2025-01-29 00:51:37 +01:00
parent bbc956ff51
commit 642d3f55f1
11 changed files with 355 additions and 322 deletions

View File

@@ -1,30 +1,26 @@
{ inputs, pkgs, ... }:
{
imports = [
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t480s
./hardware-configuration.nix
../shared-desktop.nix
../shared.nix
../../modules/core.nix
../../modules/desktop.nix
../../modules/development.nix
../../modules/home.nix
../../modules/media.nix
];
networking.hostName = "laptop";
boot.initrd = {
luks.devices = {
cryptroot = {
device = "/dev/disk/by-uuid/f1b5a08f-e515-4fba-b3f4-2a1091063cdc";
};
};
boot.initrd.luks.devices.cryptroot = {
device = "/dev/disk/by-uuid/f1b5a08f-e515-4fba-b3f4-2a1091063cdc";
};
home-manager.users.thiloho = {
programs.git.signing.key = "3B62137A89493F7D";
home.stateVersion = "24.11";
};
home-manager.users.thiloho =
{ pkgs, ... }:
{
programs.git.signing.key = "3B62137A89493F7D";
home = {
stateVersion = "24.11";
};
};
system.stateVersion = "24.11";
}

View File

@@ -1,32 +1,47 @@
# 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, ... }:
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.availableKernelModules = [
"xhci_pci"
"nvme"
"usbhid"
"usb_storage"
"sd_mod"
];
boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/8c24d51b-f02d-4c0c-9894-50b4209cf8c0";
fsType = "ext4";
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/8c24d51b-f02d-4c0c-9894-50b4209cf8c0";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/222F-191E";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices =
[ { device = "/dev/disk/by-uuid/c6a47a90-a892-43c0-82e2-74b489aabc17"; }
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/222F-191E";
fsType = "vfat";
options = [
"fmask=0077"
"dmask=0077"
];
};
swapDevices = [
{ device = "/dev/disk/by-uuid/c6a47a90-a892-43c0-82e2-74b489aabc17"; }
];
# 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

View File

@@ -1,12 +1,15 @@
{ inputs, pkgs, ... }:
{
imports = [
inputs.nixos-hardware.nixosModules.common-gpu-amd
inputs.nixos-hardware.nixosModules.common-cpu-amd
./hardware-configuration.nix
../shared-desktop.nix
../shared.nix
../../modules/core.nix
../../modules/desktop.nix
../../modules/development.nix
../../modules/home.nix
../../modules/media.nix
];
networking = {
@@ -23,28 +26,22 @@
};
};
boot.initrd = {
luks.devices = {
cryptroot = {
device = "/dev/disk/by-uuid/1202158c-cf4a-49f5-83f6-d54af16bca65";
};
boot = {
initrd.luks.devices.cryptroot = {
device = "/dev/disk/by-uuid/1202158c-cf4a-49f5-83f6-d54af16bca65";
};
kernelParams = [ "amd_iommu=on" ];
kernelModules = [ "v4l2loopback" ];
extraModulePackages = [ pkgs.linuxPackages_latest.v4l2loopback ];
extraModprobeConfig = ''
options v4l2loopback exclusive_caps=1 card_label="Virtual Webcam"
'';
};
environment.sessionVariables = {
MUTTER_DEBUG_FORCE_KMS_MODE = "simple";
MUTTER_DEBUG_DISABLE_HW_CURSORS = "1";
};
boot.kernelParams = [ "amd_iommu=on" ];
virtualisation.libvirtd.enable = true;
virtualisation.libvirtd.qemu.swtpm.enable = true;
programs.virt-manager.enable = true;
programs.adb.enable = true;
users.users.thiloho.extraGroups = [ "adbusers" ];
# Use same monitor settings for GDM as for GNOME user
systemd.tmpfiles.rules = [
"L+ /run/gdm/.config/monitors.xml - - - - ${pkgs.writeText "gdm-monitors.xml" ''
<monitors version="2">
@@ -73,16 +70,17 @@
''}"
];
home-manager.users.thiloho =
{ pkgs, lib, ... }:
{
programs.git.signing.key = "273D6150B9741CCF";
home = {
packages = with pkgs; [
inkscape
];
stateVersion = "24.11";
};
home-manager.users.thiloho = {
programs.git.signing.key = "273D6150B9741CCF";
xdg.desktopEntries.andcam = {
name = "Android Virtual Camera";
exec = "${pkgs.writeScript "andcam" ''
${pkgs.android-tools}/bin/adb start-server
${pkgs.scrcpy}/bin/scrcpy --camera-id=0 --video-source=camera --no-audio --v4l2-sink=/dev/video0 -m1024
''}";
};
home.stateVersion = "24.11";
};
system.stateVersion = "24.11";
}

View File

@@ -1,32 +1,48 @@
# 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, ... }:
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.availableKernelModules = [
"xhci_pci"
"ahci"
"nvme"
"usb_storage"
"usbhid"
"sd_mod"
];
boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/69528c2b-4fe1-4ff8-a77b-2fc000669629";
fsType = "ext4";
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/69528c2b-4fe1-4ff8-a77b-2fc000669629";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/139D-6775";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices =
[ { device = "/dev/disk/by-uuid/aafdb506-7d0b-40ef-b87a-c14c39688b76"; }
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/139D-6775";
fsType = "vfat";
options = [
"fmask=0077"
"dmask=0077"
];
};
swapDevices = [
{ device = "/dev/disk/by-uuid/aafdb506-7d0b-40ef-b87a-c14c39688b76"; }
];
# 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

View File

@@ -1,199 +0,0 @@
{ pkgs, lib, ... }:
{
environment.sessionVariables.NIXOS_OZONE_WL = "1";
fonts.packages = with pkgs; [
jetbrains-mono
];
services = {
xserver = {
enable = true;
displayManager.gdm.enable = true;
desktopManager.gnome = {
enable = true;
};
excludePackages = [ pkgs.xterm ];
};
pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
printing.enable = true;
resolved.enable = true;
mullvad-vpn = {
enable = true;
package = pkgs.mullvad-vpn;
};
};
environment.gnome.excludePackages = with pkgs; [
gnome-tour
gnome-connections
geary
evince
gnome-contacts
gnome-maps
gnome-music
snapshot
simple-scan
];
users = {
mutableUsers = false;
users = {
root.hashedPassword = "$y$j9T$gdQiD91dRc1rEURkntnkh1$9VvI8xhvCMqhSSOeOkiSnjHsQVUOOH/4Sbou.w6P5TC";
thiloho = {
isNormalUser = true;
extraGroups = [
"wheel"
"networkmanager"
"docker"
];
hashedPassword = "$y$j9T$0wgXXBJMy5lzuwmdvx5Lb.$G5JmfDXeXzH7sq66R.clvmlovuh1ZsZMf1SfDsWpNcB";
};
};
};
networking.firewall = {
allowedTCPPorts = [ 53317 ];
allowedUDPPorts = [ 53317 ];
};
programs = {
dconf.enable = true;
steam.enable = true;
gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
java.enable = true;
nix-ld = {
enable = true;
libraries = with pkgs; [
nodejs
nodePackages.pnpm
];
};
};
services.pulseaudio.enable = false;
hardware.bluetooth.enable = true;
home-manager.users.thiloho =
{
pkgs,
lib,
config,
...
}:
{
dconf.settings = {
"org/gnome/mutter" = {
experimental-features = [
"scale-monitor-framebuffer"
"variable-refresh-rate"
"xwayland-native-scaling"
];
};
};
programs = {
yt-dlp = {
enable = true;
};
firefox = {
enable = true;
package = pkgs.firefox-devedition.override {
cfg = {
speechSynthesisSupport = true;
};
};
};
chromium = {
enable = true;
package = pkgs.ungoogled-chromium;
};
vscode = {
enable = true;
package = pkgs.vscodium;
mutableExtensionsDir = false;
extensions =
with pkgs.vscode-extensions;
[
# svelte.svelte-vscode
jnoortheen.nix-ide
ritwickdey.liveserver
esbenp.prettier-vscode
]
++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
{
name = "svelte-vscode";
publisher = "svelte";
version = "108.5.4";
sha256 = "0sjq5ifnz08pkxslzz2qnrc76gvl6lkygcr3042safbvfral4xm1";
}
{
name = "playwright";
publisher = "ms-playwright";
version = "1.1.10";
sha256 = "0y0jlrxpjzd7drdmcr9kfy5g12zax9q4d8cblzzb6ia4c98ipfq0";
}
];
userSettings = {
"editor.wordWrap" = "on";
"editor.fontFamily" = "JetBrains Mono";
"editor.fontLigatures" = true;
"editor.indentSize" = 2;
"editor.tabSize" = 2;
"typescript.preferences.importModuleSpecifier" = "relative";
"[svelte]" = {
"editor.defaultFormatter" = "svelte.svelte-vscode";
};
"svelte.enable-ts-plugin" = true;
"svelte.plugin.svelte.defaultScriptLanguage" = "ts";
"svelte.plugin.svelte.format.config.svelteStrictMode" = true;
};
};
git = {
enable = true;
userName = "thiloho";
userEmail = "123883702+thiloho@users.noreply.github.com";
signing = {
signByDefault = true;
};
};
direnv = {
enable = true;
enableBashIntegration = true;
nix-direnv.enable = true;
};
obs-studio.enable = true;
};
home = {
packages = with pkgs; [
tldr
ventoy-full
qbittorrent
neofetch
backblaze-b2
localsend
postman
gnome-tweaks
gnome-themes-extra
melonDS
prismlauncher
papers
endeavour
gapless
mullvad-browser
picocrypt-cli
tutanota-desktop
];
};
};
}

View File

@@ -1,43 +0,0 @@
{ pkgs, ... }:
{
boot = {
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
kernelPackages = pkgs.linuxPackages_latest;
};
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
time.timeZone = "Europe/Berlin";
nixpkgs.config.allowUnfree = true;
networking.networkmanager.enable = true;
virtualisation.docker.enable = true;
home-manager.users.thiloho =
{ ... }:
{
programs = {
bash = {
enable = true;
shellAliases = {
rbs = "sudo nixos-rebuild switch --flake .";
cleanup = "nix store optimise && nix-collect-garbage -d && sudo nix store optimise && sudo nix-collect-garbage -d";
};
};
helix = {
enable = true;
defaultEditor = true;
settings.theme = "ayu_dark";
};
};
};
}