diff --git a/flake.nix b/flake.nix index 8b3b690..0096a20 100644 --- a/flake.nix +++ b/flake.nix @@ -63,23 +63,66 @@ }: let devices = { - vinzenz-lpt2 = "x86_64-linux"; - vinzenz-pc2 = "x86_64-linux"; - ronja-pc = "x86_64-linux"; - hetzner-vpn2 = "aarch64-linux"; - forgejo-runner-1 = "aarch64-linux"; + vinzenz-lpt2 = { + system = "x86_64-linux"; + additional-modules = [ + self.nixosModules.user-vinzenz + + self.nixosModules.gnome + self.nixosModules.wine-gaming + self.nixosModules.steam + self.nixosModules.printing + self.nixosModules.podman + self.nixosModules.vinzenz-desktop-settings + self.nixosModules.intel-graphics + ]; + home-manager-users = { + inherit (self.homeConfigurations) vinzenz; + }; + }; + vinzenz-pc2 = { + system = "x86_64-linux"; + additional-modules = [ + self.nixosModules.user-vinzenz + self.nixosModules.user-ronja + + self.nixosModules.gnome + self.nixosModules.wine-gaming + self.nixosModules.steam + self.nixosModules.printing + self.nixosModules.podman + self.nixosModules.vinzenz-desktop-settings + self.nixosModules.amd-graphics + ]; + home-manager-users = { + inherit (self.homeConfigurations) vinzenz ronja; + }; + }; + ronja-pc = { + system = "x86_64-linux"; + additional-modules = [ + self.nixosModules.user-ronja + + self.nixosModules.gnome + self.nixosModules.steam + self.nixosModules.wine-gaming + self.nixosModules.vinzenz-desktop-settings + ]; + home-manager-users = { + inherit (self.homeConfigurations) ronja; + }; + }; + hetzner-vpn2 = { + system = "aarch64-linux"; + }; + forgejo-runner-1 = { + system = "aarch64-linux"; + additional-modules = [ self.nixosModules.podman ]; + }; }; - homeDevices = [ - "vinzenz-lpt2" - "vinzenz-pc2" - "ronja-pc" - ]; lib = nixpkgs.lib; - forDevice = f: lib.mapAttrs f devices; - supported-systems = [ - "x86_64-linux" - "aarch64-linux" - ]; + forDevice = f: lib.mapAttrs (device: value: f (value // { inherit device; })) devices; + supported-systems = lib.attrsets.mapAttrsToList (k: v: v.system) devices; forAllSystems = f: lib.genAttrs supported-systems ( @@ -101,21 +144,28 @@ }; nixosConfigurations = forDevice ( - device: system: + { + device, + system, + home-manager-users ? { }, + additional-modules ? [ ], + }: let - commonSpecialArgs = { + specialArgs = { inherit device; vinzenzHomeModules = self.homeModules; + vinzenzLib = self.lib; }; in nixpkgs.lib.nixosSystem { - inherit system; - specialArgs = commonSpecialArgs // { - vinzenzNixosModules = self.nixosModules; - }; + inherit system specialArgs; modules = [ { networking.hostName = device; + nixpkgs = { + inherit system; + hostPlatform = lib.mkDefault system; + }; system = { stateVersion = "22.11"; autoUpgrade.flake = "git+https://git.berlin.ccc.de/vinzenz/nixos-configuration.git"; @@ -128,11 +178,18 @@ nix.settings.experimental-features = [ "nix-command" "flakes" + "repl-flake" ]; + + documentation = { + info.enable = false; # info pages and the info command + doc.enable = false; # documentation distributed in packages' /share/doc + }; } ./nixosConfigurations/${device} + self.nixosModules.default self.nixosModules.lix-is-nix self.nixosModules.globalinstalls self.nixosModules.autoupdate @@ -140,14 +197,14 @@ self.nixosModules.tailscale self.nixosModules.allowed-unfree-list self.nixosModules.extra-caches - ./modules/nixpkgs.nix + self.nixosModules.systemd-boot zerforschen-plus.nixosModules.default ] - ++ (nixpkgs.lib.optionals (builtins.elem device homeDevices) [ + ++ (nixpkgs.lib.optionals (home-manager-users != { }) [ { home-manager = { - extraSpecialArgs = commonSpecialArgs; + extraSpecialArgs = specialArgs; useGlobalPkgs = true; useUserPackages = true; }; @@ -161,7 +218,10 @@ self.homeModules.templates self.homeModules.zsh-basics self.homeModules.nano + self.homeModules.gnome-extensions ]; + + home-manager.users = home-manager-users; } self.nixosModules.pkgs-unstable @@ -172,11 +232,14 @@ self.nixosModules.gnome self.nixosModules.modern-desktop self.nixosModules.nix-ld + self.nixosModules.quiet-boot + self.nixosModules.firmware-updates home-manager.nixosModules.home-manager servicepoint-simulator.nixosModules.default servicepoint-cli.nixosModules.default - ]); + ]) + ++ additional-modules; } ); @@ -200,9 +263,14 @@ pkgs-vscode-extensions = { nixpkgs.overlays = [ nix-vscode-extensions.overlays.default ]; }; + # required modules to use other modules, should not do anything on their own + default = { + imports = [ self.nixosModules.allowed-unfree-list ]; + }; }; homeModules = self.lib.importDir ./homeModules; + homeConfigurations = self.lib.importDir ./homeConfigurations; formatter = forAllSystems ({ pkgs, ... }: pkgs.nixfmt-tree); }; diff --git a/home/ronja/default.nix b/home/ronja/default.nix deleted file mode 100644 index 7c2f96d..0000000 --- a/home/ronja/default.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ pkgs, ... }: -{ - config = { - # Define user account - users.users.ronja = { - isNormalUser = true; - name = "ronja"; - description = "Ronja"; - home = "/home/ronja"; - extraGroups = [ - "networkmanager" - "wheel" - "games" - "podman" - "openvscode-server" - ]; - shell = pkgs.zsh; - }; - - home-manager.users.ronja.imports = [ - ./configuration.nix - ./vscode.nix - ]; - }; -} diff --git a/home/vinzenz/default.nix b/home/vinzenz/default.nix deleted file mode 100644 index e555eba..0000000 --- a/home/vinzenz/default.nix +++ /dev/null @@ -1,51 +0,0 @@ -{ pkgs, ... }: -{ - config = { - users.users.vinzenz = { - isNormalUser = true; - name = "vinzenz"; - description = "Vinzenz"; - home = "/home/vinzenz"; - extraGroups = [ - "networkmanager" - "wheel" - "games" - "dialout" - "podman" - "nginx" - "adbusers" - "kvm" - "input" - "video" - ]; - shell = pkgs.zsh; - autoSubUidGidRange = true; - }; - - nix.settings.trusted-users = [ "vinzenz" ]; - - home-manager.users.vinzenz.imports = [ - ./configuration.nix - ./editorconfig.nix - ./fuzzel.nix - ./git.nix - ./gnome.nix - #./niri.nix - ./ssh.nix - ./swaylock.nix - ./vscode.nix - ./waybar.nix - ./zsh.nix - ]; - - allowedUnfreePackages = [ - "rider" - "pycharm-professional" - "jetbrains-toolbox" - - "anydesk" - - "vscode-extension-ms-dotnettools-csharp" - ]; - }; -} diff --git a/home/vinzenz/gnome.nix b/home/vinzenz/gnome.nix deleted file mode 100644 index 3a4f479..0000000 --- a/home/vinzenz/gnome.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ pkgs, ... }: -{ - config = { - home.packages = - with pkgs.gnomeExtensions; - [ - # battery-health-charging - quick-settings-tweaker - solaar-extension - alphabetical-app-grid - ] - ++ (with pkgs; [ foliate ]); - - dconf.settings = { - "org/gnome/shell" = { - enabled-extensions = [ - "GPaste@gnome-shell-extensions.gnome.org" - "solaar-extension@sidevesh" - "AlphabeticalAppGrid@stuarthayhurst" - ]; - }; - }; - }; -} diff --git a/home/ronja/configuration.nix b/homeConfigurations/ronja/default.nix similarity index 98% rename from home/ronja/configuration.nix rename to homeConfigurations/ronja/default.nix index 26cceac..0f202cd 100644 --- a/home/ronja/configuration.nix +++ b/homeConfigurations/ronja/default.nix @@ -1,5 +1,6 @@ { config, pkgs, ... }: { + imports = [ ./vscode.nix ]; config = { home.packages = with pkgs; [ ## Apps diff --git a/home/ronja/vscode.nix b/homeConfigurations/ronja/vscode.nix similarity index 100% rename from home/ronja/vscode.nix rename to homeConfigurations/ronja/vscode.nix diff --git a/home/vinzenz/.config/containers/policy.json b/homeConfigurations/vinzenz/.config/containers/policy.json similarity index 100% rename from home/vinzenz/.config/containers/policy.json rename to homeConfigurations/vinzenz/.config/containers/policy.json diff --git a/home/vinzenz/.zsh/p10k.zsh b/homeConfigurations/vinzenz/.zsh/p10k.zsh similarity index 100% rename from home/vinzenz/.zsh/p10k.zsh rename to homeConfigurations/vinzenz/.zsh/p10k.zsh diff --git a/home/vinzenz/configuration.nix b/homeConfigurations/vinzenz/configuration.nix similarity index 97% rename from home/vinzenz/configuration.nix rename to homeConfigurations/vinzenz/configuration.nix index 74be21f..ace8086 100644 --- a/home/vinzenz/configuration.nix +++ b/homeConfigurations/vinzenz/configuration.nix @@ -56,6 +56,10 @@ icu nextcloud-client + + lutris + + foliate ]; home.file = { diff --git a/homeConfigurations/vinzenz/default.nix b/homeConfigurations/vinzenz/default.nix new file mode 100644 index 0000000..33cfceb --- /dev/null +++ b/homeConfigurations/vinzenz/default.nix @@ -0,0 +1,15 @@ +{ + imports = [ + ./configuration.nix + ./editorconfig.nix + ./fuzzel.nix + ./git.nix + ./gnome.nix + #./niri.nix + ./ssh.nix + ./swaylock.nix + ./vscode.nix + ./waybar.nix + ./zsh.nix + ]; +} diff --git a/home/vinzenz/editorconfig.nix b/homeConfigurations/vinzenz/editorconfig.nix similarity index 100% rename from home/vinzenz/editorconfig.nix rename to homeConfigurations/vinzenz/editorconfig.nix diff --git a/home/vinzenz/fuzzel.nix b/homeConfigurations/vinzenz/fuzzel.nix similarity index 100% rename from home/vinzenz/fuzzel.nix rename to homeConfigurations/vinzenz/fuzzel.nix diff --git a/home/vinzenz/git.nix b/homeConfigurations/vinzenz/git.nix similarity index 100% rename from home/vinzenz/git.nix rename to homeConfigurations/vinzenz/git.nix diff --git a/homeConfigurations/vinzenz/gnome.nix b/homeConfigurations/vinzenz/gnome.nix new file mode 100644 index 0000000..7424363 --- /dev/null +++ b/homeConfigurations/vinzenz/gnome.nix @@ -0,0 +1,31 @@ +{ pkgs, ... }: +{ + config = { + home.packages = with pkgs; [ + gitg + meld + simple-scan + pinta + dconf-editor + impression # usb image writer + papers # pdf viewer + gnome-software # for flatpak apps + gnomeExtensions.solaar-extension + snapshot + ]; + + dconf.settings = { + "org/gnome/shell".enabled-extensions = [ + "GPaste@gnome-shell-extensions.gnome.org" + "solaar-extension@sidevesh" + ]; + "org/gnome/desktop/interface".color-scheme = "prefer-dark"; + "org/gnome/desktop/wm/keybindings" = { + switch-windows = [ "Tab" ]; + switch-windows-backward = [ "Tab" ]; + switch-applications = [ "Tab" ]; + switch-applications-backward = [ "Tab" ]; + }; + }; + }; +} diff --git a/home/vinzenz/niri.nix b/homeConfigurations/vinzenz/niri.nix similarity index 100% rename from home/vinzenz/niri.nix rename to homeConfigurations/vinzenz/niri.nix diff --git a/home/vinzenz/ssh.nix b/homeConfigurations/vinzenz/ssh.nix similarity index 100% rename from home/vinzenz/ssh.nix rename to homeConfigurations/vinzenz/ssh.nix diff --git a/home/vinzenz/swaylock.nix b/homeConfigurations/vinzenz/swaylock.nix similarity index 100% rename from home/vinzenz/swaylock.nix rename to homeConfigurations/vinzenz/swaylock.nix diff --git a/home/vinzenz/vscode.nix b/homeConfigurations/vinzenz/vscode.nix similarity index 100% rename from home/vinzenz/vscode.nix rename to homeConfigurations/vinzenz/vscode.nix diff --git a/home/vinzenz/waybar.nix b/homeConfigurations/vinzenz/waybar.nix similarity index 100% rename from home/vinzenz/waybar.nix rename to homeConfigurations/vinzenz/waybar.nix diff --git a/home/vinzenz/zsh.nix b/homeConfigurations/vinzenz/zsh.nix similarity index 100% rename from home/vinzenz/zsh.nix rename to homeConfigurations/vinzenz/zsh.nix diff --git a/homeModules/gnome-extensions.nix b/homeModules/gnome-extensions.nix new file mode 100644 index 0000000..9c30c40 --- /dev/null +++ b/homeModules/gnome-extensions.nix @@ -0,0 +1,101 @@ +{ + lib, + pkgs, + osConfig, + config, + ... +}: +{ + options.vinzenz.gnome-extensions = + let + mkDefaultEnabledOption = + name: + lib.mkOption { + default = true; + example = false; + description = "Whether to enable ${name}."; + type = lib.types.bool; + }; + in + { + enable = mkDefaultEnabledOption "gnome extended options"; + appindicator.enable = mkDefaultEnabledOption "appindicator"; + caffeine.enable = mkDefaultEnabledOption "caffeine"; + tailscale-qs.enable = lib.mkOption { + default = osConfig.services.tailscale.enable; + example = true; + description = "Whether to enable tailscale quick setting."; + type = lib.types.bool; + }; + alphabetic-apps.enable = mkDefaultEnabledOption "alphabetic app grid"; + clock-show-seconds = mkDefaultEnabledOption "clock seconds"; + show-battery-percentage = mkDefaultEnabledOption "battery percentage"; + enable-numlock = mkDefaultEnabledOption "num lock on login"; + enable-systool-warning = lib.mkEnableOption "system configuration tool warning"; + edge-tiling = mkDefaultEnabledOption "edge tiling"; + dynamic-workspaces = mkDefaultEnabledOption "dynamic workspaces"; + tap-to-click = mkDefaultEnabledOption "tap to click"; + two-finger-scrolling = mkDefaultEnabledOption "two finger scrolling"; + }; + + config = + let + cfg = config.vinzenz.gnome-extensions; + in + lib.mkIf cfg.enable ( + lib.mkMerge [ + { + dconf = { + enable = true; + settings = { + "org/gnome/shell" = { + disable-user-extensions = false; + disabled-extensions = [ ]; + enabled-extensions = [ ]; + }; + + "ca/desrt/dconf-editor".show-warning = cfg.enable-systool-warning; + "org/gnome/tweaks".show-extensions-notice = cfg.enable-systool-warning; + "org/gnome/mutter" = { + inherit (cfg) edge-tiling dynamic-workspaces; + }; + "org/gnome/desktop/peripherals/touchpad" = { + inherit (cfg) tap-to-click; + two-finger-scrolling-enabled = cfg.two-finger-scrolling; + }; + "org/gnome/desktop/interface" = { + inherit (cfg) clock-show-seconds show-battery-percentage; + }; + }; + }; + } + + (lib.mkIf cfg.tailscale-qs.enable { + home.packages = [ pkgs.gnomeExtensions.tailscale-qs ]; + dconf.settings."org/gnome/shell".enabled-extensions = [ "tailscale@joaophi.github.com" ]; + }) + + (lib.mkIf cfg.appindicator.enable { + home.packages = [ pkgs.gnomeExtensions.appindicator ]; + dconf.settings."org/gnome/shell".enabled-extensions = [ "appindicatorsupport@rgcjonas.gmail.com" ]; + }) + + (lib.mkIf cfg.caffeine.enable { + home.packages = [ pkgs.gnomeExtensions.caffeine ]; + dconf.settings."org/gnome/shell".enabled-extensions = [ "caffeine@patapon.info" ]; + }) + + (lib.mkIf cfg.alphabetic-apps.enable { + home.packages = [ pkgs.gnomeExtensions.alphabetical-app-grid ]; + dconf.settings = { + "org/gnome/shell".enabled-extensions = [ "AlphabeticalAppGrid@stuarthayhurst" ]; + "org/gnome/shell/extensions/alphabetical-app-grid".folder-order-position = "start"; + }; + }) + + (lib.mkIf cfg.enable-numlock { + dconf.settings."org/gnome/desktop/peripherals/keyboard".numlock-state = true; + }) + ] + ); +} diff --git a/hooks/pre-commit b/hooks/pre-commit new file mode 100755 index 0000000..6b6b870 --- /dev/null +++ b/hooks/pre-commit @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -euxo pipefail + +nix fmt + +nix flake check --all-systems --show-trace diff --git a/modules/amd-graphics.nix b/modules/amd-graphics.nix deleted file mode 100644 index 041d700..0000000 --- a/modules/amd-graphics.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ pkgs, config, ... }: -{ - config = { - boot.kernelModules = [ "amdgpu" ]; - services.xserver.videoDrivers = [ "amdgpu" ]; - - hardware = { - graphics.enable = true; - amdgpu = { - opencl.enable = true; - amdvlk = { - # TODO: this creates black borders around GNOME apps - # enable = true; - # support32Bit.enable = config.hardware.graphics.enable32Bit; - }; - overdrive.enable = true; - }; - }; - - environment.systemPackages = with pkgs; [ nvtopPackages.amd ]; - }; -} diff --git a/modules/desktop-environment.nix b/modules/desktop-environment.nix deleted file mode 100644 index e839353..0000000 --- a/modules/desktop-environment.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ pkgs, ... }: -{ - config = { - programs.firefox.enable = true; - - environment.systemPackages = with pkgs; [ - lm_sensors - - # office - #libreoffice-qt - #hunspell - #hunspellDicts.de-de - #hunspellDicts.en-us-large - ]; - - fonts = { - enableDefaultPackages = true; - fontconfig.defaultFonts.monospace = [ "FiraCode Nerd Font" ]; - packages = with pkgs; [ - nerd-fonts.fira-code - roboto-mono - recursive - ]; - }; - - hardware.logitech.wireless = { - enable = true; - enableGraphical = true; - }; - }; -} diff --git a/modules/desktop-hardware.nix b/modules/desktop-hardware.nix deleted file mode 100644 index a8b2f93..0000000 --- a/modules/desktop-hardware.nix +++ /dev/null @@ -1,48 +0,0 @@ -{ - lib, - pkgs, - ... -}: -{ - config = { - boot = { - kernelPackages = pkgs.linuxPackages_zen; - kernelParams = [ - "quiet" - "udev.log_level=3" - ]; - supportedFilesystems = [ "btrfs" ]; - initrd.supportedFilesystems = [ "btrfs" ]; - consoleLogLevel = 0; - initrd.verbose = false; - plymouth.enable = true; - loader = { - timeout = 3; - efi.canTouchEfiVariables = true; - systemd-boot = { - enable = true; - editor = false; # do not allow changing kernel parameters - consoleMode = "max"; - }; - }; - }; - - networking.networkmanager.enable = true; - # 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 - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.eno1.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true; - - hardware = { - enableRedistributableFirmware = true; - bluetooth.enable = true; - }; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - - services.fwupd.enable = true; - }; -} diff --git a/modules/gaming.nix b/modules/gaming.nix deleted file mode 100644 index 478c200..0000000 --- a/modules/gaming.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ pkgs, ... }: -{ - config = { - hardware = { - graphics = { - enable32Bit = true; - extraPackages = with pkgs; [ mangohud ]; - extraPackages32 = with pkgs; [ mangohud ]; - }; - - xpadneo.enable = true; - }; - - environment.systemPackages = with pkgs; [ - wineWowPackages.stagingFull - wineWowPackages.fonts - winetricks - dxvk - mangohud - vulkan-tools - glxinfo - lutris - ]; - - networking.firewall.allowedUDPPorts = [ - # Factorio - 34197 - ]; - }; -} diff --git a/modules/gnome-shared-dconf.nix b/modules/gnome-shared-dconf.nix deleted file mode 100644 index 5d54628..0000000 --- a/modules/gnome-shared-dconf.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ - "org/gnome/desktop/interface" = { - color-scheme = "prefer-dark"; - clock-show-seconds = true; - show-battery-percentage = true; - }; - "org/gnome/mutter" = { - edge-tiling = true; - dynamic-workspaces = true; - }; - "org/gnome/desktop/peripherals/keyboard" = { - numlock-state = true; - }; - "org/gnome/desktop/peripherals/touchpad" = { - tap-to-click = true; - two-finger-scrolling-enabled = true; - }; - "org/gnome/tweaks" = { - show-extensions-notice = false; - }; - "org/gnome/shell" = { - disable-user-extensions = false; - disabled-extensions = [ ]; - enabled-extensions = [ - "tailscale@joaophi.github.com" - "appindicatorsupport@rgcjonas.gmail.com" - "workspace-indicator@gnome-shell-extensions.gcampax.github.com" - "caffeine@patapon.info" - ]; - }; - "ca/desrt/dconf-editor" = { - show-warning = false; - }; - "org/gnome/desktop/wm/keybindings" = { - switch-windows = [ "Tab" ]; - switch-windows-backward = [ "Tab" ]; - switch-applications = [ "Tab" ]; - switch-applications-backward = [ "Tab" ]; - }; - "org/gnome/shell/extensions/alphabetical-app-grid" = { - folder-order-position = "start"; - }; -} diff --git a/modules/gnome.nix b/modules/gnome.nix deleted file mode 100644 index 507247d..0000000 --- a/modules/gnome.nix +++ /dev/null @@ -1,61 +0,0 @@ -{ pkgs, ... }: -{ - config = { - # remove some gnome default apps - environment.gnome.excludePackages = with pkgs; [ - cheese # photo booth - epiphany # web browser - evince # document viewer - geary # email client - gnome-maps - gnome-weather - gnome-tour - sysprof - orca # screen reader - gnome-weather - gnome-backgrounds - gnome-user-docs - yelp # help app - # gnome-music - # totem # video player - # snapshot # camera - # baobab # disk usage - ]; - - # RDP connections - services.gnome.gnome-remote-desktop.enable = true; - networking.firewall.allowedTCPPorts = [ 3389 ]; - - home-manager.sharedModules = [ - { - home.packages = - with pkgs; - [ - gitg - meld - simple-scan - pinta - dconf-editor - gpaste - ghex - impression - papers - - # graphical installer for flatpak apps - gnome-software - ] - ++ (with gnomeExtensions; [ - caffeine - appindicator - ]); - - dconf.settings = import ./gnome-shared-dconf.nix; - } - - { - home.packages = with pkgs; [ trayscale ] ++ (with gnomeExtensions; [ tailscale-qs ]); - dconf.settings."org/gnome/shell".enabled-extensions = [ "tailscale@joaophi.github.com" ]; - } - ]; - }; -} diff --git a/modules/nixpkgs.nix b/modules/nixpkgs.nix deleted file mode 100644 index 7fb99a7..0000000 --- a/modules/nixpkgs.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - documentation = { - enable = true; # documentation of packages - nixos.enable = false; # nixos documentation - man.enable = true; # manual pages and the man command - info.enable = false; # info pages and the info command - doc.enable = false; # documentation distributed in packages' /share/doc - }; -} diff --git a/nixosConfigurations/forgejo-runner-1/configuration.nix b/nixosConfigurations/forgejo-runner-1/configuration.nix deleted file mode 100644 index 345e622..0000000 --- a/nixosConfigurations/forgejo-runner-1/configuration.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ ... }: -{ - # uncomment for build check on non arm system (requires --impure) - # nixpkgs.buildPlatform = builtins.currentSystem; - services.tailscale.useRoutingFeatures = "both"; - system.autoUpgrade.allowReboot = true; - - users.users = { - root.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' - ]; - }; -} diff --git a/nixosConfigurations/forgejo-runner-1/default.nix b/nixosConfigurations/forgejo-runner-1/default.nix index 79cb613..f9d3c3f 100644 --- a/nixosConfigurations/forgejo-runner-1/default.nix +++ b/nixosConfigurations/forgejo-runner-1/default.nix @@ -1,10 +1,21 @@ -{ vinzenzNixosModules, ... }: { imports = [ - ./configuration.nix ./hardware.nix - - vinzenzNixosModules.podman ./forgejo-runner.nix ]; + + config = { + # uncomment for build check on non arm system (requires --impure) + # nixpkgs.buildPlatform = builtins.currentSystem; + services.tailscale.useRoutingFeatures = "both"; + system.autoUpgrade.allowReboot = true; + + users.users = { + root.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' + ]; + }; + }; } diff --git a/nixosConfigurations/forgejo-runner-1/hardware.nix b/nixosConfigurations/forgejo-runner-1/hardware.nix index e3e6880..e8fbc56 100644 --- a/nixosConfigurations/forgejo-runner-1/hardware.nix +++ b/nixosConfigurations/forgejo-runner-1/hardware.nix @@ -3,11 +3,6 @@ imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; config = { - nixpkgs = { - hostPlatform = "aarch64-linux"; - system = "aarch64-linux"; - }; - boot = { tmp.cleanOnBoot = true; kernelParams = [ "console=tty" ]; diff --git a/nixosConfigurations/hetzner-vpn2/configuration.nix b/nixosConfigurations/hetzner-vpn2/configuration.nix deleted file mode 100644 index 8e16ff7..0000000 --- a/nixosConfigurations/hetzner-vpn2/configuration.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ ... }: -{ - # uncomment for build check on non arm system (requires --impure) - # nixpkgs.buildPlatform = builtins.currentSystem; - - services.tailscale.useRoutingFeatures = "both"; - - users.users = { - root.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' - ]; - #ronja.openssh.authorizedKeys.keys = [ - # ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' - #]; - }; - - system.autoUpgrade.allowReboot = true; -} diff --git a/nixosConfigurations/hetzner-vpn2/default.nix b/nixosConfigurations/hetzner-vpn2/default.nix index 46ded48..591dc20 100644 --- a/nixosConfigurations/hetzner-vpn2/default.nix +++ b/nixosConfigurations/hetzner-vpn2/default.nix @@ -1,7 +1,27 @@ { imports = [ - ./configuration.nix ./hardware.nix ./nginx.nix ]; + + config = { + # uncomment for build check on non arm system (requires --impure) + # nixpkgs.buildPlatform = builtins.currentSystem; + + services.tailscale.useRoutingFeatures = "both"; + + users.users = { + root.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdYqY3Y1/f1bsAi5Qfyr/UWuX9ixu96IeAlhoQaJkbf'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' + ]; + #ronja.openssh.authorizedKeys.keys = [ + # ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' + #]; + }; + + system.autoUpgrade.allowReboot = true; + }; } diff --git a/nixosConfigurations/hetzner-vpn2/hardware.nix b/nixosConfigurations/hetzner-vpn2/hardware.nix index e8fa931..d7c96f0 100644 --- a/nixosConfigurations/hetzner-vpn2/hardware.nix +++ b/nixosConfigurations/hetzner-vpn2/hardware.nix @@ -3,11 +3,6 @@ imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; config = { - nixpkgs = { - hostPlatform = "aarch64-linux"; - system = "aarch64-linux"; - }; - boot = { tmp.cleanOnBoot = true; kernelParams = [ "console=tty" ]; diff --git a/nixosConfigurations/ronja-pc/configuration.nix b/nixosConfigurations/ronja-pc/configuration.nix deleted file mode 100644 index 0e9124d..0000000 --- a/nixosConfigurations/ronja-pc/configuration.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ - config, - pkgs, - ... -}: -{ - # Configure keymap in X11 - services.xserver.xkb = { - layout = "de"; - variant = ""; - }; - - # Configure console keymap - console.keyMap = "de"; - - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. - # wget - ]; - - # Open ports in the firewall. - # networking.firewall.allowedTCPPorts = [ ... ]; - # networking.firewall.allowedUDPPorts = [ ... ]; -} diff --git a/nixosConfigurations/ronja-pc/default.nix b/nixosConfigurations/ronja-pc/default.nix index e0e9117..dd22382 100644 --- a/nixosConfigurations/ronja-pc/default.nix +++ b/nixosConfigurations/ronja-pc/default.nix @@ -1,15 +1,32 @@ -{ vinzenzNixosModules, ... }: +{ + config, + pkgs, + ... +}: { imports = [ - ./configuration.nix ./hardware.nix - - ../../modules/gnome.nix - ../../modules/gaming.nix - vinzenzNixosModules.steam - ../../modules/desktop-environment.nix - ../../modules/desktop-hardware.nix - - ../../home/ronja ]; + + config = { + # Configure keymap in X11 + services.xserver.xkb = { + layout = "de"; + variant = ""; + }; + + # Configure console keymap + console.keyMap = "de"; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + # wget + ]; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ];}; + }; } diff --git a/nixosConfigurations/ronja-pc/hardware.nix b/nixosConfigurations/ronja-pc/hardware.nix index f668726..e6ad854 100644 --- a/nixosConfigurations/ronja-pc/hardware.nix +++ b/nixosConfigurations/ronja-pc/hardware.nix @@ -1,6 +1,8 @@ { lib, ... }: { boot = { + supportedFilesystems = [ "btrfs" ]; + initrd.supportedFilesystems = [ "btrfs" ]; kernelModules = [ "kvm-intel" ]; extraModulePackages = [ ]; initrd = { @@ -37,6 +39,10 @@ { device = "/dev/disk/by-uuid/bf9d19fb-499b-4bfb-b67d-131fa5bf8259"; } ]; - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = true; + hardware.bluetooth.enable = true; + + networking = { + networkmanager.enable = true; + useDHCP = lib.mkDefault true; + }; } diff --git a/nixosConfigurations/vinzenz-lpt2/configuration.nix b/nixosConfigurations/vinzenz-lpt2/configuration.nix deleted file mode 100644 index b38f25a..0000000 --- a/nixosConfigurations/vinzenz-lpt2/configuration.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ ... }: -{ - imports = [ ./nginx.nix ]; - - config = { - nix.settings.extra-platforms = [ - "aarch64-linux" - "i686-linux" - ]; - - services.xserver.xkb = { - # Configure keymap in X11 - layout = "de"; - variant = ""; - }; - - # Configure console keymap - console.keyMap = "de"; - - users.users.vinzenz.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' - ]; - - #users.users.ronja.openssh.authorizedKeys.keys = [ - # ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' - #]; - - programs = { - adb.enable = true; - light = { - enable = true; - brightnessKeys = { - enable = true; - step = 5; - }; - }; - }; - - networking.firewall.allowedTCPPorts = [ - 8776 - 1337 - ]; - }; -} diff --git a/nixosConfigurations/vinzenz-lpt2/default.nix b/nixosConfigurations/vinzenz-lpt2/default.nix index d29ae65..58eac82 100644 --- a/nixosConfigurations/vinzenz-lpt2/default.nix +++ b/nixosConfigurations/vinzenz-lpt2/default.nix @@ -1,18 +1,47 @@ -{ vinzenzNixosModules, ... }: { imports = [ - ./configuration.nix ./hardware.nix - - ../../modules/gnome.nix - ../../modules/gaming.nix - vinzenzNixosModules.steam - vinzenzNixosModules.printing - vinzenzNixosModules.podman - ../../modules/desktop-environment.nix - ../../modules/desktop-hardware.nix - - ../../home/vinzenz - ../../home/ronja + ./nginx.nix ]; + + config = { + nix.settings.extra-platforms = [ + "aarch64-linux" + "i686-linux" + ]; + + services.xserver.xkb = { + # Configure keymap in X11 + layout = "de"; + variant = ""; + }; + + # Configure console keymap + console.keyMap = "de"; + + users.users.vinzenz.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO1CRn4yYTL4XUdCebE8Z4ZeuMujBjorTdWifg911EOv vinzenz-pc2 home roaming'' + ]; + + #users.users.ronja.openssh.authorizedKeys.keys = [ + # ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ronja-ssh-host-key'' + #]; + + programs = { + adb.enable = true; + light = { + enable = true; + brightnessKeys = { + enable = true; + step = 5; + }; + }; + }; + + networking.firewall.allowedTCPPorts = [ + 8776 + 1337 + ]; + }; } diff --git a/nixosConfigurations/vinzenz-lpt2/hardware.nix b/nixosConfigurations/vinzenz-lpt2/hardware.nix index f51ccd1..175a168 100644 --- a/nixosConfigurations/vinzenz-lpt2/hardware.nix +++ b/nixosConfigurations/vinzenz-lpt2/hardware.nix @@ -1,30 +1,21 @@ -{ lib, ... }: +{ pkgs, lib, ... }: { - imports = [ ../../modules/intel-graphics.nix ]; - config = { - # intel cpu - boot.kernelModules = [ - "kvm-intel" - "xe" - ]; - hardware.cpu.intel.updateMicrocode = true; + # intel cpu + boot.kernelModules = [ + "kvm-intel" + "xe" + ]; - boot.loader = { - systemd-boot.enable = true; - efi.canTouchEfiVariables = true; - }; + networking = { + networkmanager.enable = true; + useDHCP = lib.mkDefault true; + }; - # 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 - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - - hardware.enableRedistributableFirmware = true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - - boot.initrd = { + boot = { + kernelPackages = pkgs.linuxPackages_zen; + supportedFilesystems = [ "btrfs" ]; + initrd = { + supportedFilesystems = [ "btrfs" ]; availableKernelModules = [ "xhci_pci" "thunderbolt" @@ -36,28 +27,30 @@ }; }; }; + }; - fileSystems = { - "/" = { - device = "/dev/disk/by-uuid/e4dad0c8-26a1-45e9-bbd9-48565eb6574e"; - fsType = "btrfs"; - options = [ "subvol=@" ]; - }; - - "/boot" = { - device = "/dev/disk/by-uuid/E2B7-2BC1"; - fsType = "vfat"; - }; + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/e4dad0c8-26a1-45e9-bbd9-48565eb6574e"; + fsType = "btrfs"; + options = [ "subvol=@" ]; }; - swapDevices = [ - { - device = "/var/lib/swapfile"; - size = 32 * 1024; - } - ]; - - services.thermald.enable = true; - services.hardware.bolt.enable = true; # thunderbolt security + "/boot" = { + device = "/dev/disk/by-uuid/E2B7-2BC1"; + fsType = "vfat"; + }; }; + + swapDevices = [ + { + device = "/var/lib/swapfile"; + size = 32 * 1024; + } + ]; + + services.thermald.enable = true; + services.hardware.bolt.enable = true; # thunderbolt security + + hardware.bluetooth.enable = true; } diff --git a/nixosConfigurations/vinzenz-pc2/configuration.nix b/nixosConfigurations/vinzenz-pc2/configuration.nix deleted file mode 100644 index 4f6b859..0000000 --- a/nixosConfigurations/vinzenz-pc2/configuration.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ pkgs, ... }: -{ - imports = [ - ./hardware.nix - ./vscode-server.nix - ./hass.nix - ]; - config = { - nix.settings.extra-platforms = [ - "aarch64-linux" - "i686-linux" - ]; - - services.xserver.xkb = { - # Configure keymap in X11 - layout = "de"; - variant = ""; - }; - - # Configure console keymap - console.keyMap = "de"; - - users.users.vinzenz.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' - ]; - - users.users.ronja.openssh.authorizedKeys.keys = [ - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ssh-host-key'' - ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEgN6J8KyVyQqBAz+y3drXDmIsxOPkdPB+ISgpIP9Eld Generated By Termius'' - ]; - - environment.systemPackages = with pkgs; [ lact ]; - }; -} diff --git a/nixosConfigurations/vinzenz-pc2/default.nix b/nixosConfigurations/vinzenz-pc2/default.nix index e31bdbc..23505b1 100644 --- a/nixosConfigurations/vinzenz-pc2/default.nix +++ b/nixosConfigurations/vinzenz-pc2/default.nix @@ -1,19 +1,42 @@ -{ vinzenzNixosModules, ... }: +{ pkgs, ... }: { imports = [ - ./configuration.nix ./hardware.nix - - ../../modules/gnome.nix - ../../modules/gaming.nix - vinzenzNixosModules.steam - vinzenzNixosModules.printing - vinzenzNixosModules.podman - #../../modules/niri.nix - ../../modules/desktop-environment.nix - ../../modules/desktop-hardware.nix - - ../../home/vinzenz - ../../home/ronja + ./vscode-server.nix + ./hass.nix ]; + + config = { + nix.settings.extra-platforms = [ + "aarch64-linux" + "i686-linux" + ]; + + services.xserver.xkb = { + # Configure keymap in X11 + layout = "de"; + variant = ""; + }; + + # Configure console keymap + console.keyMap = "de"; + + users.users.vinzenz.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFCJUpbpB3KEKVoKWsKoar9J4RNah8gmQoSH6jQEw5dY vinzenz-pixel-JuiceSSH'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDNpLDmctyqGpow/ElQvdhY4BLBPS/sigDJ1QEcC7wC vinzenz-lpt2-roaming'' + ]; + + users.users.ronja.openssh.authorizedKeys.keys = [ + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIALWKm+d6KL6Vl3grPOcGouiNTkvdhXuWJmcrdEBY2nw ssh-host-key'' + ''ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEgN6J8KyVyQqBAz+y3drXDmIsxOPkdPB+ISgpIP9Eld Generated By Termius'' + ]; + + environment.systemPackages = with pkgs; [ lact ]; + + networking.firewall.allowedUDPPorts = [ + # Factorio + 34197 + ]; + }; } diff --git a/nixosConfigurations/vinzenz-pc2/hardware.nix b/nixosConfigurations/vinzenz-pc2/hardware.nix index 316d9a2..9e875c3 100644 --- a/nixosConfigurations/vinzenz-pc2/hardware.nix +++ b/nixosConfigurations/vinzenz-pc2/hardware.nix @@ -1,25 +1,30 @@ -{ ... }: +{ pkgs, lib, ... }: { - imports = [ ../../modules/amd-graphics.nix ]; - config = { - # amd cpu - boot.kernelModules = [ "kvm-amd" ]; - hardware.cpu.amd.updateMicrocode = true; + # amd cpu + boot.kernelModules = [ "kvm-amd" ]; - boot = { - initrd.availableKernelModules = [ - "nvme" - "xhci_pci" - "ahci" - "usbhid" - "sd_mod" - ]; # "usb_storage" - loader.efi.efiSysMountPoint = "/boot"; - }; - - fileSystems = import ./fstab.nix; - swapDevices = [ ]; - - networking.interfaces.eno1.wakeOnLan.enable = true; + boot = { + initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "ahci" + "usbhid" + "sd_mod" + ]; # "usb_storage" + kernelPackages = pkgs.linuxPackages_zen; + supportedFilesystems = [ "btrfs" ]; + initrd.supportedFilesystems = [ "btrfs" ]; + loader.efi.efiSysMountPoint = "/boot"; }; + + fileSystems = import ./fstab.nix; + swapDevices = [ ]; + + networking = { + networkmanager.enable = true; + useDHCP = lib.mkDefault true; + interfaces.eno1.wakeOnLan.enable = true; + }; + + hardware.bluetooth.enable = true; } diff --git a/nixosConfigurations/vinzenz-pc2/vscode-server.nix b/nixosConfigurations/vinzenz-pc2/vscode-server.nix index 199c015..6632b1f 100644 --- a/nixosConfigurations/vinzenz-pc2/vscode-server.nix +++ b/nixosConfigurations/vinzenz-pc2/vscode-server.nix @@ -15,16 +15,12 @@ ]; }; - networking = { - firewall = { - allowedTCPPorts = [ - 8542 - 8543 - 8544 - 80 - 1313 - 5201 - ]; - }; - }; + networking.firewall.allowedTCPPorts = [ + 8542 + 8543 + 8544 + 80 + 1313 + 5201 + ]; } diff --git a/nixosModules/allowed-unfree-list.nix b/nixosModules/allowed-unfree-list.nix index a5583cf..7bfa758 100644 --- a/nixosModules/allowed-unfree-list.nix +++ b/nixosModules/allowed-unfree-list.nix @@ -9,7 +9,9 @@ config = { nixpkgs.config = { # https://github.com/NixOS/nixpkgs/issues/197325#issuecomment-1579420085 - allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.allowedUnfreePackages; + allowUnfreePredicate = lib.mkDefault ( + pkg: builtins.elem (lib.getName pkg) config.allowedUnfreePackages + ); }; }; } diff --git a/nixosModules/amd-graphics.nix b/nixosModules/amd-graphics.nix new file mode 100644 index 0000000..cca6393 --- /dev/null +++ b/nixosModules/amd-graphics.nix @@ -0,0 +1,20 @@ +{ pkgs, ... }: +{ + boot.kernelModules = [ "amdgpu" ]; + services.xserver.videoDrivers = [ "amdgpu" ]; + + hardware = { + graphics.enable = true; + amdgpu = { + opencl.enable = true; + amdvlk = { + # TODO: this creates black borders around GNOME apps + # enable = true; + # support32Bit.enable = config.hardware.graphics.enable32Bit; + }; + overdrive.enable = true; + }; + }; + + environment.systemPackages = with pkgs; [ nvtopPackages.amd ]; +} diff --git a/nixosModules/en-de.nix b/nixosModules/en-de.nix index 0ed4faf..a91780e 100644 --- a/nixosModules/en-de.nix +++ b/nixosModules/en-de.nix @@ -1,3 +1,4 @@ +{ pkgs, ... }: { i18n = { defaultLocale = "en_US.UTF-8"; @@ -21,4 +22,10 @@ "en-US" "de" ]; + + environment.systemPackages = [ + pkgs.hunspell + pkgs.hunspellDicts.de-de + pkgs.hunspellDicts.en-us + ]; } diff --git a/nixosModules/firmware-updates.nix b/nixosModules/firmware-updates.nix new file mode 100644 index 0000000..8e81b72 --- /dev/null +++ b/nixosModules/firmware-updates.nix @@ -0,0 +1,11 @@ +{ + hardware = { + enableRedistributableFirmware = true; + cpu = { + amd.updateMicrocode = true; + intel.updateMicrocode = true; + }; + }; + + services.fwupd.enable = true; +} diff --git a/nixosModules/gnome.nix b/nixosModules/gnome.nix index 3afe9ce..7a6f920 100644 --- a/nixosModules/gnome.nix +++ b/nixosModules/gnome.nix @@ -1,31 +1,65 @@ -{ pkgs, ... }: { - services = { - xserver = { - # Enable the GNOME Desktop Environment. - desktopManager.gnome = { - enable = true; - extraGSettingsOverridePackages = [ pkgs.mutter ]; - extraGSettingsOverrides = '' - [org.gnome.mutter] - experimental-features=['scale-monitor-framebuffer'] - ''; + pkgs, + lib, + config, + ... +}: +{ + options.vinzenz = { + keep-gnome-default-apps = lib.mkEnableOption "keep gnome default apps"; + }; + + config = lib.mkMerge [ + { + services = { + xserver = { + # Enable the GNOME Desktop Environment. + desktopManager.gnome = { + enable = true; + extraGSettingsOverridePackages = [ pkgs.mutter ]; + extraGSettingsOverrides = '' + [org.gnome.mutter] + experimental-features=['scale-monitor-framebuffer'] + ''; + }; + displayManager.gdm.enable = true; + excludePackages = [ pkgs.xterm ]; + }; + + displayManager.defaultSession = "gnome"; + + gnome = { + tinysparql.enable = false; + localsearch.enable = false; + sushi.enable = true; + }; }; - displayManager.gdm.enable = true; - excludePackages = [ pkgs.xterm ]; - }; - displayManager.defaultSession = "gnome"; - - gnome = { - tinysparql.enable = false; - localsearch.enable = false; - sushi.enable = true; - }; - }; - - programs = { - dconf.enable = true; - gpaste.enable = true; - }; + programs = { + dconf.enable = true; + gpaste.enable = true; + }; + } + (lib.mkIf (!config.vinzenz.keep-gnome-default-apps) { + environment.gnome.excludePackages = with pkgs; [ + cheese # photo booth + epiphany # web browser + evince # document viewer + geary # email client + gnome-maps + gnome-weather + gnome-tour + sysprof + orca # screen reader + gnome-weather + gnome-backgrounds + gnome-user-docs + yelp # help app + gnome-music + totem # video player + snapshot # camera + baobab # disk usage + ]; + }) + ]; } diff --git a/modules/intel-graphics.nix b/nixosModules/intel-graphics.nix similarity index 82% rename from modules/intel-graphics.nix rename to nixosModules/intel-graphics.nix index 709d720..74c6e67 100644 --- a/modules/intel-graphics.nix +++ b/nixosModules/intel-graphics.nix @@ -1,7 +1,5 @@ -{ pkgs, vinzenzNixosModules, ... }: +{ pkgs, ... }: { - imports = [ vinzenzNixosModules.allowed-unfree-list ]; - config = { hardware.graphics = { extraPackages = with pkgs; [ diff --git a/modules/latex.nix b/nixosModules/latex.nix similarity index 100% rename from modules/latex.nix rename to nixosModules/latex.nix diff --git a/modules/niri.nix b/nixosModules/niri.nix similarity index 100% rename from modules/niri.nix rename to nixosModules/niri.nix diff --git a/nixosModules/quiet-boot.nix b/nixosModules/quiet-boot.nix new file mode 100644 index 0000000..8dbcd57 --- /dev/null +++ b/nixosModules/quiet-boot.nix @@ -0,0 +1,11 @@ +{ + boot = { + kernelParams = [ + "quiet" + "udev.log_level=3" + ]; + consoleLogLevel = 0; + initrd.verbose = false; + plymouth.enable = true; + }; +} diff --git a/nixosModules/steam.nix b/nixosModules/steam.nix index 1c70785..b0991e6 100644 --- a/nixosModules/steam.nix +++ b/nixosModules/steam.nix @@ -1,7 +1,4 @@ -{ vinzenzNixosModules, ... }: { - imports = [ vinzenzNixosModules.allowed-unfree-list ]; - hardware.steam-hardware.enable = true; programs = { diff --git a/nixosModules/systemd-boot.nix b/nixosModules/systemd-boot.nix new file mode 100644 index 0000000..321a26c --- /dev/null +++ b/nixosModules/systemd-boot.nix @@ -0,0 +1,11 @@ +{ + boot.loader = { + timeout = 3; + efi.canTouchEfiVariables = true; + systemd-boot = { + enable = true; + editor = false; # do not allow changing kernel parameters + consoleMode = "max"; + }; + }; +} diff --git a/nixosModules/user-ronja.nix b/nixosModules/user-ronja.nix new file mode 100644 index 0000000..b374ab9 --- /dev/null +++ b/nixosModules/user-ronja.nix @@ -0,0 +1,19 @@ +{ pkgs, ... }: +{ + users.users.ronja = { + isNormalUser = true; + name = "ronja"; + description = "Ronja"; + home = "/home/ronja"; + extraGroups = [ + "networkmanager" + "wheel" + "games" + "podman" + "openvscode-server" + ]; + shell = pkgs.zsh; + }; + + nix.settings.trusted-users = [ "ronja" ]; +} diff --git a/nixosModules/user-vinzenz.nix b/nixosModules/user-vinzenz.nix new file mode 100644 index 0000000..b48e750 --- /dev/null +++ b/nixosModules/user-vinzenz.nix @@ -0,0 +1,35 @@ +{ pkgs, ... }: +{ + users.users.vinzenz = { + isNormalUser = true; + name = "vinzenz"; + description = "Vinzenz"; + home = "/home/vinzenz"; + extraGroups = [ + "networkmanager" + "wheel" + "games" + "dialout" + "podman" + "nginx" + "adbusers" + "kvm" + "input" + "video" + ]; + shell = pkgs.zsh; + autoSubUidGidRange = true; + }; + + nix.settings.trusted-users = [ "vinzenz" ]; + + allowedUnfreePackages = [ + "rider" + "pycharm-professional" + "jetbrains-toolbox" + + "anydesk" + + "vscode-extension-ms-dotnettools-csharp" + ]; +} diff --git a/nixosModules/vinzenz-desktop-settings.nix b/nixosModules/vinzenz-desktop-settings.nix new file mode 100644 index 0000000..24b4b4f --- /dev/null +++ b/nixosModules/vinzenz-desktop-settings.nix @@ -0,0 +1,28 @@ +{ pkgs, ... }: +{ + programs.firefox.enable = true; + + environment.systemPackages = with pkgs; [ + lm_sensors + libreoffice-qt6 + ]; + + fonts = { + enableDefaultPackages = true; + fontconfig.defaultFonts.monospace = [ "FiraCode Nerd Font" ]; + packages = with pkgs; [ + nerd-fonts.fira-code + roboto-mono + recursive + ]; + }; + + hardware.logitech.wireless = { + enable = true; + enableGraphical = true; + }; + + # RDP connections + services.gnome.gnome-remote-desktop.enable = true; + networking.firewall.allowedTCPPorts = [ 3389 ]; +} diff --git a/nixosModules/wine-gaming.nix b/nixosModules/wine-gaming.nix new file mode 100644 index 0000000..2b9cb51 --- /dev/null +++ b/nixosModules/wine-gaming.nix @@ -0,0 +1,22 @@ +{ pkgs, ... }: +{ + hardware = { + graphics = { + enable32Bit = true; + extraPackages = with pkgs; [ mangohud ]; + extraPackages32 = with pkgs; [ mangohud ]; + }; + + xpadneo.enable = true; + }; + + environment.systemPackages = with pkgs; [ + wineWowPackages.stagingFull + wineWowPackages.fonts + winetricks + dxvk + mangohud + vulkan-tools + glxinfo + ]; +}