diff --git a/base/absolution/configuration.nix b/base/absolution/configuration.nix new file mode 100644 index 0000000..aea15b7 --- /dev/null +++ b/base/absolution/configuration.nix @@ -0,0 +1,266 @@ +# 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, lib, inputs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + nix.package = pkgs.lix; + + #services.udev.extraRules = builtins.readFile ./udev.rules; + services.gnome.gnome-keyring.enable = true; + security.pam.services.greetd.enableGnomeKeyring = true; + + hardware.wooting.enable = true; + hardware.openrazer.enable = true; + + environment.pathsToLink = [ "/share/xdg-desktop-portal" ]; + + security.sudo.package = pkgs.sudo.override { withInsults = true; }; + + programs = { + adb.enable = true; + gamescope = { + enable = true; + capSysNice = true; + }; + flashrom.enable = true; + nix-ld.enable = true; + nix-ld.libraries = with pkgs; [xorg.libxcb libao xorg.libX11 libusb1 cargo rustc pkg-config cacert]; + }; + + services.journald.extraConfig = '' + SystemMaxUse=2G + ''; + + services.tailscale = { + enable = true; + useRoutingFeatures = "both"; + openFirewall = true; + interfaceName = "userspace-networking"; + }; + + networking.firewall.checkReversePath = "loose"; + services.resolved.enable = true; + networking.useNetworkd = true; + networking.interfaces.enp0s31f6.useDHCP = true; + networking.useDHCP = false; + + services.networkd-dispatcher = { + enable = true; + rules."50-tailscale" = { + onState = ["routable"]; + script = '' + "${pkgs.ethtool} NETDEV=$(ip -o route get 8.8.8.8 | cut -f 5 -d " ") | -K enp0s31f6 rx-udp-gro-forwarding on rx-gro-list off" + ''; + }; + }; + + boot.supportedFilesystems = ["exfat" "ntfs" "xfs"]; + boot.loader.limine.enable = true; + boot.loader.limine.style.wallpapers = []; + boot.loader.limine.additionalFiles = { + "efi/memtest86.efi" = "${pkgs.memtest86-efi}/BOOTX64.efi"; + "efi/shell.efi" = "${pkgs.edk2-uefi-shell}/shell.efi"; + }; + boot.loader.efi.canTouchEfiVariables = true; + boot.initrd.systemd.enable = true; + boot.loader.efi.efiSysMountPoint = "/boot/"; + boot.kernelParams = ["amdgpu.ppfeaturemask=0xffffffff" "amdgpu.seamless=1" "amdgpu.freesync_video=1" "initcall_blacklist=simpledrm_platform_driver_init" "pcie_acs_override=downstream,multifunction" "preempt=voluntary"]; + boot.extraModulePackages = [ + config.boot.kernelPackages.v4l2loopback.out + config.boot.kernelPackages.hid-t150.out + ]; + boot.kernelPackages = pkgs.linuxKernel.packages.linux_xanmod_latest; + boot.kernel.sysctl = { + "vm.max_map_count" = 2147483642; + }; + + hardware.display.outputs."DP-4".mode = "2560x1080@75"; + + programs.virt-manager.enable = true; + systemd.packages = with pkgs; [lact]; + systemd.services.lactd.wantedBy = ["multi-user.target"]; + networking.hostName = "Absolution"; # Define your hostname. + + powerManagement.cpuFreqGovernor = "performance"; + + # 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 + hardware.graphics = { + enable = true; + enable32Bit = true; + }; + + hardware.bluetooth.enable = true; + services.blueman.enable = true; + + networking.networkmanager = { + enable = true; + wifi.backend = "iwd"; + }; + + # Set your time zone. + time.timeZone = "Europe/London"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_GB.UTF-8"; + + services.udisks2.enable = true; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_GB.UTF-8"; + LC_IDENTIFICATION = "en_GB.UTF-8"; + LC_MEASUREMENT = "en_GB.UTF-8"; + LC_MONETARY = "en_GB.UTF-8"; + LC_NAME = "en_GB.UTF-8"; + LC_NUMERIC = "en_GB.UTF-8"; + LC_PAPER = "en_GB.UTF-8"; + LC_TELEPHONE = "en_GB.UTF-8"; + LC_TIME = "en_GB.UTF-8"; + }; + + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 30d"; + }; + + # Enable the X11 windowing system. + services.xserver.enable = false; + programs.dconf.enable = true; + + # Configure keymap in X11 + services.xserver.xkb = { + layout = "gb"; + variant = ""; + }; + + # Enable CUPS to print documents. + services.printing.enable = true; + services.printing.drivers = [pkgs.gutenprint]; + + nixpkgs.overlays = [ + (self: super: { + vlc = super.vlc.override { + libbluray = super.libbluray.override { + withAACS = true; + withBDplus = true; + }; + }; + }) + ]; + + security = { + rtkit.enable = true; + }; + + # Enable sound with pipewire. + services.pulseaudio.enable = false; + 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; + extraConfig.pipewire.noresample = { "context.properties" = { "default.clock.allowed-rates" = [ 44100 48000 192000 ]; }; }; + extraConfig.pipewire."92-low-latency" = { + "context.properties" = { + "default.clock.rate" = 192000; + #"default.clock.quantum" = 288; + #"default.clock.min-quantum" = 32; + #"default.clock.max-quantum" = 288; + }; + }; + extraConfig.pipewire-pulse."92-low-latency" = { + context.modules = [ + { + name = "libpipewire-module-protocol-pulse"; + args = { + pulse.min.req = "32/48000"; + pulse.default.req = "32/48000"; + pulse.max.req = "192000"; + # pulse.min.quantum = "32/48000"; + # pulse.max.quantum = "288/192000"; + }; + } + ]; + stream.properties = { + node.latency = "32/48000"; + resample.quality = 1; + }; + }; + }; + + # Define a user account. Don't forget to set a password with ‘passwd’. + + users.users.alyx = { + isNormalUser = true; + description = "Alyx"; + extraGroups = [ "openrazer" "gamemode" "inputs" "networkmanager" "wheel" "libvirtd" "camera" "qemu-libvirtd" "lxd" ]; + packages = with pkgs; [ + ]; + }; + + services.libinput.enable = true; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + nixpkgs.config.permittedInsecurePackages = [ + "dotnet-sdk-7.0.410" + "dotnet-sdk-6.0.428" + "dotnet-runtime-7.0.20" + "olm-3.2.16" + ]; + + services.gvfs.enable = true; + + environment.systemPackages = with pkgs; [ + hyprlock + wget + jmtpfs + nautilus + inputs.niri.packages.${pkgs.stdenv.hostPlatform.system}.xwayland-satellite-stable + openrazer-daemon + polychromatic + ethtool + networkd-dispatcher + oversteer + neovim + cbfstool + steamtinkerlaunch + librewolf + vulkan-tools + r2modman + index_camera_passthrough + wayvr-dashboard + wlx-overlay-s + r2mod_cli + gamemode + git + lact + looking-glass-client + keepassxc + pulseaudio + winetricks + p7zip + cabextract + unzip + wineWowPackages.stable + (pkgs.python3.withPackages (ps: with ps; [tkinter])) + ]; + + system.stateVersion = "24.11"; # Did you read the comment? + +} diff --git a/base/absolution/default.nix b/base/absolution/default.nix new file mode 100644 index 0000000..0b2e539 --- /dev/null +++ b/base/absolution/default.nix @@ -0,0 +1,11 @@ +{config, pkgs, ...}:{ + imports = [ + ./configuration.nix + ../overrides.nix + ../ssh.nix + ../substituters.nix + ../fonts.nix +# ../virtualisation/virtualisation.nix +# ../monado.nix + ]; +} diff --git a/base/absolution/hardware-configuration.nix b/base/absolution/hardware-configuration.nix new file mode 100644 index 0000000..913f721 --- /dev/null +++ b/base/absolution/hardware-configuration.nix @@ -0,0 +1,55 @@ +# 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 = [ "uhci_hcd" "ehci_pci" "ahci" "firewire_ohci" "usb_storage" "usbhid" "sd_mod" "sr_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/193dbe3e-ca2b-4347-85aa-216d197b507f"; + fsType = "xfs"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/3FF5-99B9"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + fileSystems."/miscssd" = + { device = "/dev/disk/by-uuid/1375e97d-e67b-43b7-827c-c1b984e0f42f"; + fsType = "xfs"; + }; + + fileSystems."/mainstorage" = + { device = "/dev/disk/by-uuid/CE2C90F22C90D6B5"; + fsType = "ntfs"; + }; + + fileSystems."/secondarystorage" = + { device = "/dev/disk/by-uuid/0e2b7fc5-a593-41d7-93e5-2271f572502b"; + fsType = "xfs"; + }; + + 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.enp11s0.useDHCP = lib.mkDefault true; + # networking.interfaces.enp12s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wls5.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/base/adventurer/configuration.nix b/base/adventurer/configuration.nix new file mode 100644 index 0000000..1902634 --- /dev/null +++ b/base/adventurer/configuration.nix @@ -0,0 +1,138 @@ +# 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, fetchFromGitLab, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + # Bootloader. + boot.loader.grub.enable = true; + boot.loader.grub.device = "/dev/sda"; + boot.loader.grub.useOSProber = true; + powerManagement.cpuFreqGovernor = "performance"; + nix.settings.experimental-features = "nix-command flakes"; + programs.dconf.enable = true; + services.fprintd.enable = true; + networking.hostName = "adventurer"; # Define your hostname. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + environment.variables = { + WLR_NO_HARDWARE_CURSORS = "1"; + PASSWORD_STORE_DIR = "/home/maya/sync/general/pass"; + }; + programs.gnupg.agent.enable = true; + programs.steam.enable = true; + # 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 = "Australia/Perth"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_AU.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_AU.UTF-8"; + LC_IDENTIFICATION = "en_AU.UTF-8"; + LC_MEASUREMENT = "en_AU.UTF-8"; + LC_MONETARY = "en_AU.UTF-8"; + LC_NAME = "en_AU.UTF-8"; + LC_NUMERIC = "en_AU.UTF-8"; + LC_PAPER = "en_AU.UTF-8"; + LC_TELEPHONE = "en_AU.UTF-8"; + LC_TIME = "en_AU.UTF-8"; + }; + + # Enable the X11 windowing system. + # You can disable this if you're only using the Wayland session. + services.xserver.enable = true; + + # Enable the KDE Plasma Desktop Environment. + + # Configure keymap in X11 + services.xserver.xkb = { + layout = "us"; + variant = ""; + }; + + # Enable CUPS to print documents. + services.printing.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; + }; + + # Enable touchpad support (enabled default in most desktopManager). + # services.xserver.libinput.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.maya = { + isNormalUser = true; + description = "Maya Wren"; + extraGroups = [ "networkmanager" "wheel" ]; + packages = with pkgs; [ + # thunderbird + ]; + }; + # Install firefox. + programs.firefox.enable = true; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + # 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 + neovim + git + ]; + + # 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 = true; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # 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.11"; # Did you read the comment? + +} diff --git a/base/adventurer/default.nix b/base/adventurer/default.nix new file mode 100644 index 0000000..a94a618 --- /dev/null +++ b/base/adventurer/default.nix @@ -0,0 +1,12 @@ +{config, pkgs, ...}:{ + imports = [ + ./configuration.nix + ../overrides.nix + ../ssh.nix + ../firewall.nix + ../substituters.nix + ../fonts.nix + ../udev.nix + ../greetd.nix + ]; +} diff --git a/base/adventurer/hardware-configuration.nix b/base/adventurer/hardware-configuration.nix new file mode 100644 index 0000000..adb8718 --- /dev/null +++ b/base/adventurer/hardware-configuration.nix @@ -0,0 +1,37 @@ +# 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 = [ "uhci_hcd" "ehci_pci" "ata_piix" "ahci" "firewire_ohci" "usb_storage" "usbhid" "sd_mod" "sr_mod" "sdhci_pci" ]; + #boot.initrd.kernelModules = [ "nvidia" ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.kernelPackages = pkgs.linuxPackages_zen; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/be6662d9-e9c6-48a2-9557-672f5307816f"; + fsType = "ext4"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/87a05a1d-e62d-4882-ad5a-e2e6324671da"; } + ]; + + # 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.enp0s29f7u2.useDHCP = lib.mkDefault true; + # networking.interfaces.enp9s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp12s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + networking.enableIntel3945ABGFirmware = true; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/base/apollo/configuration.nix b/base/apollo/configuration.nix new file mode 100644 index 0000000..8a135e4 --- /dev/null +++ b/base/apollo/configuration.nix @@ -0,0 +1,213 @@ +# 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, lib, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + services.blueman.enable = true; + services.upower.enable = true; + programs.steam.enable = true; + hardware.i2c.enable = true; + services.pcscd.enable = true; + services.tailscale = { + enable = true; + useRoutingFeatures = "both"; + }; + programs.adb.enable = true; + services.wivrn.enable = true; + services.wivrn.openFirewall = true; + services.wivrn.defaultRuntime = true; + + powerManagement.cpuFreqGovernor = "performance"; + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + programs.virt-manager.enable = true; + services.gvfs.enable = true; + hardware.keyboard.qmk.enable = true; + virtualisation = { + libvirtd = { + enable = true; + extraConfig = '' + user="maya" + ''; + onShutdown = "shutdown"; + + qemu = { + ovmf.enable = true; + package = pkgs.qemu_kvm; + runAsRoot = true; + verbatimConfig = '' + namespaces = [] + ''; + }; + }; + spiceUSBRedirection.enable = true; + }; + systemd.packages = with pkgs; [lact]; + services.udev.packages = with pkgs; [xr-hardware]; + systemd.services.lactd.wantedBy = ["multi-user.target"]; + networking.hostName = "apollo"; # Define your hostname. + services.udev.extraRules = '' + # Qualcomm EDL +SUBSYSTEMS=="usb", ATTRS{idVendor}=="05c6", ATTRS{idProduct}=="9008", MODE="0666", GROUP="plugdev" +''; + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + + # 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 + hardware.graphics = { + enable = true; + enable32Bit = true; + + extraPackages = with pkgs; [mesa.opencl libvdpau-va-gl vaapiVdpau vulkan-validation-layers]; + extraPackages32 = with pkgs; [driversi686Linux.amdvlk driversi686Linux.mesa.opencl]; + }; + environment.variables = { + ROC_ENABLE_PRE_VEGA = "1"; + }; + networking.networkmanager = { + enable = true; + wifi.backend = "iwd"; + }; + programs.gphoto2.enable = true; + # Set your time zone. + time.timeZone = "Australia/Perth"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_AU.UTF-8"; + nix.settings.experimental-features = "nix-command flakes"; + services.udisks2.enable = true; + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_AU.UTF-8"; + LC_IDENTIFICATION = "en_AU.UTF-8"; + LC_MEASUREMENT = "en_AU.UTF-8"; + LC_MONETARY = "en_AU.UTF-8"; + LC_NAME = "en_AU.UTF-8"; + LC_NUMERIC = "en_AU.UTF-8"; + LC_PAPER = "en_AU.UTF-8"; + LC_TELEPHONE = "en_AU.UTF-8"; + LC_TIME = "en_AU.UTF-8"; + }; + + # Enable the X11 windowing system. + services.xserver.enable = true; + programs.dconf.enable = true; + + # Configure keymap in X11 + services.xserver.xkb = { + layout = "us"; + variant = ""; + }; + xdg.portal.config.common.default = "*"; + xdg.portal.wlr = { + enable = true; + settings = { + screencast = { + chooser_type = "simple"; + chooser_cmd = "${pkgs.slurp}/bin/slurp -f %o -or"; + exec_before = "${lib.getExe' pkgs.swaynotificationcenter "swaync-client"} --dnd-on --skip-wait"; + exec_after = "${lib.getExe' pkgs.swaynotificationcenter "swaync-client"} --dnd-off --skip-wait"; + }; + }; + }; + # Enable CUPS to print documents. + services.printing.enable = true; + nixpkgs.overlays = [ + (self: super: { + vlc = super.vlc.override { + libbluray = super.libbluray.override { + withAACS = true; + withBDplus = true; + }; + }; + }) + + + ]; + # Enable sound with pipewire. + services.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; + }; + + # Enable touchpad support (enabled default in most desktopManager). + # services.xserver.libinput.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.maya = { + isNormalUser = true; + description = "Maya"; + extraGroups = [ "networkmanager" "wheel" "libvirtd" "qemu-libvirt" "camera" "input" "adbusers"]; + }; + + # Install firefox. + programs.firefox.enable = true; + services.libinput.enable = true; + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + # 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 + neovim + git + lact + keepassxc + looking-glass-client + ddcutil + xrizer + wayvr-dashboard + ]; + + # 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; + }; + systemd.tmpfiles.rules = [ + "f /dev/shm/looking-glass 0660 maya qemu-libvirtd -" + ]; + + # List services that you want to enable: + + # Enable the OpenSSH daemon. + # services.openssh.enable = true; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # 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.11"; # Did you read the comment? + +} diff --git a/base/apollo/default.nix b/base/apollo/default.nix new file mode 100644 index 0000000..356c865 --- /dev/null +++ b/base/apollo/default.nix @@ -0,0 +1,12 @@ +{config, pkgs, ...}:{ + imports = [ + ./configuration.nix + ../overrides.nix + ../ssh.nix +# ../firewall.nix + ../substituters.nix + ../fonts.nix +# ../udev.nix + ../greetd.nix + ]; +} diff --git a/base/apollo/hardware-configuration.nix b/base/apollo/hardware-configuration.nix new file mode 100644 index 0000000..dd27824 --- /dev/null +++ b/base/apollo/hardware-configuration.nix @@ -0,0 +1,69 @@ +# 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") + ]; + + hardware.bluetooth = { + enable = true; + powerOnBoot = true; + settings = { + General.Experimental = true; + }; + input = { + General.ClassicBondedOnly = false; + General.UserspaceHID = true; + }; + }; + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" "sr_mod" ]; + boot.initrd.kernelModules = [ "vfio_pci" "vfio" "vfio_iommu_type1" "vendor-reset" ]; + boot.kernelModules = [ "kvm-intel" "vfio_virqfd" "vhost-net" "v4l2loopback" "12c-dev" ]; + boot.extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback vendor-reset]; + boot.extraModprobeConfig = '' + options vfio-pci ids=1002:6fdf,1002:aaf0,1b21:1242 + options v4l2loopback devices=2 video_nr=1,2 card_label="OBS Cam, Virt Cam" exclusive_caps=1 + ''; + boot.blacklistedKernelModules = ["nouveau"]; + boot.kernelParams = [ "amdgpu.ppfeaturemask=0xffffffff" "intel_iommu=on" "iommu=pt" "pcie_acs_override=downstream,multifunction" "preempt=voluntary" "module_blacklist=nouveau" ]; + + + fileSystems."/" = + { device = "/dev/disk/by-uuid/3367079b-0477-4088-b57d-90a8098bdef7"; + fsType = "xfs"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/8DE9-D26C"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + fileSystems."/mnt/vms" = + { device = "/dev/disk/by-uuid/9443885e-d2b3-44a1-aec2-540de7f5c832"; + fsType = "xfs"; + options = [ "x-gvfs-show" ]; + }; + fileSystems."/mnt/data" = + { device = "/dev/disk/by-uuid/a4a08196-cedc-4be2-988d-d28eb41492c0"; + fsType = "xfs"; + options = [ "x-gvfs-show" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/f7e4a77c-0936-445c-8ce9-0386e9e81656"; } + ]; + + # 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.enp0s31f6.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp7s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/base/callisto/configuration.nix b/base/callisto/configuration.nix new file mode 100644 index 0000000..e15ecff --- /dev/null +++ b/base/callisto/configuration.nix @@ -0,0 +1,294 @@ +# 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, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + #hardware.thinkpad-dock = { + # enable = true; + # dockEvent = "${pkgs.wlr-randr}/bin/wlr-randr --output eDP-1 --pos 0,1362"; + # undockEvent = "${pkgs.wlr-randr}/bin/wlr-randr --output eDP-1 --pos 0,0"; + #}; + programs.gamemode.enable = true; + + virtualisation.kvmgt = { + enable = true; + vgpus = { + "i915-GVTg_V4_4" = { + uuid = [ "b4c3049a-74a1-11ef-8112-df4a4be644fd" ]; + }; + }; + }; + services.gvfs.enable = true; + security.sudo.package = pkgs.sudo.override { withInsults = true; }; + programs.thunderbird.enable = true; + services.kmonad = { + enable = true; + keyboards.thinkpad = { + device = "/dev/input/by-path/platform-i8042-serio-0-event-kbd"; + config = (builtins.readFile ./keymap.kbd); + defcfg = { + enable = true; + fallthrough = true; + compose.key = null; + }; + }; + }; + programs.steam.enable = true; + virtualisation.libvirtd = { + enable = true; + qemu = { + package = pkgs.qemu_kvm; + runAsRoot = true; + swtpm.enable = true; + ovmf = { + enable = true; + packages = [(pkgs.OVMF.override { + secureBoot = true; + tpmSupport = true; + }).fd]; + }; + }; + }; + services.gnome.gnome-keyring.enable = true; + programs.virt-manager.enable = true; + hardware.bluetooth = { + enable = true; + powerOnBoot = true; + }; + services.tailscale = { + enable = true; + useRoutingFeatures = "client"; + }; + services.blueman.enable = true; + programs.adb.enable = true; + services.acpid = { + enable = true; + handlers = { + pauseOnDisconnect = { + event = "jack/headphone HEADPHONE unplug"; + action = "${pkgs.sudo}/bin/sudo -u maya XDG_RUNTIME_DIR=/run/user/1000/ ${pkgs.playerctl}/bin/playerctl pause"; + }; + }; + }; + programs.kdeconnect.enable = true; + programs.dconf.enable = true; + + systemd.services = { + NetworkManager.requires = ["ModemManager.service"]; + }; + + programs.niri = { + enable = true; + package = inputs.niri.packages.${pkgs.stdenv.hostPlatform.system}.niri-unstable; + }; + services.tlp.enable = true; + services.tlp.settings = { + CPU_SCALING_GOVERNOR_ON_BAT = "ondemand"; + CPU_SCALING_GOVERNOR_ON_AC = "performance"; + }; + hardware.graphics = { + enable = true; + extraPackages = with pkgs; [ + mesa + mesa.drivers + intel-media-sdk + intel-vaapi-driver + libvdpau-va-gl + ]; + enable32Bit = true; + extraPackages32 = with pkgs.pkgsi686Linux; [ + intel-vaapi-driver + mesa + mesa.drivers + libvdpau-va-gl + ]; + }; + environment.sessionVariables = { LIBVA_DRIVER_NAME = "i965"; ELECTRON_OZONE_PLATFORM_HINT = "wayland"; PASSWORD_STORE_DIR = "$HOME/sync/general/pass";}; + security.polkit.enable = true; + security.pam = { + services.gtklock = {}; + services.greetd = { + enableGnomeKeyring = true; + gnupg.enable = true; + }; + services.login = { + enableGnomeKeyring = true; + gnupg.enable = true; + }; + }; + services.fprintd.enable = true; + services.udisks2.enable = true; + # Bootloader. + boot.loader.systemd-boot.enable = false; + boot.loader.limine = { + enable = true; + style.wallpapers = [ ]; + additionalFiles = { + "efi/memtest86/memtest86.efi" = "${pkgs.memtest86-efi}/BOOTX64.efi"; + "efi/shell.efi" = "${pkgs.edk2-uefi-shell}/shell.efi"; + + }; + extraEntries = '' + /memtest86 + protocol: efi + path: boot():/limine/efi/memtest86/memtest86.efi + /shell + protocol: efi + path: boot():/limine/efi/shell.efi + ''; + + }; + boot.loader.efi.canTouchEfiVariables = false; + + networking.hostName = "callisto"; # Define your hostname. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + systemd.services.trackpad-fix = { + description = "Fixes the thinkpad touchpad being total shit"; + serviceConfig = { + Type = "simple"; + ExecStart = "${pkgs.tcl-8_6}/bin/tclsh /home/maya/unshit.tcl"; + ExecStop = "pkill tclsh"; + Restart = "on-failure"; + }; + wantedBy = ["default.target"]; + + + }; + systemd.services.fuckyou = { + description = "h"; + after = ["suspend.target"]; + wantedBy = ["suspend.target"]; + serviceConfig = { + Type = "simple"; + ExecStart = "systemctl --no-block restart trackpad-fix.service"; + }; + }; + + # 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 = "Australia/Perth"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_AU.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_AU.UTF-8"; + LC_IDENTIFICATION = "en_AU.UTF-8"; + LC_MEASUREMENT = "en_AU.UTF-8"; + LC_MONETARY = "en_AU.UTF-8"; + LC_NAME = "en_AU.UTF-8"; + LC_NUMERIC = "en_AU.UTF-8"; + LC_PAPER = "en_AU.UTF-8"; + LC_TELEPHONE = "en_AU.UTF-8"; + LC_TIME = "en_AU.UTF-8"; + }; + + # Enable the X11 windowing system. + services.xserver.enable = true; + + # Enable the GNOME Desktop Environment. + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + # Configure keymap in X11 + services.xserver = { + xkb.layout = "au"; + xkb.variant = ""; + }; + + # Enable CUPS to print documents. + services.printing.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; + }; + + # Enable touchpad support (enabled default in most desktopManager). + # services.xserver.libinput.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.maya = { + isNormalUser = true; + description = "Maya"; + extraGroups = [ "networkmanager" "wheel" "libvirtd" "input" "uinput" "dialout" ]; + packages = with pkgs; [ + # thunderbird + git + tree + ]; + }; + + # Install firefox. + programs.firefox.enable = true; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + # 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. + lutris + playerctl + undervolt + s-tui + stress + xfsprogs + protonvpn-gui + memtest86-efi + edk2-uefi-shell + xwayland-satellite + # wget + ]; + + # 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 = true; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # 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? + +} diff --git a/base/callisto/default.nix b/base/callisto/default.nix new file mode 100644 index 0000000..1749f88 --- /dev/null +++ b/base/callisto/default.nix @@ -0,0 +1,11 @@ +{config, pkgs, ...}:{ + imports = [ + ./configuration.nix + ../overrides.nix + ../ssh.nix + ../firewall.nix + ../substituters.nix + ../fonts.nix + ../udev.nix + ]; +} diff --git a/base/callisto/hardware-configuration.nix b/base/callisto/hardware-configuration.nix new file mode 100644 index 0000000..952d835 --- /dev/null +++ b/base/callisto/hardware-configuration.nix @@ -0,0 +1,49 @@ +# 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" "ehci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelParams = [ "resume" ]; + services.undervolt = { + enable = true; + tempBat = 80; + tempAc = 95; + coreOffset = -73; + gpuOffset = -95; + }; + boot.kernelModules = [ "kvm-intel" "sierra_net" ]; + boot.extraModulePackages = [ ]; + boot.kernelPackages = pkgs.linuxPackages_xanmod_latest; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/1395f53e-3fcd-46fc-848e-d14cf332cb73"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/A024-3E55"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = [ { device = "/dev/disk/by-uuid/0aabcebe-6b84-411f-b59e-d327f91cc799"; } ]; + + # 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.enp0s25.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wwp0s20u4.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/base/fonts.nix b/base/fonts.nix index f8ee4b5..a8d8eb8 100644 --- a/base/fonts.nix +++ b/base/fonts.nix @@ -11,4 +11,4 @@ source-han-serif-japanese comfortaa ]; -}; +} diff --git a/base/greetd.nix b/base/greetd.nix index dfb5ab9..da74d7f 100644 --- a/base/greetd.nix +++ b/base/greetd.nix @@ -14,6 +14,6 @@ StandardError = "journal"; TTYReset = "true"; TTYHangup = "true"; - TTYVTDisallocate = "true;" + TTYVTDisallocate = "true;"; }; } diff --git a/base/hassie/configuration.nix b/base/hassie/configuration.nix new file mode 100644 index 0000000..67a8c8e --- /dev/null +++ b/base/hassie/configuration.nix @@ -0,0 +1,194 @@ +# 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, lib, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + nix.package = pkgs.lix; + + programs = { + adb.enable = true; + firefox.enable = true; + fish.enable = true; + gamescope = { + enable = true; + capSysNice = false; + }; + steam = { + enable = true; + protontricks.enable = true; + extraPackages = with pkgs; [ + xorg.libXcursor + xorg.libXi + xorg.libXinerama + xorg.libXScrnSaver + xorg.libxcb + libpng + libpulseaudio + + flashrom.enable = true; + nix-ld.enable = true; + nix-ld.libraries = with pkgs; [xorg.libxcb libao xorg.libX11 libusb1 cargo rustc pkg-config cacert]; + }; + + services.journald.extraConfig = '' + SystemMaxUse=2G + ''; + + services.tailscale = { + enable = true; + useRoutingFeatures = "both"; + }; + + boot.supportedFilesystems = ["exfat" "ntfs" "xfs"]; + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.initrd.systemd.enable = true; + boot.initrd.kernelModules = [ "amdgpu" ]; + boot.loader.efi.efiSysMountPoint = "/boot/"; + boot.extraModulePackages = [ + config.boot.kernelPackages.v4l2loopback.out + ]; + boot.kernelPackages = pkgs.linuxKernel.packages.linux_xanmod_latest; + boot.kernel.sysctl = { + "vm.max_map_count" = 2147483642; + }; + + networking.hostName = "Katara"; # Define your hostname. + + powerManagement.cpuFreqGovernor = "performance"; + + # 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 + hardware.graphics = { + enable = true; + enable32Bit = true; + extraPackages = with pkgs; [mesa.opencl libvdpau-va-gl vaapiVdpau vulkan-validation-layers]; + extraPackages32 = with pkgs; [driversi686Linux.amdvlk driversi686Linux.mesa.opencl]; + }; + + hardware.bluetooth.enable = true; + services.blueman.enable = true; + + networking.networkmanager = { + enable = true; + wifi.backend = "iwd"; + }; + + # Set your time zone. + time.timeZone = "Europe/London"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_GB.UTF-8"; + + services.udisks2.enable = true; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_GB.UTF-8"; + LC_IDENTIFICATION = "en_GB.UTF-8"; + LC_MEASUREMENT = "en_GB.UTF-8"; + LC_MONETARY = "en_GB.UTF-8"; + LC_NAME = "en_GB.UTF-8"; + LC_NUMERIC = "en_GB.UTF-8"; + LC_PAPER = "en_GB.UTF-8"; + LC_TELEPHONE = "en_GB.UTF-8"; + LC_TIME = "en_GB.UTF-8"; + }; + + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 30d"; + }; + + systemd = { + user.services.polkit-gnome-authentication-agent-1 = { + description = "polkit-gnome-authentication-agent-1"; + wantedBy = [ "graphical-session.target" ]; + wants = [ "graphical-session.target" ]; + after = [ "graphical-session.target" ]; + serviceConfig = { + Type = "simple"; + ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; + Restart = "on-failure"; + RestartSec = 1; + TimeoutStopSec = 10; + }; + }; + }; + + + # Enable the X11 windowing system. + services.xserver.enable = true; + programs.dconf.enable = true; + + # Configure keymap in X11 + services.xserver.xkb = { + layout = "us"; + variant = "colemak"; + }; + + console.useXkbConfig = true; + + # Enable CUPS to print documents. + services.printing.enable = true; + services.printing.drivers = [pkgs.gutenprint]; + + security = { + rtkit.enable = true; + }; + + # Enable sound with pipewire. + services.pulseaudio.enable = false; + 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; + }; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.alyx = { + isNormalUser = true; + description = "Alyx"; + extraGroups = [ "networkmanager" "wheel" "camera" ]; + packages = with pkgs; [ + ]; + }; + + services.libinput.enable = true; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + environment.systemPackages = with pkgs; [ + wget + neovim + cbfstool + git + keepassxc + pulseaudio + winetricks + p7zip + cabextract + unzip + wineWowPackages.stable + (pkgs.python3.withPackages (ps: with ps; [tkinter])) + ]; + + system.stateVersion = "24.11"; # Did you read the comment? + +} diff --git a/base/hassie/default.nix b/base/hassie/default.nix new file mode 100644 index 0000000..54a1411 --- /dev/null +++ b/base/hassie/default.nix @@ -0,0 +1,9 @@ +{config, pkgs, ...}:{ + imports = [ + ./configuration.nix + ../overrides.nix + ../ssh.nix + ../substituters.nix + ../fonts.nix + ]; +} diff --git a/base/hassie/hardware-configuration.nix b/base/hassie/hardware-configuration.nix new file mode 100644 index 0000000..5988df1 --- /dev/null +++ b/base/hassie/hardware-configuration.nix @@ -0,0 +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, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/c52b3f2c-e748-4bc4-a6b4-5397d100a7c4"; + fsType = "xfs"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/D5B1-F4F1"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/7cc31bef-57a8-468a-be01-a162bea959b2"; } + ]; + + # 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.enp0s25.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wwp0s20u3i12.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/base/hypermac/configuration.nix b/base/hypermac/configuration.nix new file mode 100644 index 0000000..95f0571 --- /dev/null +++ b/base/hypermac/configuration.nix @@ -0,0 +1,154 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page, on +# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). + +{ config, lib, pkgs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + programs.gamemode.enable = true; + boot.loader = { + efi.canTouchEfiVariables = false; + grub = { + efiSupport = true; + efiInstallAsRemovable = true; + device = "nodev"; + forcei686 = true; + }; + }; + + programs.adb.enable = true; + environment.variables = { + WLR_NO_HARDWARE_CURSORS = "1"; + }; + networking.hostName = "hypermac"; # Define your hostname. + # Pick only one of the below networking options. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. + + # Set your time zone. + time.timeZone = "Australia/Perth"; + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_AU.UTF-8"; + # console = { + # font = "Lat2-Terminus16"; + # keyMap = "us"; + # useXkbConfig = true; # use xkb.options in tty. + # }; + nix.settings.experimental-features = "nix-command flakes"; + # Enable the X11 windowing system. + services.xserver.enable = true; + nixpkgs.config.allowUnfree = true; + services.xserver.videoDrivers = [ "nouveau" ]; + hardware.graphics = { + enable = true; + enable32Bit = true; + extraPackages = with pkgs; [ + mesa + mesa.drivers + vulkan-validation-layers + libvdpau-va-gl + vaapiVdpau + ]; + extraPackages32 = with pkgs; [ + driversi686Linux.mesa + ]; + }; + + fonts.fontconfig.defaultFonts = { + serif = ["Noto Serif" "Source Han Serif"]; + sansSerif = ["Noto Sans" "Source Han Sans"]; + }; + # Configure keymap in X11 + # services.xserver.xkb.layout = "us"; + # services.xserver.xkb.options = "eurosign:e,caps:escape"; + + # Enable CUPS to print documents. + # services.printing.enable = true; + + # Enable sound. + services.pipewire = { + enable = true; + audio.enable = true; + pulse.enable = true; + alsa = { + enable = true; + support32Bit = true; + }; + jack.enable = true; + }; + programs.dconf.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.maya = { + isNormalUser = true; + extraGroups = [ "wheel" "adbusers" ]; # Enable ‘sudo’ for the user. + packages = with pkgs; [ + tree + ]; + }; + security.polkit.enable = true; + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + neovim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + wget + firefox + lutris + alacritty + libsForQt5.qt5ct + git + ]; + + # 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 = true; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; + # Copy the NixOS configuration file and link it from the resulting system + # (/run/current-system/configuration.nix). This is useful in case you + # accidentally delete configuration.nix. + # system.copySystemConfiguration = true; + + # This option defines the first version of NixOS you have installed on this particular machine, + # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. + # + # Most users should NEVER change this value after the initial install, for any reason, + # even if you've upgraded your system to a new NixOS release. + # + # This value does NOT affect the Nixpkgs version your packages and OS are pulled from, + # so changing it will NOT upgrade your system. + # + # This value being lower than the current NixOS release does NOT mean your system is + # out of date, out of support, or vulnerable. + # + # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, + # and migrated your data accordingly. + # + # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . + system.stateVersion = "23.11"; # Did you read the comment? + +} + diff --git a/base/hypermac/default.nix b/base/hypermac/default.nix new file mode 100644 index 0000000..4c1eb4b --- /dev/null +++ b/base/hypermac/default.nix @@ -0,0 +1,11 @@ +{config, pkgs, ...}:{ + imports = [ + ./configuration.nix + ../overrides.nix + ../ssh.nix + ../firewall.nix + ../substituters.nix + ../fonts.nix + ../greetd.nix + ]; +} diff --git a/base/hypermac/hardware-configuration.nix b/base/hypermac/hardware-configuration.nix new file mode 100644 index 0000000..ed0879e --- /dev/null +++ b/base/hypermac/hardware-configuration.nix @@ -0,0 +1,41 @@ +# 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 = [ "ohci_pci" "ehci_pci" "ahci" "firewire_ohci" "uas" "usb_storage" "usbhid" "sd_mod" "sr_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "wl" "nouveau" ]; + boot.kernelParams = [ "noefi" ]; + boot.blacklistedKernelModules = [ "nvidia" "nvidia_uvm" "nvidia_drm" "nvidia_modeset" ]; + boot.extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ]; + boot.kernelPackages = pkgs.linuxPackages-rt_latest; + fileSystems."/" = + { device = "/dev/disk/by-uuid/a8237e2f-c6e5-4818-8e29-aeecedc9e57a"; + fsType = "xfs"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/DA2E-30B9"; + fsType = "vfat"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/472810b1-cbb6-4812-b0ab-b3539c432dc2"; } + ]; + + # 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; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/base/overrides.nix b/base/overrides.nix index 33e4721..4eb63e7 100644 --- a/base/overrides.nix +++ b/base/overrides.nix @@ -1,8 +1,5 @@ -{pkgs, ...}:{ - environment.systemPackages = with pkgs; [ - (envision.overrideAttrs { - buildInputs = [pkgs.mesa]; - }) +{pkgs, config, ...}:{ + environment.systemPackages = with pkgs; [ (lutris.override { extraPkgs = pkgs: [ wineWowPackages.waylandFull @@ -40,4 +37,33 @@ ]; }) ]; + programs.steam = { + enable = true; + extest.enable = true; + protontricks.enable = true; + extraPackages = with pkgs; [ + xorg.libXcursor + xorg.libXi + xorg.libXinerama + xorg.libXScrnSaver + xorg.libxcb + libpng + libpulseaudio + libvorbis + stdenv.cc.cc.lib + libkrb5 + keyutils + gamemode + procps + usbutils + ] ++ config.fonts.packages; + extraCompatPackages = with pkgs; [ + steamtinkerlaunch + proton-ge-rtsp-bin + proton-ge-bin + ]; + remotePlay.openFirewall = true; # Open ports in the fire> + dedicatedServer.openFirewall = true; # Open ports in the> + localNetworkGameTransfers.openFirewall = true; # Open po> + }; } diff --git a/base/patio/configuration.nix b/base/patio/configuration.nix new file mode 100644 index 0000000..eb93eeb --- /dev/null +++ b/base/patio/configuration.nix @@ -0,0 +1,173 @@ +# 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, lib, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + nix.package = pkgs.lix; + + services.desktopManager.plasma6.enable = true; + jovian.devices.steamdeck.enable = true; + jovian.steam.autoStart = true; + jovian.steam.enable = true; + jovian.steam.user = "alyx"; + jovian.steam.desktopSession = "plasma"; + jovian.devices.steamdeck.autoUpdate = true; + + + programs = { + adb.enable = true; + firefox.enable = true; + fish.enable = true; + flashrom.enable = true; + nix-ld.enable = true; + nix-ld.libraries = with pkgs; [xorg.libxcb libao xorg.libX11 libusb1 cargo rustc pkg-config cacert]; + }; + + services.journald.extraConfig = '' + SystemMaxUse=2G + ''; + + hardware.steam-hardware.enable = true; + + services.tailscale = { + enable = true; + useRoutingFeatures = "both"; + }; + + boot.supportedFilesystems = ["exfat" "ntfs" "xfs"]; + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.initrd.systemd.enable = true; + boot.initrd.kernelModules = [ "amdgpu" ]; + boot.loader.efi.efiSysMountPoint = "/boot/"; + + networking.hostName = "patio"; # Define your hostname. + + powerManagement.cpuFreqGovernor = "performance"; + + # 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 + hardware.graphics = { + enable = true; + enable32Bit = true; + extraPackages = with pkgs; [libvdpau-va-gl vaapiVdpau vulkan-validation-layers rocmPackages.clr.icd]; + }; + + hardware.amdgpu = { + opencl.enable = true; + initrd.enable = true; + amdvlk.supportExperimental.enable = true; + amdvlk.support32Bit.enable = true; + amdvlk.enable = true; + }; + + hardware.bluetooth.enable = true; + services.blueman.enable = true; + + networking.networkmanager = { + enable = true; + wifi.backend = "iwd"; + }; + + # Set your time zone. + time.timeZone = "Europe/London"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_GB.UTF-8"; + + services.udisks2.enable = true; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_GB.UTF-8"; + LC_IDENTIFICATION = "en_GB.UTF-8"; + LC_MEASUREMENT = "en_GB.UTF-8"; + LC_MONETARY = "en_GB.UTF-8"; + LC_NAME = "en_GB.UTF-8"; + LC_NUMERIC = "en_GB.UTF-8"; + LC_PAPER = "en_GB.UTF-8"; + LC_TELEPHONE = "en_GB.UTF-8"; + LC_TIME = "en_GB.UTF-8"; + }; + + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 30d"; + }; + + # Enable the X11 windowing system. + services.xserver.enable = true; + programs.dconf.enable = true; + + # Configure keymap in X11 + services.xserver.xkb = { + layout = "us"; + variant = ""; + }; + + # Enable CUPS to print documents. + services.printing.enable = true; + services.printing.drivers = [pkgs.gutenprint]; + + security = { + rtkit.enable = true; + }; + + # Enable sound with pipewire. + services.pulseaudio.enable = false; + 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; + }; + + # Define a user account. Don't forget to set a password with ‘passwd’. + + users.users.alyx = { + isNormalUser = true; + description = "Alyx"; + extraGroups = [ "networkmanager" "wheel" "camera" ]; + packages = with pkgs; [ + ]; + }; + + services.libinput.enable = true; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + environment.systemPackages = with pkgs; [ + wget + neovim + cbfstool + git + keepassxc + pulseaudio + steamdeck-firmware + jupiter-dock-updater-bin + winetricks + p7zip + cabextract + unzip + wineWowPackages.stable + (pkgs.python3.withPackages (ps: with ps; [tkinter])) + ]; + + system.stateVersion = "24.11"; # Did you read the comment? + +} diff --git a/base/patio/default.nix b/base/patio/default.nix new file mode 100644 index 0000000..54a1411 --- /dev/null +++ b/base/patio/default.nix @@ -0,0 +1,9 @@ +{config, pkgs, ...}:{ + imports = [ + ./configuration.nix + ../overrides.nix + ../ssh.nix + ../substituters.nix + ../fonts.nix + ]; +} diff --git a/base/patio/hardware-configuration.nix b/base/patio/hardware-configuration.nix new file mode 100644 index 0000000..eec3f28 --- /dev/null +++ b/base/patio/hardware-configuration.nix @@ -0,0 +1,41 @@ +# 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 = [ "nvme" "xhci_pci" "usbhid" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/bab406a9-e86a-462c-9187-d94e71b3246c"; + fsType = "xfs"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/4DF5-0706"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/a133d06d-4112-443a-8b52-e278a6a66f0e"; } + ]; + + # 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.enp4s0f3u1u4c2.useDHCP = lib.mkDefault true; + # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/base/ssh.nix b/base/ssh.nix index a491825..ac56d08 100644 --- a/base/ssh.nix +++ b/base/ssh.nix @@ -3,8 +3,9 @@ services.openssh = { enable = true; settings = { - passwordAuthentication = false; + PasswordAuthentication = false; KbdInteractiveAuthentication = false; }; }; -}; +} + diff --git a/base/substituters.nix b/base/substituters.nix index 82f0472..f120590 100644 --- a/base/substituters.nix +++ b/base/substituters.nix @@ -1,16 +1,30 @@ -{inputs, config, pkgs, lib, ...}; { +{ + inputs, + config, + pkgs, + lib, + ... +}: { nix.settings.substituters = [ "https://nix-community.cachix.org" + "https://hyprland.cachix.org" "https://nixpkgs-wayland.cachix.org" "https://cache.garnix.io" - "https://niri.cachix.org" ]; - nix-settings.trusted-public-keys = [ + + nix.settings.trusted-substituters = [ + "https://nix-community.cachix.org" + "https://hyprland.cachix.org" + "https://nixpkgs-wayland.cachix.org" + "https://cache.garnix.io" + ]; + + nix.settings.trusted-public-keys = [ "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA=" "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" - "niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964=" ]; -}; +} diff --git a/base/todo b/base/todo deleted file mode 100644 index 962aa92..0000000 --- a/base/todo +++ /dev/null @@ -1 +0,0 @@ -drop config files in diff --git a/base/umbriel/configuration.nix b/base/umbriel/configuration.nix new file mode 100644 index 0000000..1816dbc --- /dev/null +++ b/base/umbriel/configuration.nix @@ -0,0 +1,211 @@ +# 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, lib, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + nix.package = pkgs.lix; + + programs = { + adb.enable = true; + firefox.enable = true; + fish.enable = true; + gamescope = { + enable = true; + capSysNice = false; + }; + flashrom.enable = true; + nix-ld.enable = true; + nix-ld.libraries = with pkgs; [xorg.libxcb libao xorg.libX11 libusb1 cargo rustc pkg-config cacert]; + }; + + services.journald.extraConfig = '' + SystemMaxUse=2G + ''; + + services.tailscale = { + enable = true; + useRoutingFeatures = "both"; + }; + + boot.supportedFilesystems = ["exfat" "ntfs" "xfs"]; + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + boot.initrd.systemd.enable = true; + boot.loader.efi.efiSysMountPoint = "/boot/"; + boot.kernelModules = [ "nvidia" "nvidia_modeset" "nvidia_uvm" "nvidia_drm" ]; + boot.extraModprobeConfig = "options nvidia_drm fbdev=1"; + boot.extraModulePackages = [ + config.boot.kernelPackages.v4l2loopback.out + ]; + boot.kernelPackages = pkgs.linuxKernel.packages.linux_xanmod_latest; + boot.kernel.sysctl = { + "vm.max_map_count" = 2147483642; + }; + + networking.hostName = "Umbriel"; # Define your hostname. + + powerManagement.cpuFreqGovernor = "performance"; + + # 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 + hardware.graphics = { + enable = true; + enable32Bit = true; + extraPackages = with pkgs; [amdvlk mesa.opencl libvdpau-va-gl vaapiVdpau intel-media-driver vaapiIntel nvidia-vaapi-driver vulkan-validation-layers]; + extraPackages32 = with pkgs; [driversi686Linux.amdvlk driversi686Linux.mesa.opencl]; + }; + + hardware.nvidia = { + modesetting.enable = true; + powerManagement.enable = true; + powerManagement.finegrained = true; + open = false; + nvidiaSettings = true; + nvidiaPersistenced = true; + package = config.boot.kernelPackages.nvidiaPackages.beta; + prime = { + intelBusId = "PCI:0:2:0"; + nvidiaBusId = "PCI:1:0:0"; + offload = { + enable = true; + enableOffloadCmd = true; + }; + }; + }; + + hardware.bluetooth.enable = true; + services.blueman.enable = true; + + networking.networkmanager = { + enable = true; + wifi.backend = "iwd"; + }; + + # Set your time zone. + time.timeZone = "Europe/London"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_GB.UTF-8"; + + services.udisks2.enable = true; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_GB.UTF-8"; + LC_IDENTIFICATION = "en_GB.UTF-8"; + LC_MEASUREMENT = "en_GB.UTF-8"; + LC_MONETARY = "en_GB.UTF-8"; + LC_NAME = "en_GB.UTF-8"; + LC_NUMERIC = "en_GB.UTF-8"; + LC_PAPER = "en_GB.UTF-8"; + LC_TELEPHONE = "en_GB.UTF-8"; + LC_TIME = "en_GB.UTF-8"; + }; + + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 30d"; + }; + + systemd = { + user.services.polkit-gnome-authentication-agent-1 = { + description = "polkit-gnome-authentication-agent-1"; + wantedBy = [ "graphical-session.target" ]; + wants = [ "graphical-session.target" ]; + after = [ "graphical-session.target" ]; + serviceConfig = { + Type = "simple"; + ExecStart = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; + Restart = "on-failure"; + RestartSec = 1; + TimeoutStopSec = 10; + }; + }; + }; + + + # Enable the X11 windowing system. + services.xserver.enable = true; + services.xserver.videoDrivers = [ "nvidia" "i915" ]; + programs.dconf.enable = true; + + # Configure keymap in X11 + services.xserver.xkb = { + layout = "us"; + variant = "colemak"; + }; + + # Enable CUPS to print documents. + services.printing.enable = true; + services.printing.drivers = [pkgs.gutenprint]; + + security = { + rtkit.enable = true; + }; + + # Enable sound with pipewire. + services.pulseaudio.enable = false; + 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; + }; + + # Define a user account. Don't forget to set a password with ‘passwd’. + + users.users.alyx = { + isNormalUser = true; + description = "Alyx"; + extraGroups = [ "networkmanager" "wheel" "camera" ]; + packages = with pkgs; [ + ]; + }; + + nixpkgs.config.packageOverrides = pkgs: { + vaapiIntel = pkgs.vaapiIntel.override {enableHybridCodec = true;}; + }; + + services.libinput.enable = true; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + environment.systemPackages = with pkgs; [ + wget + neovim + cbfstool + git + keepassxc + pulseaudio + winetricks + p7zip + cabextract + unzip + wineWowPackages.stable + vulkan-extension-layer + vulkan-loader + vulkan-tools + (pkgs.python3.withPackages (ps: with ps; [tkinter])) + ]; + + powerManagement.powertop.enable = true; + services.thermald.enable = true; + + system.stateVersion = "24.11"; # Did you read the comment? + +} diff --git a/base/umbriel/default.nix b/base/umbriel/default.nix new file mode 100644 index 0000000..54a1411 --- /dev/null +++ b/base/umbriel/default.nix @@ -0,0 +1,9 @@ +{config, pkgs, ...}:{ + imports = [ + ./configuration.nix + ../overrides.nix + ../ssh.nix + ../substituters.nix + ../fonts.nix + ]; +} diff --git a/base/umbriel/hardware-configuration.nix b/base/umbriel/hardware-configuration.nix new file mode 100644 index 0000000..4a4b5fa --- /dev/null +++ b/base/umbriel/hardware-configuration.nix @@ -0,0 +1,41 @@ +# 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" "nvme" "usb_storage" "sd_mod" "rtsx_usb_sdmmc" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/a9d406d6-c188-4a65-91f7-ead5fd091e19"; + fsType = "xfs"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/5216-71E6"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/852efacc-eea6-4d3b-af82-b43e30a7d1c4"; } + ]; + + # 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.enp0s31f6.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..5d33ce4 --- /dev/null +++ b/flake.lock @@ -0,0 +1,590 @@ +{ + "nodes": { + "catppuccin": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1750153510, + "narHash": "sha256-NYHXXJZ9m4fJpKk9tKn/EExX87SqcBcRINOGF7hKRLI=", + "owner": "catppuccin", + "repo": "nix", + "rev": "4e95eaf8a351956d75cc400318579967ca2b6d0f", + "type": "github" + }, + "original": { + "owner": "catppuccin", + "repo": "nix", + "type": "github" + } + }, + "flake-compat": { + "locked": { + "lastModified": 1733328505, + "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", + "revCount": 69, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.1.0/01948eb7-9cba-704f-bbf3-3fa956735b52/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1749398372, + "narHash": "sha256-tYBdgS56eXYaWVW3fsnPQ/nFlgWi/Z2Ymhyu21zVM98=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "9305fe4e5c2a6fcf5ba6a3ff155720fbe4076569", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1750798083, + "narHash": "sha256-DTCCcp6WCFaYXWKFRA6fiI2zlvOLCf5Vwx8+/0R8Wc4=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "ff31a4677c1a8ae506aa7e003a3dba08cb203f82", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "ixx": { + "inputs": { + "flake-utils": [ + "nixvim", + "nuschtosSearch", + "flake-utils" + ], + "nixpkgs": [ + "nixvim", + "nuschtosSearch", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1748294338, + "narHash": "sha256-FVO01jdmUNArzBS7NmaktLdGA5qA3lUMJ4B7a05Iynw=", + "owner": "NuschtOS", + "repo": "ixx", + "rev": "cc5f390f7caf265461d4aab37e98d2292ebbdb85", + "type": "github" + }, + "original": { + "owner": "NuschtOS", + "ref": "v0.0.8", + "repo": "ixx", + "type": "github" + } + }, + "jovian": { + "inputs": { + "nix-github-actions": "nix-github-actions", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1750403547, + "narHash": "sha256-XDDINMbHTtKQeSRpX5mwq20z23Wg/I/G4JUinA3V8Xg=", + "owner": "Jovian-Experiments", + "repo": "Jovian-NixOS", + "rev": "52b86b86d925ec00c836ecc6d36f9c947bb15736", + "type": "github" + }, + "original": { + "owner": "Jovian-Experiments", + "repo": "Jovian-NixOS", + "type": "github" + } + }, + "niri": { + "inputs": { + "niri-stable": "niri-stable", + "niri-unstable": "niri-unstable", + "nixpkgs": "nixpkgs_3", + "nixpkgs-stable": "nixpkgs-stable", + "xwayland-satellite-stable": "xwayland-satellite-stable", + "xwayland-satellite-unstable": "xwayland-satellite-unstable" + }, + "locked": { + "lastModified": 1750794604, + "narHash": "sha256-DUp4TiFrkQRGdbbcLJJqYlLBNSV2cnOavXWshSq9634=", + "owner": "sodiboo", + "repo": "niri-flake", + "rev": "e25d4210316a72df39459e460050257f397021fe", + "type": "github" + }, + "original": { + "owner": "sodiboo", + "repo": "niri-flake", + "type": "github" + } + }, + "niri-stable": { + "flake": false, + "locked": { + "lastModified": 1748151941, + "narHash": "sha256-z4viQZLgC2bIJ3VrzQnR+q2F3gAOEQpU1H5xHtX/2fs=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "8ba57fcf25d2fc9565131684a839d58703f1dae7", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "ref": "v25.05.1", + "repo": "niri", + "type": "github" + } + }, + "niri-unstable": { + "flake": false, + "locked": { + "lastModified": 1750791124, + "narHash": "sha256-F5iVU/hjoSHSSe0gllxm0PcAaseEtGNanYK5Ha3k2Tg=", + "owner": "YaLTeR", + "repo": "niri", + "rev": "37458d94b288945f6cfbd3c5c233f634d59f246c", + "type": "github" + }, + "original": { + "owner": "YaLTeR", + "repo": "niri", + "type": "github" + } + }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "jovian", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1729697500, + "narHash": "sha256-VFTWrbzDlZyFHHb1AlKRiD/qqCJIripXKiCSFS8fAOY=", + "owner": "zhaofengli", + "repo": "nix-github-actions", + "rev": "e418aeb728b6aa5ca8c5c71974e7159c2df1d8cf", + "type": "github" + }, + "original": { + "owner": "zhaofengli", + "ref": "matrix-name", + "repo": "nix-github-actions", + "type": "github" + } + }, + "nix-index-database": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1750565152, + "narHash": "sha256-A6ZIoIgaPPkzIVxKuaxwEJicPOeTwC/MD9iuC3FVhDM=", + "owner": "nix-community", + "repo": "nix-index-database", + "rev": "78cd697acc2e492b4e92822a4913ffad279c20e6", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-index-database", + "type": "github" + } + }, + "nix-system-graphics": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1737457219, + "narHash": "sha256-nX9dxoATDCSQgWw/iv6BngXDJEyHVYYEvHEVQ7Ig3fI=", + "owner": "soupglasses", + "repo": "nix-system-graphics", + "rev": "9c875e0c56cf2eb272b9102a4f3e24e4e31629fd", + "type": "github" + }, + "original": { + "owner": "soupglasses", + "repo": "nix-system-graphics", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1744463964, + "narHash": "sha256-LWqduOgLHCFxiTNYi3Uj5Lgz0SR+Xhw3kr/3Xd0GPTM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "2631b0b7abcea6e640ce31cd78ea58910d31e650", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1750622754, + "narHash": "sha256-kMhs+YzV4vPGfuTpD3mwzibWUE6jotw5Al2wczI0Pv8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c7ab75210cb8cb16ddd8f290755d9558edde7ee1", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-xr": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs_5", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1750617326, + "narHash": "sha256-5H83I4cCw1XAduNneFzJ4momXFbujNvhTaAdFUjPLgw=", + "owner": "nix-community", + "repo": "nixpkgs-xr", + "rev": "860b5a8c984f161d1d15bb7bd841a4cce1dc2c22", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs-xr", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1747744144, + "narHash": "sha256-W7lqHp0qZiENCDwUZ5EX/lNhxjMdNapFnbErcbnP11Q=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "2795c506fe8fb7b03c36ccb51f75b6df0ab2553f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1750506804, + "narHash": "sha256-VLFNc4egNjovYVxDGyBYTrvVCgDYgENp5bVi9fPTDYc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "4206c4cb56751df534751b058295ea61357bbbaa", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { + "locked": { + "lastModified": 1750506804, + "narHash": "sha256-VLFNc4egNjovYVxDGyBYTrvVCgDYgENp5bVi9fPTDYc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "4206c4cb56751df534751b058295ea61357bbbaa", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_5": { + "locked": { + "lastModified": 1750365781, + "narHash": "sha256-XE/lFNhz5lsriMm/yjXkvSZz5DfvKJLUjsS6pP8EC50=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "08f22084e6085d19bcfb4be30d1ca76ecb96fe54", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_6": { + "locked": { + "lastModified": 1750731501, + "narHash": "sha256-Ah4qq+SbwMaGkuXCibyg+Fwn00el4KmI3XFX6htfDuk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "69dfebb3d175bde602f612915c5576a41b18486b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixvim": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs_6", + "nuschtosSearch": "nuschtosSearch", + "systems": "systems_3" + }, + "locked": { + "lastModified": 1750788551, + "narHash": "sha256-7tQIndetzeVtTuYQ7vYTaABUS1muiigdXK3XyXuPzvg=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "6a15c2ffc50ca7998df2fd6b86c3c9f298e9137a", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixvim", + "type": "github" + } + }, + "nuschtosSearch": { + "inputs": { + "flake-utils": "flake-utils_2", + "ixx": "ixx", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1749730855, + "narHash": "sha256-L3x2nSlFkXkM6tQPLJP3oCBMIsRifhIDPMQQdHO5xWo=", + "owner": "NuschtOS", + "repo": "search", + "rev": "8dfe5879dd009ff4742b668d9c699bc4b9761742", + "type": "github" + }, + "original": { + "owner": "NuschtOS", + "repo": "search", + "type": "github" + } + }, + "root": { + "inputs": { + "catppuccin": "catppuccin", + "home-manager": "home-manager", + "jovian": "jovian", + "niri": "niri", + "nix-index-database": "nix-index-database", + "nix-system-graphics": "nix-system-graphics", + "nixpkgs": "nixpkgs_4", + "nixpkgs-xr": "nixpkgs-xr", + "nixvim": "nixvim", + "system-manager": "system-manager" + } + }, + "system-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1748252092, + "narHash": "sha256-6nL55wvV7SthEXaXDiQo8xxkxQLAVcNBU21YJ7GJLm8=", + "owner": "numtide", + "repo": "system-manager", + "rev": "c6850451ef769fd03d0ad5474f928b916aa23775", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "system-manager", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs-xr", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1749194973, + "narHash": "sha256-eEy8cuS0mZ2j/r/FE0/LYBSBcIs/MKOIVakwHVuqTfk=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "a05be418a1af1198ca0f63facb13c985db4cb3c5", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, + "xwayland-satellite-stable": { + "flake": false, + "locked": { + "lastModified": 1748488455, + "narHash": "sha256-IiLr1alzKFIy5tGGpDlabQbe6LV1c9ABvkH6T5WmyRI=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "3ba30b149f9eb2bbf42cf4758d2158ca8cceef73", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "ref": "v0.6", + "repo": "xwayland-satellite", + "type": "github" + } + }, + "xwayland-satellite-unstable": { + "flake": false, + "locked": { + "lastModified": 1750686869, + "narHash": "sha256-FS/rYXd96VBtKNJRTV2xTpTk8CgrYP+lFsFj0+VKgoY=", + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "rev": "117af56a83e2d1d25016fbd504a2a040babe586a", + "type": "github" + }, + "original": { + "owner": "Supreeeme", + "repo": "xwayland-satellite", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index fded022..b8ef19b 100644 --- a/flake.nix +++ b/flake.nix @@ -21,14 +21,16 @@ outputs = inputs@{ self, nixpkgs, home-manager, system-manager, niri, nixpkgs-xr, jovian, ...}:{ nixosConfigurations."Absolution" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; + specialArgs = { inherit inputs; }; modules = [ - ./base/Absolution + ./base/absolution nixpkgs-xr.nixosModules.nixpkgs-xr home-manager.nixosModules.home-manager { home-manager.extraSpecialArgs = { inherit inputs; vars = { isNixOS = true; + isTough = false; class = "desktop"; user = "alyx"; }; @@ -49,13 +51,14 @@ inherit inputs; vars = { isNixOS = true; + isTough = false; class = "desktop"; user = "maya"; useSyncthing = true; }; }; home-manager.useGlobalPkgs = true; - home-manager.useUserPkgs = true; + home-manager.useUserPackages = true; home-manager.users.maya = ./home; } ]; diff --git a/home/default.nix b/home/default.nix new file mode 100644 index 0000000..460fc99 --- /dev/null +++ b/home/default.nix @@ -0,0 +1,116 @@ +{config, pkgs, lib, inputs, vars, ...}:{ + imports = [ + #home-manager modules + inputs.nix-index-database.hmModules.nix-index + inputs.nixvim.homeManagerModules.default + inputs.catppuccin.homeModules.catppuccin + inputs.niri.homeModules.niri + #aux files to make finding specific things easier + ./theming.nix + ./nixvim + #./sway.nix + #./hyprland.nix + ./niri.nix + ./packages.nix #general user packages not managed by home-manager but i want to install via hm anyways + ]; + home = rec { + username = vars.user; #this is set in flake.nix + homeDirectory = "/home/${username}"; #change this if you use a non-standard home dir + stateVersion = "23.11"; + file = { + ".config/waybar/config".source = config.lib.file.mkOutOfStoreSymlink "${homeDirectory}/.config/nixos/home/waybar/config"; + ".config/waybar/style.css".source = config.lib.file.mkOutOfStoreSymlink "${homeDirectory}/.config/nixos/home/waybar/style.css"; +# ".config/hypr/hyprlock.conf".source = config.lib.file.mkOutOfStoreSymlink "${homeDirectory}/.config/nixos/home/locking/hyprlock.conf"; + }; + }; + programs.home-manager.enable = (!vars.isNixOS); #value is set in flake.nix + programs.foot = { + enable = true; + settings.main.font = "monospace:size=14"; + settings.colors.alpha = "0.9"; + }; + programs.ncmpcpp = { + enable = (vars.class != "handheld"); + settings = { + tags_separator = ";"; + }; + }; + services.mpd = { + enable = (vars.class != "handheld"); + musicDirectory = "/home/${vars.user}/Music"; + extraConfig = '' + audio_output { + type "pipewire" + name "default pipewire" + } + ''; + }; + services.mpd-mpris = { + enable = (vars.class != "handheld"); + }; + + services.mpd-discord-rpc.enable = true; + + programs.waybar = { + enable = (vars.class != "handheld"); + }; + programs.git = { + enable = true; + userName = "cydiralis"; + userEmail = "cydiralis@proton.me"; + extraConfig = { + commit.gpgsign = true; + gpg.format = "ssh"; + user.signingkey = "~/.ssh/id_ed25519.pub"; + init.defaultBranch = "main"; + }; + }; + + xdg.configFile."openxr/1/active_runtime.json".source = "${pkgs.monado}/share/openxr/1/openxr_monado.json"; + + xdg.configFile."openvr/openvrpaths.vrpath".text = '' + { + "config" : + [ + "${config.xdg.dataHome}/Steam/config" + ], + "external_drivers" : null, + "jsonid" : "vrpathreg", + "log" : + [ + "${config.xdg.dataHome}/Steam/logs" + ], + "runtime" : + [ + "${pkgs.opencomposite}/lib/opencomposite" + ], + "version" : 1 + } + ''; + + programs.irssi = { + enable = true; + networks = { + classicconnect = { + nick = "alyx"; + server = { + address = "irc.classicconnect.net"; + port = 6677; + autoConnect = true; + }; + channels = { + nick.autoJoin = true; + }; + }; + }; + }; + + programs.obs-studio = { + enable = true; + plugins = with pkgs.obs-studio-plugins; [ + wlrobs + obs-backgroundremoval + obs-pipewire-audio-capture + ]; + }; +} diff --git a/home/niri.nix b/home/niri.nix new file mode 100644 index 0000000..1defea5 --- /dev/null +++ b/home/niri.nix @@ -0,0 +1,313 @@ +{lib, osConfig, pkgs, inputs, vars, config, ...}:{ + xdg.portal = { + enable = true; + config.niri = { + default = [ "gnome" "gtk" ]; + "org.freedesktop.impl.portal.Access" = [ "gtk" ]; + "org.freedesktop.impl.portal.Notification" = [ "gtk" ]; + "org.freedesktop.impl.portal.Secret" = [ "gnome-keyring" ]; + "org.freedesktop.impl.portal.FileChooser" = [ "gtk" ]; + }; + extraPortals = with pkgs; [ + xdg-desktop-portal-gnome + xdg-desktop-portal-gtk + ]; + }; + programs.niri = { + enable = true; + settings = { + input.touchpad = { + accel-profile = "flat"; + click-method = "clickfinger"; + scroll-factor = 0.3; + tap = false; + }; + input.trackpoint = { + accel-profile = "flat"; + }; + prefer-no-csd = true; + input.keyboard.xkb.layout = "gb"; + input.focus-follows-mouse.enable = true; + binds = with config.lib.niri.actions; lib.mkDefault { + "Mod+Return".action = spawn "foot"; + "Mod+N".action = spawn "swaync-client" "-t"; + "XF86AudioRaiseVolume".action = spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%+"; + "XF86AudioLowerVolume".action = spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "5%-"; + "XF86AudioMute".action = spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; + "Mod+D".action = spawn "foot" "--title" "launch" "--app-id" "fzf-launcher-foot" "bash" "-c" "niri msg action spawn -- bash -c \"$(compgen -c | sort -u | fzf --bind=enter:replace-query+print-query) >/dev/null\""; + "Mod+T".action = spawn "foot" "--title" "music" "--app-id" "mpd-control-foot" "ncmpcpp"; + "Mod+Shift+Q" = { + repeat = false; + action = close-window; + }; + "XF86AudioMicMute" = { + allow-when-locked = true; + action.spawn = [ "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle" ]; + }; + + "Mod+Q".action.close-window = {}; + + "Mod+Left".action.focus-column-left = {}; + "Mod+Down".action.focus-window-down = {}; + "Mod+Up".action.focus-window-up = {}; + "Mod+Right".action.focus-column-right = {}; + "Mod+H".action.focus-column-left = {}; + "Mod+J".action.focus-window-down = {}; + "Mod+K".action.focus-window-up = {}; + "Mod+L".action.focus-column-right = {}; + + "Mod+Shift+Left".action.move-column-left = {}; + "Mod+Shift+Down".action.move-window-down = {}; + "Mod+Shift+Up".action.move-window-up = {}; + "Mod+Shift+Right".action.move-column-right = {}; + "Mod+Shift+H".action.move-column-left = {}; + "Mod+Shift+J".action.move-window-down = {}; + "Mod+Shift+K".action.move-window-up = {}; + "Mod+Shift+L".action.move-column-right = {}; + + # Alternative commands that move across workspaces when reaching + # the first or last window in a column. + # Mod+J { focus-window-or-workspace-down; } + # Mod+K { focus-window-or-workspace-up; } + # Mod+Ctrl+J { move-window-down-or-to-workspace-down; } + # Mod+Ctrl+K { move-window-up-or-to-workspace-up; } + + "Mod+Home".action.focus-column-first = {}; + "Mod+End".action.focus-column-last = {}; + "Mod+Ctrl+Home".action.move-column-to-first = {}; + "Mod+Ctrl+End".action.move-column-to-last = {}; + +/* "Mod+Shift+Left".action.focus-monitor-left = {}; + "Mod+Shift+Down".action.focus-monitor-down = {}; + "Mod+Shift+Up".action.focus-monitor-up = {}; + "Mod+Shift+Right".action.focus-monitor-right = {}; + "Mod+Shift+H".action.focus-monitor-left = {}; + "Mod+Shift+J".action.focus-monitor-down = {}; + "Mod+Shift+K".action.focus-monitor-up = {}; + "Mod+Shift+L".action.focus-monitor-right = {}; +*/ + "Mod+Shift+Ctrl+Left".action.move-column-to-monitor-left = {}; + "Mod+Shift+Ctrl+Down".action.move-column-to-monitor-down = {}; + "Mod+Shift+Ctrl+Up".action.move-column-to-monitor-up = {}; + "Mod+Shift+Ctrl+Right".action.move-column-to-monitor-right = {}; + "Mod+Shift+Ctrl+H".action.move-column-to-monitor-left = {}; + "Mod+Shift+Ctrl+J".action.move-column-to-monitor-down = {}; + "Mod+Shift+Ctrl+K".action.move-column-to-monitor-up = {}; + "Mod+Shift+Ctrl+L".action.move-column-to-monitor-right = {}; + + # Alternatively, there are commands to move just a single window: + # Mod+Shift+Ctrl+Left { move-window-to-monitor-left; } + # ... + + # And you can also move a whole workspace to another monitor: + # Mod+Shift+Ctrl+Left { move-workspace-to-monitor-left; } + # ... + + "Mod+Page_Down".action.focus-workspace-down = {}; + "Mod+Page_Up".action.focus-workspace-up = {}; + "Mod+U".action.focus-workspace-down = {}; + "Mod+I".action.focus-workspace-up = {}; + "Mod+Ctrl+Page_Down".action.move-column-to-workspace-down = {}; + "Mod+Ctrl+Page_Up".action.move-column-to-workspace-up = {}; + "Mod+Ctrl+U".action.move-column-to-workspace-down = {}; + "Mod+Ctrl+I".action.move-column-to-workspace-up = {}; + + # Alternatively, there are commands to move just a single window: + # Mod+Ctrl+Page_Down { move-window-to-workspace-down; } + # ... + + "Mod+Shift+Page_Down".action.move-workspace-down = {}; + "Mod+Shift+Page_Up".action.move-workspace-up = {}; + "Mod+Shift+U".action.move-workspace-down = {}; + "Mod+Shift+I".action.move-workspace-up = {}; + + # You can bind mouse wheel scroll ticks using the following syntax. + # These binds will change direction based on the natural-scroll setting. + # + # To avoid scrolling through workspaces really fast, you can use + # the cooldown-ms property. The bind will be rate-limited to this value. + # You can set a cooldown on any bind, but it's most useful for the wheel. + "Mod+WheelScrollDown" = { + cooldown-ms = 150; + action.focus-workspace-down = {}; + }; + "Mod+WheelScrollUp" = { + cooldown-ms = 150; + action.focus-workspace-up = {}; + }; + "Mod+Ctrl+WheelScrollDown" = { + cooldown-ms = 150; + action.move-column-to-workspace-down = {}; + }; + "Mod+Ctrl+WheelScrollUp" = { + cooldown-ms = 150; + action.move-column-to-workspace-up = {}; + }; + + "Mod+WheelScrollRight".action.focus-column-right = {}; + "Mod+WheelScrollLeft".action.focus-column-left = {}; + "Mod+Ctrl+WheelScrollRight".action.move-column-right = {}; + "Mod+Ctrl+WheelScrollLeft".action.move-column-left = {}; + + # Usually scrolling up and down with Shift in applications results in + # horizontal scrolling; these binds replicate that. + "Mod+Shift+WheelScrollDown".action.focus-column-right = {}; + "Mod+Shift+WheelScrollUp".action.focus-column-left = {}; + "Mod+Ctrl+Shift+WheelScrollDown".action.move-column-right = {}; + "Mod+Ctrl+Shift+WheelScrollUp".action.move-column-left = {}; + + # Similarly, you can bind touchpad scroll "ticks". + # Touchpad scrolling is continuous, so for these binds it is split into + # discrete intervals. + # These binds are also affected by touchpad's natural-scroll, so these + # example binds are "inverted", since we have natural-scroll enabled for + # touchpads by default. + # Mod+TouchpadScrollDown { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02+"; } + # Mod+TouchpadScrollUp { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.02-"; } + + # You can refer to workspaces by index. However, keep in mind that + # niri is a dynamic workspace system, so these commands are kind of + # "best effort". Trying to refer to a workspace index bigger than + # the current workspace count will instead refer to the bottommost + # (empty) workspace. + # + # For example, with 2 workspaces + 1 empty, indices 3, 4, 5 and so on + # will all refer to the 3rd workspace. + "Mod+1".action.focus-workspace = 1; + "Mod+2".action.focus-workspace = 2; + "Mod+3".action.focus-workspace = 3; + "Mod+4".action.focus-workspace = 4; + "Mod+5".action.focus-workspace = 5; + "Mod+6".action.focus-workspace = 6; + "Mod+7".action.focus-workspace = 7; + "Mod+8".action.focus-workspace = 8; + "Mod+9".action.focus-workspace = 9; + "Mod+Shift+1".action.move-column-to-workspace = 1; + "Mod+Shift+2".action.move-column-to-workspace = 2; + "Mod+Shift+3".action.move-column-to-workspace = 3; + "Mod+Shift+4".action.move-column-to-workspace = 4; + "Mod+Shift+5".action.move-column-to-workspace = 5; + "Mod+Shift+6".action.move-column-to-workspace = 6; + "Mod+Shift+7".action.move-column-to-workspace = 7; + "Mod+Shift+8".action.move-column-to-workspace = 8; + "Mod+Shift+9".action.move-column-to-workspace = 9; + + # Alternatively, there are commands to move just a single window: + # Mod+Ctrl+1 { move-window-to-workspace 1; } + + # Switches focus between the current and the previous workspace. + # Mod+Tab { focus-workspace-previous; } + + "Mod+Comma".action.consume-window-into-column = {}; + "Mod+Period".action.expel-window-from-column = {}; + + # There are also commands that consume or expel a single window to the side. + # Mod+BracketLeft { consume-or-expel-window-left; } + # Mod+BracketRight { consume-or-expel-window-right; } + + "Mod+R".action.switch-preset-column-width = {}; + "Mod+Shift+R".action.reset-window-height = {}; + "Mod+F".action.maximize-column = {}; + "Mod+Shift+F".action.fullscreen-window = {}; + "Mod+C".action.center-column = {}; + + # Finer width adjustments. + # This command can also: + # * set width in pixels: "1000" + # * adjust width in pixels: "-5" or "+5" + # * set width as a percentage of screen width: "25%" + # * adjust width as a percentage of screen width: "-10%" or "+10%" + # Pixel sizes use logical, or scaled, pixels. I.e. on an output with scale 2.0, + # set-column-width "100" will make the column occupy 200 physical screen pixels. + "Mod+Minus".action.set-column-width = "-10%"; + "Mod+Equal".action.set-column-width = "+10%"; + + # Finer height adjustments when in column with other windows. + "Mod+Shift+Minus".action.set-window-height = "-10%"; + "Mod+Shift+Equal".action.set-window-height = "+10%"; + + # Actions to switch layouts. + # Note: if you uncomment these, make sure you do NOT have + # a matching layout switch hotkey configured in xkb options above. + # Having both at once on the same hotkey will break the switching, + # since it will switch twice upon pressing the hotkey (once by xkb, once by niri). + # Mod+Space { switch-layout "next"; } + # Mod+Shift+Space { switch-layout "prev"; } + + "Print".action.screenshot = {}; + "Ctrl+Print".action.screenshot-screen = {}; + "Alt+Print".action.screenshot-window = {}; + + # The quit action will show a confirmation dialog to avoid accidental exits. + "Mod+Shift+E".action.quit = {}; + + # Powers off the monitors. To turn them back on, do any input like + # moving the mouse or pressing any other key. + "Mod+Shift+P".action.power-off-monitors = {}; + }; + outputs.DP-1 = { + mode = { + height = 1080; + refresh = 239.76; + width = 1920; + }; + position = { + x = 2560; + y = 0; + }; + }; + outputs.DP-4 = { + mode = { + height = 1080; + refresh = 75.0; + width = 2560; + }; + position = { + x = 0; + y = 0; + }; + }; + spawn-at-startup = [ + {command = ["waybar"];} + {command = ["xwayland-satellite"];} + {command = if !vars.isTough then ["swaybg" "-m" "fill" "-i" "/home/alyx/.config/nixos/assets/scenes.jpg"] else ["swaybg" "-m" "fill" "-i" "/home/alyx/.config/nixos/assets/scenes.jpg"];} + {command = ["udiskie" "--appindicator"];} + ]; + environment = { + DISPLAY = ":0"; + }; + window-rules = [ + {matches = [{title = "^launch$";}]; + open-floating = true; + } + {matches = [{title = "^music$";}]; + open-floating = true; + } + {matches = [{title = "^(Picture-in-Picture)$";}]; + open-floating = true; + } + {matches = [{title = "^music$";}]; + open-floating = true; + } + { + geometry-corner-radius = { + bottom-left = 12.0; + bottom-right = 12.0; + top-left = 12.0; + top-right = 12.0; + }; + draw-border-with-background = false; + clip-to-geometry = true; + } + ]; + layout = { + focus-ring = { + enable = true; + width = 2; + active = {color = "rgb(203 166 247)";}; + inactive = {color = "rgb(68 12 136)";}; + }; + }; + }; + }; +} diff --git a/home/waybar/config b/home/waybar/config new file mode 100644 index 0000000..08aa031 --- /dev/null +++ b/home/waybar/config @@ -0,0 +1,129 @@ +[{ +"position": "top", +"modules-left": ["group/traydrawer", "custom/weather"], +"modules-center": ["cpu", "group/mpdcontrols", "cpu#frequency"], +"modules-right": ["clock", "wireplumber", "battery", "memory", "disk", "group/poweroptions"], +"margin-top": 8, +"margin-left": 8, +"margin-right": 8, +"height": 40, + +"wireplumber": { + "on-click": "pavucontrol", + "format": "󰓃 {volume}%", + "format-muted": "󰓄 {volume}%", +}, + +"battery": { + "interval": 5, + "format-icons": [" ", " ", " ", " ", " "], + "states": { + "warning": 26, + "critical": 15, + "dead": 5 + }, + "format": "{icon} {capacity}%", + "tooltip-format": "BAT0, {power}W", +}, + +"group/mpdcontrols": { + "orientation": "inherit", + "drawer": { + "transition-duration": 250, + "transition-left-to-right": true + }, + "modules": ["mpd", "custom/playpause", "custom/prev", "custom/next"] +}, +"custom/playpause": { + "format": " 󰐎 ", + "on-click": "mpc toggle" +}, +"custom/prev": { + "format": " 󰒮 ", + "on-click": "mpc prev" +}, +"custom/next": { + "format": "󰒭 ", + "on-click": "mpc next" +}, +"group/traydrawer": { + "orientation": "inherit", + "modules": ["custom/trayadvisory", "tray"], + "drawer": { + "transition-duration": 250 + } +}, + +"mpd": { + "on-click": "mpc toggle", + "format-disconnected": " MPD disconnected ", + "format-stopped": " Nothing Playing! ", + "format": "  {title} - {album} - {artist} ", + "format-paused": "  {title} - {album} - {artist} ", + "on-scroll-up": "mpc volume +5", + "on-scroll-down": "mpc volume -5", +}, + +"custom/trayadvisory": { + "format": " " +}, + +"custom/systemadvisory": { + "format": "󱖫 " +}, + +"group/poweroptions": { + "orientation": "inherit", + "modules": ["custom/poweroff", "custom/logout"], + "drawer": { + "transition-duration": 250 + } +}, + +"custom/poweroff": { + "format": "⏻ ", + "on-click": "shutdown now", +}, + +"custom/logout": { + "format": " | 󰩈 ", + "on-click": "swaymsg exit", +}, + +"custom/weather": { + "format": "{}°", + "tooltip": true, + "interval": 3600, + "exec": "wttrbar --nerd --location edinburgh", + "return-type": "json" +}, + +"group/systemstatus": { + "orientation": "inherit", + "modules": ["custom/systemadvisory", "memory", "disk"], + "drawer": { + "click-to-reveal": true, + "transition-duration": 250, + } +}, + +"cpu": { + "format": "  {usage}% ", + "states": { "highcpu": 85 }, +}, + +"cpu#frequency": { + "format": "{max_frequency}GHz" +}, + +"memory": { + "format": " {avail:0.0f} GiB  {swapAvail:0.0f} GiB" +}, + +"disk": { + "format": " {specific_free:0.1f} GiB", + "unit": "GiB", +}, + + +}] diff --git a/home/waybar/style.css b/home/waybar/style.css new file mode 100644 index 0000000..882ba36 --- /dev/null +++ b/home/waybar/style.css @@ -0,0 +1,108 @@ +#waybar { + background: repeating-linear-gradient( + 0.25turn, + #082100 5px, + #22391b 10px, + #082100 15px + ); + font-family: "Iosevka NF"; + + color: #2db300; + border: 2px solid #2aff36; + border-radius: 11px; +} + +#wireplumber, +#cpu, +#cpu-frequency, +#battery, +#clock, +#memory, +#disk, +#mpdcontrols, +#poweroptions +{ + border: 2px solid #2aff36; + /*margin: 3px;*/ + min-height: 0; + + margin-left: 4px; + margin-right: 4px; + margin-top: 7px; + margin-bottom: 7px; + padding: 2px; + padding-left: 5px; + padding-right: 5px; + border-radius: 4px; +} + +#custom-trayadvisory { + margin: 3px 10px 3px; +} + +/*#poweroptions { + border: 2px solid #2aff36; + border-radius: 11 11 11 11px; + min-height: 0; + padding: 6px; +}*/ + +#poweroptions { + margin-right: 10px; + padding-left: 8px; +} + +#workspaces { + border: 0.2em solid #2aff36; +} + +#battery.warning { + background: repeating-linear-gradient( + 0.25turn, + #7b7537 20px, + #a18f48 30px, + #7b7537 40px + ); + color: #cfceb4 +} + +#battery.critical, +#battery.dead { + background: repeating-linear-gradient( + 0.25turn, + #7b3737 20px, + #a14848 30px, + #7b3737 40px + ); + color: #cfb4b4 +} + +#battery.charging { + background: repeating-linear-gradient( + 0.25turn, + #37757b 20px, + #4899a1 30px, + #37757b 40px + ); + color: #b4cccf +} + +#mpd.playing { + background: repeating-linear-gradient( + 0.25turn, + #824554 5px, + #9d5566 10px, + #824554 15px + ); + color: #CFB4BA; +} + +#cpu.highcpu { + background: repeating-linear-gradient( + 0.25turn, + #824554 5px, + #9d5566 10px, + #824554 15px + ); + color: #CFB4BA; +} \ No newline at end of file