dotfiles

Artifact [81b7edf182]
Login

Artifact [81b7edf182]

Artifact 81b7edf182c185e3840386828674a6620cbe033e:


{ config, lib, pkgs, inputs, ... }:
{
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
      ../lib/common.nix
      # inputs.nixos-hardware.nixosModules.gpd-win-mini-2024
    ];

  boot.binfmt.emulatedSystems = [
    "aarch64-linux" # This adds support for deploying to Raspberry Pi 4
    "armv7l-linux" # This adds support for deploying to Raspberry Pi 2
  ];
  services.xserver.xkb = {
    layout = "us";
    variant = "";
  };

  boot.plymouth.enable = true;

  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;

  services.fstrim.enable = true;

  networking.hostName = "winmini"; # Define your hostname.
  # networking.wireless.enable = true;  # Enables wireless support via wpa_supplicant.

  # Set your time zone.
  time.timeZone = "Europe/Copenhagen";

  networking.networkmanager.enable = true;

  services.colord.enable = true;

  # Select internationalisation properties.
  i18n.defaultLocale = "da_DK.UTF-8";
  
  security.rtkit.enable = true;
  security.pam.loginLimits = [
    {
      domain = "*";
      item = "memlock";
      type = "hard";
      value = "unlimited";
    }
    {
      domain = "*";
      item = "memlock";
      type = "soft";
      value = "unlimited";
    }
  ];
  services.pipewire = {
    #config.pipewire."default.clock.rate" = 44100; # might be moved to a file per https://nixos.org/manual/nixos/stable/release-notes.html#sec-release-23.05-migration-pipewire
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;
  };
  security.polkit.extraConfig = ''
    /* deny steam doing weird shit */
    polkit.addRule(function(action, subject) {
      if (action.id === "org.freedesktop.NetworkManager.settings.modify.system") {
        var name = polkit.spawn(["cat", "/proc/" + subject.pid + "/comm"]);
        if (name.includes("steam")) {
          polkit.log("ignoring steam NM prompt");
          return polkit.Result.NO;
        }
      }
    });
  '';

  # Enable the X11 windowing system.
  services.xserver.enable = true;
  services.xserver.videoDrivers = [ "amdgpu" "modesetting" ];
  services.desktopManager.plasma6.enable = true;
  services.desktopManager.plasma6.enableQt5Integration = false;
  services.displayManager.sddm.wayland.enable = true;
  services.displayManager.sddm.enable = true;

  services.fwupd.enable = true;

  services.printing = {
    enable = true;
    drivers = with pkgs; [ hplip ];
  };
  hardware.pulseaudio.enable = false;
  hardware.bluetooth.enable = true;
  hardware.openrazer = {
    enable = true;
    users = [ "steffen" ];
  };

  programs.dconf.enable = true;
  services.gvfs.enable = true;

  services.guix = {
    enable = true;
    nrBuildUsers = 8;
  };

  # Define a user account. Don't forget to set a password with ‘passwd’.
  users.users.steffen = {
    isNormalUser = true;
    shell = pkgs.zsh;
    extraGroups = [ 
      "wheel" 
      "docker"
      "kvm"
      "libvirtd"
      "podman"
      "plugdev"
      "input"
      "cdrom"
    ];
  };

  programs.zsh.enable = true;

  programs.evince.enable = lib.mkForce false;

  services.udev.packages = [
    pkgs.unstable.wooting-udev-rules
  ];

  environment.systemPackages = with pkgs; [
    btrfs-progs
    #nilfs-utils
    fuse
    ntfs3g
    wireguard-tools
    htop
    gparted
    pkgs.gnome-disk-utility
    kdePackages.plasma-disks
    kdePackages.discover
    polychromatic

    docker-client
    docker-buildx
    #clinfo
    #unstable.wootility

    #rocmPackages_5.rocminfo
    #rocmPackages_5.hipcc
    #rocmPackages_5.rocm-smi

    # themes
    #papirus-icon-theme

    #kdePackages.konqueror
  ] ++ (with config.boot.kernelPackages; [
    systemtap
    perf
  ]);

  environment.plasma6.excludePackages = with pkgs.kdePackages; [
    spectacle
    elisa
    plasma-browser-integration
    kate
    khelpcenter
    krdp
    baloo-widgets
  ];

  programs.partition-manager.enable = true;

  environment.sessionVariables = {
     XDG_CACHE_HOME  = "\${HOME}/.cache";
     XDG_CONFIG_HOME = "\${HOME}/.config";
     XDG_BIN_HOME    = "\${HOME}/.local/bin";
     XDG_DATA_HOME   = "\${HOME}/.local/share";
     XDG_DATA_DIRS   = ["/var/lib/flatpak/exports/share" "\$HOME/.local/share/flatpak/exports/share"];
     MOZ_ENABLE_WAYLAND = "1";
  #   # Steam needs this to find Proton-GE
  #   STEAM_EXTRA_COMPAT_TOOLS_PATHS = "\${HOME}/.steam/root/compatibilitytools.d";
  #   # note: this doesn't replace PATH, it just adds this to it
  #   PATH = [ 
  #     "\${XDG_BIN_HOME}"
  #   ];
  };

  fonts.packages = with pkgs; [
    terminus_font
    terminus_font_ttf
    #vollkorn
    nerdfonts
  ];
  fonts.fontDir.enable = true;

  networking.firewall.allowedTCPPorts = [
    3389
  ];

  # Enable the OpenSSH daemon.
  services.openssh.enable = true;

  virtualisation.docker.enable = true;
  virtualisation.podman = {
    enable = true;
    defaultNetwork.settings.dns_enabled = true;
  };

  virtualisation.libvirtd.enable = true;
  programs.virt-manager.enable = true;

  programs.steam = {
    enable = true;
    remotePlay.openFirewall = true;
  };
  programs.cdemu.enable = true;
  programs.gamemode.enable = true;
  services.joycond.enable = true;

  nixpkgs.config.allowUnfree = true;
  nixpkgs.config.allowBroken = true;

  networking.firewall.enable = true;
  services.flatpak.enable = true;

  # This value determines the NixOS release from which the default
  # settings for stateful data, like file locations and database versions
  # on your system were taken. It‘s perfectly fine and recommended to leave
  # this value at the release version of the first install of this system.
  # Before changing this value read the documentation for this option
  # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
  system.stateVersion = "22.11"; # Did you read the comment?

}