# Edit this configuration file to define what should be installed on # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). { config, pkgs, inputs, lib, ... } @ args: let # tuigreet = "${pkgs.greetd.tuigreet}/bin/tuigreet"; # session = "${pkgs.sway}/bin/sway"; # username = "ps"; wallpaper = pkgs.fetchurl { url = "https://w.wallhaven.cc/full/ex/wallhaven-exrqrr.jpg"; sha256 = "sha256-RYN8KwJPDMfxrcosbpmjON0Y+I58IhB1Ke36LdohsxA="; }; in { imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix inputs.home-manager.nixosModules.default ]; # Bootloader. boot.tmp.cleanOnBoot = true; boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; boot.plymouth.enable = true; boot.plymouth.theme = "bgrt"; boot.initrd.verbose = false; boot.initrd.systemd.enable = true; boot.initrd.kernelModules = [ "amdgpu" ]; boot.consoleLogLevel = 0; boot.kernelPackages = pkgs.linuxPackages_latest; boot.kernelParams = [ "quiet" "udev.log_level=0" "amdgpu.runpm=0" ]; networking.hostName = "nixos"; # Define your hostname. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.package = pkgs.nixVersions.nix_2_28; # Configure network proxy if necessary # networking.proxy.default = "http://user:password@proxy:port/"; # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; # Enable networking networking.networkmanager.enable = true; # Set your time zone. time.timeZone = "Europe/Berlin"; # Select internationalisation properties. i18n.defaultLocale = "de_DE.UTF-8"; i18n.extraLocaleSettings = { LC_ADDRESS = "de_DE.UTF-8"; LC_IDENTIFICATION = "de_DE.UTF-8"; LC_MEASUREMENT = "de_DE.UTF-8"; LC_MONETARY = "de_DE.UTF-8"; LC_NAME = "de_DE.UTF-8"; LC_NUMERIC = "de_DE.UTF-8"; LC_PAPER = "de_DE.UTF-8"; LC_TELEPHONE = "de_DE.UTF-8"; LC_TIME = "de_DE.UTF-8"; }; programs.dconf.enable = true; # Services services = { xserver = { enable = true; # Enable the GNOME Desktop Environment. # displayManager.gdm.enable = true; # desktopManager.gnome.enable = true; # displayManager.sddm.enable = true; # desktopManager.budgie.enable = true; # desktopManager.deepin.enable = true; # displayManager.lightdm.enable = true; # displayManager.gdm.enable = true; # desktopManager.plasma5.enable = true; displayManager = { defaultSession = "xfce+i3"; lightdm = { enable = true; greeters.gtk = { theme = { name = "Qogir-Dark"; package = pkgs.qogir-theme; }; iconTheme = { name = "Qogir-dark"; package = pkgs.qogir-icon-theme; }; cursorTheme = { name = "volantes_light_cursors"; package = pkgs.volantes-cursors; }; }; background = "${wallpaper}"; }; }; desktopManager = { xterm.enable = false; xfce = { enable = true; # noDesktop = true; enableXfwm = false; }; }; windowManager.i3.enable = true; windowManager.awesome.enable = true; xkb = { layout = "de"; variant = "nodeadkeys"; options = "caps:ctrl_modifier"; }; excludePackages = [ pkgs.xterm ]; videoDrivers = ["amdgpu"]; # libinput.enable = true; }; }; services.autorandr = { enable = true; hooks = { postswitch = { "set-wallpaper" = "set-wallpaper"; }; }; }; services.syncthing = { enable = true; user = "ps"; dataDir = "/home/ps/sync"; configDir = "/home/ps/.config/syncthing"; }; services.udev.extraRules = '' KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{serial}=="*vial:f64c2b3c*", MODE="0660", GROUP="users", TAG+="uaccess", TAG+="udev-acl" ''; # OpenGL hardware.graphics.enable = true; # services.logind = { # extraConfig = "HandlePowerKey=suspend"; # lidSwitch = "suspend"; # }; # Configure console keymap console.keyMap = "de-latin1-nodeadkeys"; # Enable CUPS to print documents. services.printing.enable = true; services.printing.drivers = [ pkgs.gutenprint ]; # Enable Bluetooth hardware.bluetooth.enable = true; hardware.bluetooth.powerOnBoot = false; services.blueman.enable = true; # Enable sound with pipewire. hardware.pulseaudio.enable = false; security.rtkit.enable = true; services.pipewire = { enable = true; alsa.enable = true; alsa.support32Bit = true; pulse.enable = true; # If you want to use JACK applications, uncomment this #jack.enable = true; # use the example session manager (no others are packaged yet so this is enabled by default, # no need to redefine it in your config for now) #media-session.enable = true; }; services.jack = { jackd.enable = true; }; # Enable touchpad support (enabled default in most desktopManager). # services.libinput.touchpad = { # naturalScrolling = false; # }; # Define a user account. Don't forget to set a password with ‘passwd’. users.groups.ssh = {}; users.users = { ps = { isNormalUser = true; description = "Patrick"; shell = pkgs.bash; extraGroups = [ "networkmanager" "wheel" "dialout" "jackaudio" ]; }; sshd = { isSystemUser = true; packages = [ pkgs.python3 ]; group = "ssh"; }; chirp = { isSystemUser = true; packages = [ pkgs.python3 ]; group = "ssh"; shell = pkgs.bash; initialPassword = "chirp"; }; }; security.polkit.enable = true; security.sudo.wheelNeedsPassword = false; home-manager = { backupFileExtension = "backup"; extraSpecialArgs = { inherit inputs; inherit wallpaper; }; # users = { # "ps" = import ./home.nix; # }; users.ps.imports = [ ./home.nix ]; }; # Enable automatic login for the user. # services.displayManager.autoLogin.enable = true; # services.displayManager.autoLogin.user = "ps"; # services.getty.autologinUser = "ps"; # Workaround for GNOME autologin: https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229 # systemd.services."getty@tty1".enable = false; # systemd.services."autovt@tty1".enable = false; # Allow unfree packages nixpkgs.config.allowUnfree = true; # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; [ args.inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.zig args.inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.zls args.inputs.psch-flakes.packages.${pkgs.system}.resetmsmice vim wget file git kitty i3 gdb mosh cmake scrcpy xsel pavucontrol syncthingtray # xfce plugins xfce.xfce4-pulseaudio-plugin # xfce.xfce4-verve-plugin xfce.xfce4-notes-plugin # xfce.xfce4-timer-plugin # xfce.xfce4-windowck-plugin xfce.thunar-archive-plugin # xfce.xfce4-i3-workspaces-plugin # xfce.xfce4-xkb-plugin xfce.xfce4-whiskermenu-plugin ]; programs.xfconf.enable = true; programs.nix-ld.enable = true; services.fwupd.enable = true; # Some programs need SUID wrappers, can be configured further or are # started in user sessions. # programs.mtr.enable = true; # programs.gnupg.agent = { # enable = true; # enableSSHSupport = true; # }; # List services that you want to enable: # Enable the OpenSSH daemon. services.openssh = { enable = false; ports = [ 22 ]; settings = { PasswordAuthentication = false; PermitRootLogin = "no"; }; authorizedKeysCommand = let keys = pkgs.writers.writePython3Bin "keys" {} '' import sys args = sys.argv print(args) ''; in "${keys}/bin/keys"; authorizedKeysCommandUser = "ps"; }; # Open ports in the firewall. networking.firewall.allowedTCPPorts = [ 22 1234 5900 6011 6021 6022 8080 53317 ]; networking.firewall.allowedUDPPorts = [ 5901 53317 ]; # Or disable the firewall altogether. # networking.firewall.enable = false; # 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 = "24.05"; # Did you read the comment? }