From 117c9c188b25b7ba029d10dcead853b47d08df06 Mon Sep 17 00:00:00 2001 From: thiloho <123883702+thiloho@users.noreply.github.com> Date: Wed, 7 Aug 2024 11:31:13 +0200 Subject: [PATCH] Update config --- flake.nix | 47 +++-- nixos-configurations/laptop/default.nix | 12 +- .../laptop/hardware-configuration.nix | 44 +++-- nixos-configurations/pc/default.nix | 28 ++- .../pc/hardware-configuration.nix | 46 +++-- nixos-configurations/shared-desktop.nix | 185 +++++++++++------- nixos-configurations/shared.nix | 34 ++-- 7 files changed, 238 insertions(+), 158 deletions(-) diff --git a/flake.nix b/flake.nix index 411c60c..8d19912 100644 --- a/flake.nix +++ b/flake.nix @@ -10,27 +10,34 @@ }; }; - outputs = inputs@{ nixpkgs, home-manager, ... }: { - nixosConfigurations = let - mkSystem = entrypoint: - nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { inherit inputs; }; - modules = [ - entrypoint - { nix.registry.nixpkgs.flake = nixpkgs; } - home-manager.nixosModules.home-manager - { - home-manager = { - useGlobalPkgs = true; - useUserPackages = true; + outputs = + inputs@{ nixpkgs, home-manager, ... }: + { + nixosConfigurations = + let + mkSystem = + entrypoint: + nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { + inherit inputs; }; - } - ]; + modules = [ + entrypoint + { nix.registry.nixpkgs.flake = nixpkgs; } + home-manager.nixosModules.home-manager + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + }; + } + ]; + }; + in + { + pc = mkSystem ./nixos-configurations/pc; + laptop = mkSystem ./nixos-configurations/laptop; }; - in { - pc = mkSystem ./nixos-configurations/pc; - laptop = mkSystem ./nixos-configurations/laptop; }; - }; } diff --git a/nixos-configurations/laptop/default.nix b/nixos-configurations/laptop/default.nix index 4de9852..fe78bbc 100644 --- a/nixos-configurations/laptop/default.nix +++ b/nixos-configurations/laptop/default.nix @@ -15,9 +15,13 @@ package = pkgs.mariadb; }; - home-manager.users.thiloho = { pkgs, ... }: { - programs.git.signing.key = "5CF074CA31DD6686"; - home = { stateVersion = "23.05"; }; - }; + home-manager.users.thiloho = + { pkgs, ... }: + { + programs.git.signing.key = "5CF074CA31DD6686"; + home = { + stateVersion = "23.05"; + }; + }; system.stateVersion = "23.05"; } diff --git a/nixos-configurations/laptop/hardware-configuration.nix b/nixos-configurations/laptop/hardware-configuration.nix index edc3bf1..8e53846 100644 --- a/nixos-configurations/laptop/hardware-configuration.nix +++ b/nixos-configurations/laptop/hardware-configuration.nix @@ -1,32 +1,42 @@ # 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" "usb_storage" "sd_mod" ]; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "nvme" + "usb_storage" + "sd_mod" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/fb24df9f-cd78-47ad-ad14-39cf9befa557"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/fb24df9f-cd78-47ad-ad14-39cf9befa557"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/EBB7-9D7A"; - fsType = "vfat"; - options = [ "fmask=0022" "dmask=0022" ]; - }; - - swapDevices = - [ { device = "/dev/disk/by-uuid/8f51c241-0b76-4a7c-88e3-5cbde2d4237a"; } + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/EBB7-9D7A"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" ]; + }; + + swapDevices = [ { device = "/dev/disk/by-uuid/8f51c241-0b76-4a7c-88e3-5cbde2d4237a"; } ]; # 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 diff --git a/nixos-configurations/pc/default.nix b/nixos-configurations/pc/default.nix index 5edd23f..cb1aeaa 100644 --- a/nixos-configurations/pc/default.nix +++ b/nixos-configurations/pc/default.nix @@ -12,8 +12,14 @@ networking = { hostName = "pc"; firewall = { - allowedTCPPorts = [ 5173 8081 ]; - allowedUDPPorts = [ 5173 8081 ]; + allowedTCPPorts = [ + 5173 + 8081 + ]; + allowedUDPPorts = [ + 5173 + 8081 + ]; }; }; @@ -55,13 +61,17 @@ ''}" ]; - home-manager.users.thiloho = { pkgs, lib, ... }: { - programs.git.signing.key = "5ECD00BDC15A987E"; - home = { - packages = with pkgs; [ blender inkscape ]; - stateVersion = "23.05"; + home-manager.users.thiloho = + { pkgs, lib, ... }: + { + programs.git.signing.key = "5FED02C109365F87"; + home = { + packages = with pkgs; [ + blender + inkscape + ]; + stateVersion = "23.05"; + }; }; - }; system.stateVersion = "23.05"; } - diff --git a/nixos-configurations/pc/hardware-configuration.nix b/nixos-configurations/pc/hardware-configuration.nix index ce5115c..b6f7c60 100644 --- a/nixos-configurations/pc/hardware-configuration.nix +++ b/nixos-configurations/pc/hardware-configuration.nix @@ -1,32 +1,44 @@ # 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 = [ ]; boot.kernelModules = [ "kvm-amd" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/9e4f1090-bb46-4fd8-9a2d-e053c08af7d0"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/9e4f1090-bb46-4fd8-9a2d-e053c08af7d0"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/D4D5-F5A5"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; - - swapDevices = - [ { device = "/dev/disk/by-uuid/54590048-bdf2-4faa-8176-f6e1d582c357"; } + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/D4D5-F5A5"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" ]; + }; + + swapDevices = [ { device = "/dev/disk/by-uuid/54590048-bdf2-4faa-8176-f6e1d582c357"; } ]; # 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 diff --git a/nixos-configurations/shared-desktop.nix b/nixos-configurations/shared-desktop.nix index 205c18a..76d49f6 100644 --- a/nixos-configurations/shared-desktop.nix +++ b/nixos-configurations/shared-desktop.nix @@ -40,19 +40,39 @@ }; }; + environment.gnome.excludePackages = with pkgs; [ + # for packages that are pkgs.* + gnome-tour + gnome-connections + epiphany + geary + evince + gnome-calendar + gnome.gnome-contacts + gnome.gnome-weather + gnome.gnome-maps + gnome.gnome-clocks + gnome.gnome-music + snapshot + simple-scan + ]; + users = { mutableUsers = false; users = { root.hashedPassword = "$y$j9T$BfX6ErL64B97Ug1ZrH1GN.$cK/3FlWSDJ99wpbbwu3hBAPX0jGew/zfJhQKf7/OQ12"; thiloho = { isNormalUser = true; - extraGroups = [ "wheel" "networkmanager" "docker" ]; + extraGroups = [ + "wheel" + "networkmanager" + "docker" + ]; hashedPassword = "$y$j9T$PmPi.Ji1jDw5rBaKCRepp/$LJLuvnFXiG/8jomOPVwv31R/tKgUmp.W2mKdo08FUK3"; }; }; }; - networking.firewall = { allowedTCPPorts = [ 53317 ]; allowedUDPPorts = [ 53317 ]; @@ -78,84 +98,97 @@ hardware.bluetooth.enable = true; - home-manager.users.thiloho = { pkgs, lib, config, ... }: { - programs = { - yt-dlp = { - enable = true; - }; - firefox = { - enable = true; - package = pkgs.firefox-devedition.override { - cfg = { speechSynthesisSupport = true; }; + home-manager.users.thiloho = + { + pkgs, + lib, + config, + ... + }: + { + programs = { + yt-dlp = { + enable = 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"; - } - ]; - userSettings = { - "nix.enableLanguageServer" = true; - "nix.serverPath" = "nil"; - "editor.indentSize" = 2; - "editor.tabSize" = 2; - "typescript.preferences.importModuleSpecifier" = "relative"; - "[svelte]" = { - "editor.defaultFormatter" = "svelte.svelte-vscode"; + firefox = { + enable = true; + package = pkgs.firefox-devedition.override { + cfg = { + speechSynthesisSupport = true; + }; }; - "svelte.enable-ts-plugin" = true; - "svelte.plugin.svelte.defaultScriptLanguage" = "ts"; - "svelte.plugin.svelte.format.config.svelteStrictMode" = 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"; + } + ]; + userSettings = { + "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; }; - git = { - enable = true; - userName = "thiloho"; - userEmail = "123883702+thiloho@users.noreply.github.com"; - signing = { signByDefault = true; }; + home = { + sessionVariables = { + NIXOS_OZONE_WL = 1; + }; + packages = with pkgs; [ + tldr + prismlauncher + ventoy-full + psensor + zoom-us + qbittorrent + neofetch + backblaze-b2 + localsend + postman + gnome-tweaks + gnome-themes-extra + melonDS + amberol + ]; }; - direnv = { - enable = true; - enableBashIntegration = true; - nix-direnv.enable = true; - }; - obs-studio.enable = true; }; - home = { - sessionVariables = { NIXOS_OZONE_WL = 1; }; - packages = with pkgs; [ - tldr - prismlauncher - ventoy-full - psensor - nil - zoom-us - qbittorrent - neofetch - backblaze-b2 - localsend - postman - gnome-tweaks - gnome-themes-extra - melonDS - ]; - }; - }; } diff --git a/nixos-configurations/shared.nix b/nixos-configurations/shared.nix index b7b3d0e..b7ac64a 100644 --- a/nixos-configurations/shared.nix +++ b/nixos-configurations/shared.nix @@ -9,7 +9,10 @@ kernelPackages = pkgs.linuxPackages_latest; }; - nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; time.timeZone = "Europe/Amsterdam"; @@ -19,21 +22,22 @@ 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"; + 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"; }; }; - helix = { - enable = true; - defaultEditor = true; - settings.theme = "ayu_dark"; - }; }; - }; }