diff --git a/flake.nix b/flake.nix index df54c8b..8ab0630 100644 --- a/flake.nix +++ b/flake.nix @@ -333,6 +333,21 @@ }]; }; + thinkstation = inputs.nixpkgs-u.lib.nixosSystem { + system = "x86_64-linux"; + modules = commonModules ++ [ + inputs.nixos-hardware.nixosModules.common-cpu-intel + inputs.nixos-hardware.nixosModules.common-pc-ssd + ./instances/thinkstation/hardware-configuration.nix + ./instances/thinkstation/configuration.nix + + ./modules/nixos/server + ./modules/nixos/steam.nix + ] ++ homeManagerUModules ++ [{ + home-manager.users.bertof = import ./instances/thinkstation/hm.nix; + }]; + }; + heimdall = inputs.nixpkgs-u.lib.nixosSystem { system = "x86_64-linux"; modules = commonModules ++ [ diff --git a/instances/thinkstation/configuration.nix b/instances/thinkstation/configuration.nix new file mode 100644 index 0000000..4691ab2 --- /dev/null +++ b/instances/thinkstation/configuration.nix @@ -0,0 +1,112 @@ +{ pkgs, ... }: +let + hosts = import ../../hosts.nix; +in +{ + boot = { + kernelPackages = pkgs.linuxPackages_latest; + # kernelParams = [ ]; + initrd.checkJournalingFS = true; # Use same ACPI identifier as Dell Ubuntu + loader = { + systemd-boot = { enable = true; editor = false; }; + efi.canTouchEfiVariables = true; + }; + }; + + console = { font = "Lat2-Terminus16"; keyMap = "it"; }; + + i18n.defaultLocale = "it_IT.UTF-8"; + + hardware = { + xpadneo.enable = true; + enableAllFirmware = true; + enableRedistributableFirmware = true; + bluetooth = { enable = true; package = pkgs.bluez-experimental; }; + cpu.intel.updateMicrocode = true; + nvidia.open = false; + graphics = { + enable = true; + enable32Bit = true; + extraPackages = [ pkgs.intel-media-driver ]; + extraPackages32 = [ pkgs.pkgsi686Linux.intel-media-driver ]; + }; + nvidia-container-toolkit.enable = true; + }; + + networking = { + hostName = "thinkstation"; + networkmanager.enable = true; + + firewall = { + enable = true; + allowPing = true; + allowedTCPPorts = [ + # 445 # SAMBA + # 139 # SAMBA + # 5357 # SAMBA-WSDD + # 8123 # HOME ASSISTANT + # 8384 # SYNCTHING + # 8385 # SYNCTHING + ]; + allowedUDPPorts = [ + # 137 # SYNCTHING + # 138 # SYNCTHING + 3702 # SAMBA-WSDD + ]; + extraCommands = "iptables -t raw -A OUTPUT -p udp -m udp --dport 137 -j CT --helper netbios-ns"; + }; + }; + + programs = { + gamemode = { + enable = true; + settings = { + custom = { + start = "${pkgs.libnotify}/bin/notify-send 'GameMode started'"; + end = "${pkgs.libnotify}/bin/notify-send 'GameMode ended'"; + }; + }; + }; + gamescope = { enable = true; capSysNice = true; }; + steam.gamescopeSession.enable = true; + }; + environment.systemPackages = [ pkgs.gnome-tweaks ]; + services = { + avahi = { + enable = true; + openFirewall = true; + nssmdns4 = true; + publish = { + enable = true; + addresses = true; + domain = true; + userServices = true; + workstation = true; + }; + extraServiceFiles = { + ssh = "${pkgs.avahi}/etc/avahi/services/ssh.service"; + }; + }; + blueman.enable = true; + xserver = { + displayManager.gdm = { enable = true; autoSuspend = false; }; + desktopManager.gnome.enable = true; + }; + # logind.lidSwitch = "ignore"; + pipewire = { + enable = true; + pulse.enable = true; + jack.enable = true; + alsa = { enable = true; support32Bit = true; }; + }; + smartd.enable = true; + thermald.enable = true; + xserver.videoDrivers = [ "nvidia" ]; + }; + + time.timeZone = "Europe/Rome"; + + zramSwap.enable = true; + + system.stateVersion = "24.11"; +} diff --git a/instances/thinkstation/hardware-configuration.nix b/instances/thinkstation/hardware-configuration.nix new file mode 100644 index 0000000..57c6d42 --- /dev/null +++ b/instances/thinkstation/hardware-configuration.nix @@ -0,0 +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, ... }: + +{ + imports = + [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "thunderbolt" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/01bf7273-414e-48a4-ae24-ca0c5b27debd"; + fsType = "btrfs"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/DA9C-3241"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = [ ]; + + # 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.enp3s0.useDHCP = lib.mkDefault true; + # networking.interfaces.enp4s0.useDHCP = lib.mkDefault true; + # networking.interfaces.tailscale0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; + # networking.interfaces.ztmjfdwjkp.useDHCP = lib.mkDefault true; + networking.networkmanager.enable = true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/instances/thinkstation/hm.nix b/instances/thinkstation/hm.nix new file mode 100644 index 0000000..9a5bb11 --- /dev/null +++ b/instances/thinkstation/hm.nix @@ -0,0 +1,147 @@ +{ pkgs, ... }: +{ + home = { + language.base = "it_IT.UTF-8"; + keyboard = { + layout = "it,us,us"; + variant = ",,colemak"; + options = [ + "terminate:ctrl_alt_bksp" + "compose:rctrl" + "grp:menu_toggle" + ]; + }; + packages = (builtins.attrValues { + # inherit (pkgs) + # # element-desktop # matrix client + # # evolution + # # freecad + # # krita + # # minecraft + # # mycrypto + # # pcmanfm + # # retroarchFull + # # shotwell + # # signal-desktop + # # slack + # # wineFull + # authenticator + # brave + # discord + # droidcam + # eog + # evince + # file-roller + # gallery-dl + # gnome-font-viewer + # gnome-screenshot + # gnome-system-monitor + # gucharmap + # inkscape + # keyboard-switch + # openvpn + # p7zip + # pavucontrol + # procps + # spotify + # tdesktop + # thunderbird + # transmission_4 + # wireguard-tools + # xournalpp + # ; + }) ++ [ pkgs.kitty.terminfo ]; + }; + + + # services.gnome-keyring.enable = true; + + + # xsession = { + # enable = true; + # numlock.enable = true; + # initExtra = '' + # ## Touchpad + # ${pkgs.xorg.xinput}/bin/xinput set-prop 'DELL0824:00 06CB:7E92 Touchpad' 'libinput Natural Scrolling Enabled' 1 + # ${pkgs.xorg.xinput}/bin/xinput set-prop 'DELL0824:00 06CB:7E92 Touchpad' 'libinput Tapping Enabled' 1 + # ${pkgs.xorg.xinput}/bin/xinput set-prop 'DELL0824:00 06CB:7E92 Touchpad' 'libinput Disable While Typing Enabled' 1 + # ''; + # }; + + imports = [ + ../../modules/hm/__basic.nix + + # ../../modules/hm/development/cpp.nix + # ../../modules/hm/development/data.nix + # # ../../modules/hm/development/database.nix + # ../../modules/hm/development/docker.nix + # ../../modules/hm/development/go.nix + # ../../modules/hm/development/javascript.nix + # ../../modules/hm/development/kubernetes.nix + # ../../modules/hm/development/latex.nix + # ../../modules/hm/development/markdown.nix + # ../../modules/hm/development/nix.nix + # ../../modules/hm/development/python.nix + # ../../modules/hm/development/rust.nix + # ../../modules/hm/development/web.nix + + # # ../../modules/hm/alacritty.nix + # ../../modules/hm/autorandr.nix + # ../../modules/hm/biblio.nix + # # ../../modules/hm/bitwarden.nix + # # ../../modules/hm/blender.nix + # # ../../modules/hm/carapace.nix + # # ../../modules/hm/dwarf-fortress.nix + # ../../modules/hm/easyeffects.nix + # ../../modules/hm/firefox.nix + # # ../../modules/hm/vivaldi.nix + # # ../../modules/hm/fonts.nix + # # ../../modules/hm/gnome_shell.nix + # # ../../modules/hm/grobi.nix + # ../../modules/hm/gtk_theme.nix + # ../../modules/hm/heif.nix + # ../../modules/hm/helix.nix + # ../../modules/hm/jellyfin-player.nix + # # ../../modules/hm/joystickwake.nix + # # ../../modules/hm/kakoune.nix + # ../../modules/hm/kdeconnect.nix + # # ../../modules/hm/keepassxc.nix + # # ../../modules/hm/kicad.nix + # ../../modules/hm/kitty.nix + # ../../modules/hm/libinput-gestures.nix + # # ../../modules/hm/lutris.nix + # ../../modules/hm/mangohud.nix + # ../../modules/hm/megasync.nix + # ../../modules/hm/mpv.nix + # # ../../modules/hm/nautilus.nix + # ../../modules/hm/ncspot.nix + # ../../modules/hm/nix-index.nix + # ../../modules/hm/noti.nix + # ../../modules/hm/nushell.nix + # ../../modules/hm/obs-studio.nix + # ../../modules/hm/office.nix + # ../../modules/hm/pass.nix + # ../../modules/hm/pro_audio.nix + # # ../../modules/hm/pycharm.nix + # ../../modules/hm/rclone-mount.nix + # ../../modules/hm/research.nix + # # ../../modules/hm/rofi.nix + # # ../../modules/hm/screen_locker.nix + # # ../../modules/hm/security.nix + # # ../../modules/hm/spotifyd.nix + # ../../modules/hm/syncthing.nix + # # ../../modules/hm/thunar.nix + # # ../../modules/hm/twmn.nix + # # ../../modules/hm/update_background.nix + # ../../modules/hm/vim.nix + # ../../modules/hm/virtualization.nix + # ../../modules/hm/vscode.nix + # ../../modules/hm/webapp.nix + # ../../modules/hm/xresources.nix + # ../../modules/hm/yazi.nix + # ../../modules/hm/zathura.nix + # ../../modules/hm/zellij.nix + ]; + + home.stateVersion = "24.11"; +}