From 069c7475ee2e28b461fd17025d78ed3cf4753023 Mon Sep 17 00:00:00 2001 From: insert Date: Fri, 12 Apr 2024 18:20:55 -0400 Subject: [PATCH] I really hope I didn't forget any secrets --- configuration.nix | 550 +++++++++++++++++++++++++++++++++++++ flake.lock | 373 +++++++++++++++++++++++++ flake.nix | 24 ++ hardware-configuration.nix | 41 +++ home-files.nix | 547 ++++++++++++++++++++++++++++++++++++ sunshine.nix | 51 ++++ 6 files changed, 1586 insertions(+) create mode 100644 configuration.nix create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 hardware-configuration.nix create mode 100644 home-files.nix create mode 100644 sunshine.nix diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..0d7508c --- /dev/null +++ b/configuration.nix @@ -0,0 +1,550 @@ +# 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’). +#Credit to anyone I got these config files from, I would add it here but its been months + +{ inputs, config, lib, pkgs, ... }: +{ + environment.etc.nixpkgs.source = inputs.nixpkgs; + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + + ./sunshine.nix + ./home-files.nix + #./flatpak.nix + ]; + + hardware.opengl = { + enable = true; + driSupport = true; + driSupport32Bit = true; + }; + + + # Bootloader. + boot.loader.systemd-boot.enable = true; + # boot.loader.grub.enable = true; + # boot.loader.grub.device = "nodev"; + # boot.loader.grub.useOSProber = true; + boot.loader.systemd-boot.configurationLimit = 15; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "insertpclinux"; # Define your hostname. + + # Enable networking + networking.networkmanager.enable = true; + + # Set your time zone. + time.timeZone = "America/New_York"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + + # Enable the X11 windowing system. + services.xserver.enable = true; + services.xserver.videoDrivers = ["nvidia"]; + # Enable the KDE Plasma Desktop Environment. + services.xserver.displayManager.sddm.enable = false; + services.xserver.desktopManager.plasma5.enable = false; + services.greetd.enable = true; + programs.regreet.enable = true; + services.xrdp.enable = false; + services.xrdp.defaultWindowManager = "startplasma-x11"; + virtualisation.docker = { + enable = true; + extraOptions = '' + --insecure-registry "kuberound.internal:5000" + ''; + }; + + #nixpkgs.overlays = [ (self: super: (let + # patched_pkgs = import inputs.nixpkgs_patched { + # inherit (self) system; + # config.allowUnfree = true; + # }; + # in { + # linuxPackages = patched_pkgs.linuxPackages; + # })) ]; + #boot.kernelPackages = pkgs.linuxPackages; + + hardware.nvidia = { + + # Modesetting is needed most of the time + modesetting.enable = true; + + # Enable power management (do not disable this unless you have a reason to). + # Likely to cause problems on laptops and with screen tearing if disabled. + powerManagement.enable = true; + + # Use the open source version of the kernel module ("nouveau") + # Note that this offers much lower performance and does not + # support all the latest Nvidia GPU features. + # You most likely don't want this. + # Only available on driver 515.43.04+ + open = false; + + # Enable the Nvidia settings menu, + # accessible via `nvidia-settings`. + nvidiaSettings = true; + + # Optionally, you may need to select the appropriate driver version for your specific GPU. + + package = config.boot.kernelPackages.nvidiaPackages.production; + + }; + # Configure keymap in X11 + services.xserver = { + layout = "us"; + xkbVariant = ""; + }; + + # Enable CUPS to print documents. + services.printing.enable = true; + + # Enable sound with pipewire. + sound.enable = true; + 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’. + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nix.settings.auto-optimise-store = true; + system.autoUpgrade.enable = false; + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 10d"; + }; + #programs.zsh.enable = true; + virtualisation.libvirtd.enable = true; + services.flatpak.enable = true; + users.users.insert = { + isNormalUser = true; + description = "insert"; + extraGroups = [ "networkmanager" "wheel" "input" "docker" "libvirtd" ]; + #shell = pkgs.zsh; + packages = with pkgs; [ + firefox + kate + ]; + }; + + programs.waybar = { + enable = true; + package = pkgs.waybar.overrideAttrs (oldAttrs: { + mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ]; + }); + #config = { + # modules = [{module = "wlr/workspace"};]; + #}; + }; + + + services.flatpak.packages = [ + "flathub:app/dev.lizardbyte.app.Sunshine//stable" + "flathub:app/org.godotengine.Godot//stable" + "flathub:app/org.filezillaproject.Filezilla//stable" + ]; + services.flatpak.remotes = { + "flathub" = "https://dl.flathub.org/repo/flathub.flatpakrepo"; + "flathub-beta" = "https://dl.flathub.org/beta-repo/flathub-beta.flatpakrepo"; + }; + + age.identityPaths = [ "/home/insert/.ssh/id_rsa" ]; + age.secrets.email = { + file = ./secrets/email.age; + owner = "insert"; + group = "users"; + }; + + home-manager.users.insert= { pkgs, ... }: { + home.packages = [ + pkgs.git + pkgs.fluffychat + pkgs.cinny-desktop + pkgs.libsForQt5.lightly + pkgs.pfetch + pkgs.git-credential-oauth + pkgs.wayvnc + pkgs.android-tools + pkgs.gnome.eog + pkgs.libsForQt5.gwenview + pkgs.libsForQt5.qtstyleplugins + pkgs.libsForQt5.qt5ct + pkgs.oh-my-zsh + pkgs.zsh + pkgs.kubectl + pkgs.kubernetes-helm + pkgs.vscodium + #pkgs.atool + #pkgs.httpie + pkgs.webcord + pkgs.pika-backup + pkgs.tigervnc + pkgs.syncthing + pkgs.zsh-syntax-highlighting + pkgs.zsh-history-substring-search + pkgs.kitty + pkgs.grim + pkgs.slurp + pkgs.prismlauncher + pkgs.glfw-wayland-minecraft + ]; + services.syncthing.enable = true; + + # programs.zsh.oh-my-zsh.enable = true; + #programs.waybar = { + #enable = true; + #package = pkgs.waybar.overrideAttrs (oldAttrs: { + #mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ]; + #}); + #config = { + # modules = [{module = "wlr/workspace"};]; + #}; + #} + gtk = { + enable = true; + iconTheme = { + name = "Papirus-Dark"; + package = pkgs.papirus-icon-theme; + }; + cursorTheme = { + name = "Catppuccin-Frappe-Blue-Cursors"; + package = pkgs.catppuccin-cursors.frappeBlue; + size = 24; + }; + theme = { + name = "Catppuccin-Frappe-Standard-Mauve-Dark"; + package = pkgs.catppuccin-gtk.override { + accents = [ "mauve" ]; + size = "standard"; + #tweaks = [ "black" ]; + variant = "frappe"; + }; + }; + + gtk3.extraConfig = { + Settings = '' + gtk-application-prefer-dark-theme=1 + ''; + }; + + gtk4.extraConfig = { + Settings = '' + gtk-application-prefer-dark-theme=1 + ''; + }; + + }; + programs.nnn = { + enable = true; + #plugins = { "launch", "imgview" }; + plugins.src = (pkgs.fetchFromGitHub { + owner = "jarun"; + repo = "nnn"; + rev = "v4.9"; + sha256 = "sha256-Hpc8YaJeAzJoEi7aJ6DntH2VLkoR6ToP6tPYn3llR7k="; + }) + "/plugins"; + plugins.mappings = { + l = "launch"; + v = "imgview"; + g = "getplugs"; + }; + + }; + + accounts.email = { + accounts.insert = { + address = "insert@insertapp.net"; + gpg = { + key = "A70775C389ACF105"; + signByDefault = true; + }; + imap.host = "imap.purelymail.com"; + imap.port = 993; + primary = true; + realName = "Insert"; + smtp = { + host = "smtp.purelymail.com"; + port = 465; + }; + passwordCommand = "cat ${config.age.secrets.email.path}"; + userName = "insert@insertapp.net"; + #notmuch.enable = true; + thunderbird.enable = true; + }; + }; + + #programs.notmuch.enable = true; + programs.himalaya.enable = false; + programs.thunderbird = { + enable = true; + profiles.insert = { + #name = "Insert"; + isDefault = true; + withExternalGnupg = false; + settings = {"mail.openpgp.alternative_gpg_path" = "/run/current-system/sw/bin/gpg-agent";}; + }; + }; + + programs.librewolf.enable = true; + + programs.git = { + enable = true; + userName = "insert"; + userEmail = "insert@insertapp.net"; + signing = { + key = "A70775C389ACF105"; + signByDefault = true; + }; + }; + programs.git-credential-oauth.enable = true; + programs.kitty = { + enable = true; + theme = "Catppuccin-Frappe"; + settings = { + font_family = "Monocraft Nerd Font"; + }; + }; + programs.zsh = { + enable = true; + shellAliases = { + update = "sudo nixos-rebuild switch --flake /home/insert/Documents/nixos# -v --impure --upgrade --recreate-lock-file"; + update-locked = "sudo nixos-rebuild switch --flake /home/insert/Documents/nixos# -v --impure"; + garbage = "nix-collect-garbage"; + }; + initExtra = '' + + source ~/.p10k.zsh + export TERM=xterm-256color + PF_INFO="ascii title os kernel uptime pkgs memory wm de palette" pfetch + + ''; + plugins = [ + + {name = "powerlevel10k";src = pkgs.zsh-powerlevel10k;file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme";} + + ]; + syntaxHighlighting.enable = true; + historySubstringSearch.enable = true; + autosuggestion.enable = true; + oh-my-zsh = { + enable = true; + plugins = [ "git" "kubectl" ]; + #theme = "powerlevel10k/powerlevel10k"; + }; + }; + home.stateVersion = "23.05"; + }; + + security.polkit.enable = true; + # Enable automatic login for the user. + services.xserver.displayManager.autoLogin.enable = false; + services.xserver.displayManager.autoLogin.user = "insert"; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + + fonts.fontDir.enable = true; + fonts.packages = with pkgs; [ + monocraft + ]; + + security.pki.certificateFiles = [ + /home/insert/Documents/nextcloud/nextcloudinternal.pem + /home/insert/Documents/personal-vaultwarden/cert.pem + ]; + + # List packages installed in system profile. To search, run: + # $ nix search wget + programs.nix-ld.enable = true; + environment.systemPackages = [ + # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + # wget + pkgs.tailscale + pkgs.wayland + pkgs.docker-compose + #pkgs.sway + inputs.agenix.packages."${pkgs.system}".default + pkgs.vlc + #pkgs.hyprland + pkgs.wl-clipboard # wl-copy and wl-paste for copy/paste from stdin / stdout + pkgs.bemenu # wayland clone of dmenu + pkgs.mako # notification system developed by swaywm maintainer + #pkgs.eww-wayland + pkgs.wofi + pkgs.swww + pkgs.nfs-utils + #pkgs.waybar + pkgs.libnotify + pkgs.polkit_gnome + pkgs.libsForQt5.breeze-icons + pkgs.libsForQt5.dolphin + pkgs.glib + pkgs.pinentry + pkgs.adoptopenjdk-bin + #inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland + pkgs.gnome.nautilus + pkgs.libsForQt5.ark + ]; + services.tailscale.enable = true; + services.gvfs.enable = true; + programs.steam.enable = true; + + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + #pinentryFlavor = "gtk2"; + }; + services.pcscd.enable = true; + + #programs.sway = { + # enable = true; + # wrapperFeatures.gtk = true; + # extraOptions = [ + # "--unsupported-gpu" + # ]; + #}; + services.earlyoom = { + enable = true; + freeSwapThreshold = 5; + freeMemThreshold = 8; + enableNotifications = true; + extraArgs = [ + "-g" "--avoid '^(X|hypr.*|kitty|wayland)$'" + "--prefer '^(electron|librewolf|firefox|java|minecraft.*)$'" + ]; + }; + + + services.rpcbind.enable = true; # needed for NFS + systemd.mounts = [{ + type = "nfs"; + #mountConfig = { + # Options = "noatime"; + #}; + what = "kubbernetter-5:/var/mnt/md0/personal/randomfiles"; + where = "/mnt/NAS"; + } + { + type = "nfs"; + #mountConfig = { + # Options = "noatime"; + #}; + what = "kubbernetter-5:/var/mnt/md0/personal/pc-backups"; + where = "/mnt/NAS-backup"; + }]; + + systemd.automounts = [{ + wantedBy = [ "multi-user.target" ]; + #automountConfig = { + # TimeoutIdleSec = "600"; + #}; + where = "/mnt/NAS"; + } + { + wantedBy = [ "multi-user.target" ]; + #automountConfig = { + # TimeoutIdleSec = "600"; + #}; + where = "/mnt/NAS-backup"; + }]; + + 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; + }; + }; + }; + + systemd.user.services.waybar.enable = false; + + xdg.portal = { enable = true; extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; }; + #xdg.portal = { enable = true; extraPortals = [ inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland ]; }; + #xdg.portal = { enable = true; }; + + programs.hyprland = { + enable = true; + #enableNvidiaPatches = true; + package = inputs.hyprland.packages.${pkgs.system}.hyprland; + }; + #programs.nnn.enable = false; + #programs.hyprland.enable = true; + #programs.hyprland.enableNvidiaPatches = true; + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + # List services that you want to enable: + services.sunshine.enable = true; + # 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; + + #I am so, so, so very sorry + networking.firewall.enable = true; + networking.firewall.checkReversePath = "loose"; + networking.firewall.allowedUDPPortRanges = [ + { from = 0; to = 65535; } + { from = 0; to = 65535; } + ]; + networking.firewall.allowedTCPPortRanges = [ + { from = 0; to = 65535; } + { from = 0; to = 65535; } + ]; + + # 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 = "23.05"; # Did you read the comment? + +} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..749e211 --- /dev/null +++ b/flake.lock @@ -0,0 +1,373 @@ +{ + "nodes": { + "agenix": { + "inputs": { + "darwin": "darwin", + "home-manager": "home-manager", + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems" + }, + "locked": { + "lastModified": 1712079060, + "narHash": "sha256-/JdiT9t+zzjChc5qQiF+jhrVhRt8figYH29rZO7pFe4=", + "owner": "ryantm", + "repo": "agenix", + "rev": "1381a759b205dff7a6818733118d02253340fd5e", + "type": "github" + }, + "original": { + "owner": "ryantm", + "repo": "agenix", + "type": "github" + } + }, + "darwin": { + "inputs": { + "nixpkgs": [ + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1700795494, + "narHash": "sha256-gzGLZSiOhf155FW7262kdHo2YDeugp3VuIFb4/GGng0=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d", + "type": "github" + }, + "original": { + "owner": "lnl7", + "ref": "master", + "repo": "nix-darwin", + "type": "github" + } + }, + "flatpaks": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "utils": "utils" + }, + "locked": { + "lastModified": 1707326266, + "narHash": "sha256-vRVih6iltuyLdj305Pj236BfhzFaOkAbHg3r5VsFdxs=", + "owner": "GermanBread", + "repo": "declarative-flatpak", + "rev": "efe7897ddcfbca085fba0690b3094e7f8e8911dd", + "type": "github" + }, + "original": { + "owner": "GermanBread", + "ref": "dev", + "repo": "declarative-flatpak", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "agenix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1703113217, + "narHash": "sha256-7ulcXOk63TIT2lVDSExj7XzFx09LpdSAPtvgtM7yQPE=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "3bfaacf46133c037bb356193bd2f1765d9dc82c1", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "hyprcursor": { + "inputs": { + "hyprlang": "hyprlang", + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1711466786, + "narHash": "sha256-sArxGyUBiCA1in+q6t0QqT+ZJiZ1PyBp7cNPKLmREM0=", + "owner": "hyprwm", + "repo": "hyprcursor", + "rev": "d3876f34779cc03ee51e4aafc0d00a4f187c7544", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprcursor", + "type": "github" + } + }, + "hyprland": { + "inputs": { + "hyprcursor": "hyprcursor", + "hyprland-protocols": "hyprland-protocols", + "hyprlang": "hyprlang_2", + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems_4", + "wlroots": "wlroots", + "xdph": "xdph" + }, + "locked": { + "lastModified": 1712415242, + "narHash": "sha256-xqD8+J7xg6ykdDEtU50jJgY8CnNLuNXe63qok7mAiO8=", + "owner": "hyprwm", + "repo": "Hyprland", + "rev": "04d067d78b0074ff0000b4ce2d8741881b1ace25", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "Hyprland", + "type": "github" + } + }, + "hyprland-protocols": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1691753796, + "narHash": "sha256-zOEwiWoXk3j3+EoF3ySUJmberFewWlagvewDRuWYAso=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "0c2ce70625cb30aef199cb388f99e19a61a6ce03", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, + "hyprlang": { + "inputs": { + "nixpkgs": [ + "hyprland", + "hyprcursor", + "nixpkgs" + ], + "systems": "systems_3" + }, + "locked": { + "lastModified": 1709914708, + "narHash": "sha256-bR4o3mynoTa1Wi4ZTjbnsZ6iqVcPGriXp56bZh5UFTk=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "a685493fdbeec01ca8ccdf1f3655c044a8ce2fe2", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, + "hyprlang_2": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1711250455, + "narHash": "sha256-LSq1ZsTpeD7xsqvlsepDEelWRDtAhqwetp6PusHXJRo=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "b3e430f81f3364c5dd1a3cc9995706a4799eb3fa", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1712439257, + "narHash": "sha256-aSpiNepFOMk9932HOax0XwNxbA38GOUVOiXfUVPOrck=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ff0dbd94265ac470dda06a657d5fe49de93b4599", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "agenix": "agenix", + "flatpaks": "flatpaks", + "hyprland": "hyprland", + "nixpkgs": "nixpkgs" + } + }, + "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": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "systems_4": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "utils": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "wlroots": { + "flake": false, + "locked": { + "host": "gitlab.freedesktop.org", + "lastModified": 1709983277, + "narHash": "sha256-wXWIJLd4F2JZeMaihWVDW/yYXCLEC8OpeNJZg9a9ly8=", + "owner": "wlroots", + "repo": "wlroots", + "rev": "50eae512d9cecbf0b3b1898bb1f0b40fa05fe19b", + "type": "gitlab" + }, + "original": { + "host": "gitlab.freedesktop.org", + "owner": "wlroots", + "repo": "wlroots", + "rev": "50eae512d9cecbf0b3b1898bb1f0b40fa05fe19b", + "type": "gitlab" + } + }, + "xdph": { + "inputs": { + "hyprland-protocols": [ + "hyprland", + "hyprland-protocols" + ], + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1709299639, + "narHash": "sha256-jYqJM5khksLIbqSxCLUUcqEgI+O2LdlSlcMEBs39CAU=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "2d2fb547178ec025da643db57d40a971507b82fe", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..3bae78d --- /dev/null +++ b/flake.nix @@ -0,0 +1,24 @@ +{ + inputs = { + # ... + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flatpaks.url = "github:GermanBread/declarative-flatpak/dev"; + flatpaks.inputs.nixpkgs.follows = "nixpkgs"; + hyprland.url = "github:hyprwm/Hyprland"; + hyprland.inputs.nixpkgs.follows = "nixpkgs"; + agenix.url = "github:ryantm/agenix"; + agenix.inputs.nixpkgs.follows = "nixpkgs"; + }; + + outputs = { nixpkgs, flatpaks, agenix, ... } @ inputs: { + nixosConfigurations.insertpclinux = nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs; }; + modules = [ + flatpaks.nixosModules.default + ./configuration.nix + agenix.nixosModules.default + ]; + }; + }; + } + diff --git a/hardware-configuration.nix b/hardware-configuration.nix new file mode 100644 index 0000000..f4402ad --- /dev/null +++ b/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" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/b997879c-fbf7-4368-9f90-7a5c9655133a"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/18B3-A4B9"; + fsType = "vfat"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/e5929d9b-2beb-4d9f-adef-33f4d3b74a89"; } + ]; + + # 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.enp2s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/home-files.nix b/home-files.nix new file mode 100644 index 0000000..95a7bf3 --- /dev/null +++ b/home-files.nix @@ -0,0 +1,547 @@ +{ inputs, config, lib, pkgs, ... }: +#Yes I manage my home files like this, yes I am insane +#Credit to anyone I got these config files from, I would add it here but its been months +{ + home-manager.users.insert.home.file.".config/qt5ct/colors/Catppuccin-Frappe.conf" = { + text = ''[ColorScheme] +active_colors=#ffc6d0f5, #ff292c3c, #ffa5adce, #ff949cbb, #ff51576d, #ff737994, #ffc6d0f5, #ffc6d0f5, #ffc6d0f5, #ff303446, #ff292c3c, #ff838ba7, #ff8caaee, #ff303446, #ff8caaee, #ffe78284, #ff303446, #ffc6d0f5, #ff232634, #ffc6d0f5, #80838ba7 +disabled_colors=#ffa5adce, #ff292c3c, #ffa5adce, #ff949cbb, #ff51576d, #ff737994, #ffa5adce, #ffa5adce, #ffa5adce, #ff303446, #ff292c3c, #ff838ba7, #ff626880, #ffb5bfe2, #ff8caaee, #ffe78284, #ff303446, #ffc6d0f5, #ff232634, #ffc6d0f5, #80838ba7 +inactive_colors=#ffc6d0f5, #ff292c3c, #ffa5adce, #ff949cbb, #ff51576d, #ff737994, #ffc6d0f5, #ffc6d0f5, #ffc6d0f5, #ff303446, #ff292c3c, #ff838ba7, #ff414559, #ffa5adcb, #ff8caaee, #ffe78284, #ff303446, #ffc6d0f5, #ff232634, #ffc6d0f5, #80838ba7''; + }; + + + home-manager.users.insert.home.file.".config/mako/config" = { + text = ''# Colors + +background-color=#303446 +text-color=#c6d0f5 +border-color=#8caaee +progress-color=over #414559 + +[urgency=high] +border-color=#ef9f76''; + }; + + environment.etc."greetd/regreet.toml".text = lib.mkForce ''[background] +path = "/home/insert/Documents/cat-background/background.png" +fit = "Fill" +[GTK] +# Whether to use the dark theme +application_prefer_dark_theme = true + +# Cursor theme name +#cursor_theme_name = "Adwaita" + +# Font name and size +font_name = "Monocraft 20" + +# Icon theme name +icon_theme_name = "Breeze Dark" + +# GTK theme name +#theme_name = "Adwaita" + ''; + + home-manager.users.insert.home.file.".config/waybar/config.jsonc" = { + text = ''{ + "layer": "top", + "position": "top", + "mod": "dock", + "exclusive": true, + "passtrough": false, + "gtk-layer-shell": true, + "height": 0, + "modules-left": [ + "clock", + "hyprland/workspaces" + ], + "modules-center": ["hyprland/window"], + "modules-right": [ + "wlr/taskbar", + "temperature", + "cpu", + "memory", + "tray" + ], + + "hyprland/window": { + "format": "{}" + }, + "hyprland/workspaces": { + "on-scroll-up": "hyprctl dispatch workspace e+1", + "on-scroll-down": "hyprctl dispatch workspace e-1", + "all-outputs": true, + "tooltip": true, + "on-click": "activate" + }, + "wlr/taskbar": { + "on-click": "activate", + "on-click-middle": "close", + "ignore-list": [ + "foot" + ] + }, + "cpu": { + "interval": 10, + "format": " {}%", + "max-length": 10, + "on-click": "" + }, + "memory": { + "interval": 30, + "format-alt": " {}%", + "format":" {used:0.1f}G", + "max-length": 10 + }, + "custom/weather" : { + "tooltip" : true, + "format" : "{}", + "restart-interval" : 300, + "exec" : "~/.config/waybar/scripts/waybar-wttr.py", + "return-type" : "json" + }, + "temperature" : { + "format": "{temperatureF}°F" + }, + "tray": { + "icon-size": 13, + "tooltip": false, + "spacing": 10 + }, + "clock": { + "format":" {:%R  %d/%m}", + "tooltip-format": "{:%Y %B}\n{calendar}" + }, + "pulseaudio": { + "format": "{icon} {volume}%", + "tooltip": false, + "format-muted": " Muted", + "on-click": "pamixer -t", + "on-scroll-up": "pamixer -i 5", + "on-scroll-down": "pamixer -d 5", + "scroll-step": 5, + "format-icons": { + "headphone": "", + "hands-free": "", + "headset": "", + "phone": "", + "portable": "", + "car": "", + "default": ["", "", ""] + } + }, + "pulseaudio#microphone": { + "format": "{format_source}", + "tooltip": false, + "format-source": " {volume}%", + "format-source-muted": " Muted", + "on-click": "pamixer --default-source -t", + "on-scroll-up": "pamixer --default-source -i 5", + "on-scroll-down": "pamixer --default-source -d 5", + "scroll-step": 5 + } +} +''; + }; + home-manager.users.insert.home.file.".config/waybar/style.css" = { + text = ''@import "frappe.css"; + +* { + font-family: FantasqueSansMono Nerd Font; + font-size: 17px; + min-height: 0; +} + +#waybar { + background: transparent; + color: @text; + margin: 5px 5px; +} + +#workspaces { + border-radius: 1rem; + margin: 5px; + background-color: @surface0; + margin-left: 1rem; +} + +#taskbar { + border-radius: 1rem; + margin: 5px; + background-color: @surface0; + margin-left: 1rem; +} + +#workspaces button { + color: @lavender; + border-radius: 1rem; + padding: 0.4rem; +} + +#workspaces button.active { + color: @sky; + border-radius: 1rem; +} + +#workspaces button:hover { + color: @sapphire; + border-radius: 1rem; +} + +#custom-music, +#tray, +#backlight, +#clock, +#battery, +#cpu, +#memory, +#temperature, +#pulseaudio, +#custom-lock, +#custom-power { + background-color: @surface0; + padding: 0.5rem 1rem; + margin: 5px 0; +} + +#clock { + color: @blue; + border-radius: 0px 1rem 1rem 0px; + margin-right: 1rem; +} + +#battery { + color: @green; +} + +#temperature { + color: @red; + border-radius: 1rem 0px 0px 1rem; + margin-left: 1rem; +} + +#cpu { + color: @yellow; +} +#memory { + color: @green; +} + +#battery.charging { + color: @green; +} + +#battery.warning:not(.charging) { + color: @red; +} + +#backlight { + color: @yellow; +} + +#backlight, #battery { + border-radius: 0; +} + +#pulseaudio { + color: @maroon; + border-radius: 1rem 0px 0px 1rem; + margin-left: 1rem; +} + +#custom-music { + color: @mauve; + border-radius: 1rem; +} + +#custom-lock { + border-radius: 1rem 0px 0px 1rem; + color: @lavender; +} + +#custom-power { + margin-right: 1rem; + border-radius: 0px 1rem 1rem 0px; + color: @red; +} + +#tray { + /*margin-right: 1rem; + border-radius: 1rem;*/ +}''; + }; + home-manager.users.insert.home.file.".config/hypr/hyprland.conf" = { + text = ''autogenerated = 0 # remove this line to remove the warning + +# See https://wiki.hyprland.org/Configuring/Monitors/ +monitor=,1920x1080@60,auto,1 + + +# See https://wiki.hyprland.org/Configuring/Keywords/ for more + +# Execute your favorite apps at launch +# exec-once = waybar & hyprpaper & firefox +source=~/.config/hypr/frappe.conf +# Source a file (multi-file configs) +# source = ~/.config/hypr/myColors.conf + +# Some default env vars. +env = XCURSOR_SIZE,24 +env = WLR_NO_HARDWARE_CURSORS,1 +env = NIXOS_OZONE_WL,1 +env = KUBECONFIG,/home/insert/Desktop/k3s.yaml +env = QT_QPA_PLATFORMTHEME,qt5ct +env = XCURSOR_THEME,Catppuccin-Frappe-Blue-Cursors +env = XCURSOR_SIZE,24 +exec-once = systemctl --user start polkit-gnome-authentication-agent-1 +#exec-once = hyprctl setcursor Catppuccin-Frappe-Blue-Cursors 24 +exec-once = watch waybar +exec-once = wayvnc 100.120.210.58 +exec-once = mako +exec-once = swww init +exec-once = sleep 5 & swww img /home/insert/Documents/nixos.png +#exec-once = ln -sf $XDG_RUNTIME_DIR/{app/com.discordapp.Discord,}/discord-ipc-0 +exec-once = systemctl --user import-environment PATH +exec-once = systemctl --user restart xdg-desktop-portal.service +# For all categories, see https://wiki.hyprland.org/Configuring/Variables/ +input { + kb_layout = us + kb_variant = + kb_model = + kb_options = + kb_rules = + + follow_mouse = 1 + + touchpad { + natural_scroll = no + } + + sensitivity = 0 # -1.0 - 1.0, 0 means no modification. +} + +general { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + + gaps_in = 5 + gaps_out = 20 + border_size = 2 + #col.active_border = $overlay1 45deg + #col.active_border = rgba(33ccffee) rgba(00ff99ee) 45deg + #col.inactive_border = rgba(595959aa) + col.active_border=$pink $mauve 45deg + col.inactive_border=$surface2 + + layout = dwindle +} + +decoration { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + + rounding = 10 + + blur { + enabled = true + size = 3 + passes = 1 + } + + drop_shadow = yes + shadow_range = 4 + shadow_render_power = 3 + col.shadow = $lavender +} + +animations { + enabled = yes + + # Some default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more + + bezier = myBezier, 0.05, 0.9, 0.1, 1.05 + + animation = windows, 1, 6, myBezier + animation = windowsOut, 1, 6, default, popin 80% + animation = border, 1, 10, default + animation = borderangle, 1, 8, default + animation = fade, 1, 5, default + animation = workspaces, 1, 4, default +} + +dwindle { + # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more + pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below + preserve_split = yes # you probably want this +} + +master { + # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more + new_is_master = true +} + +gestures { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + workspace_swipe = off +} + + +# Example windowrule v1 +# windowrule = float, ^(kitty)$ +# Example windowrule v2 +# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ +# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more + + +# See https://wiki.hyprland.org/Configuring/Keywords/ for more +$mainMod = ALT + +# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more +bind = $mainMod, Q, exec, kitty zsh +bind = $mainMod, C, exec, ~/Documents/closewindow.sh +#bind = $mainMod, M, exit, +bind = $mainMod, E, exec, kitty nnn +bind = $mainMod, V, togglefloating, +bind = $mainMod, R, exec, wofi --show drun --allow-images +bind = $mainMod, S, pseudo, # dwindle +bind = $mainMod, J, togglesplit, # dwindle +bind = $mainMod, P, exec, grim -g "$(slurp)" - | wl-copy +# Move focus with mainMod + arrow keys +bind = $mainMod, left, movefocus, l +bind = $mainMod, right, movefocus, r +bind = $mainMod, up, movefocus, u +bind = $mainMod, down, movefocus, d + +# Switch workspaces with mainMod + [0-9] +bind = $mainMod, 1, workspace, 1 +bind = $mainMod, 2, workspace, 2 +bind = $mainMod, 3, workspace, 3 +bind = $mainMod, 4, workspace, 4 +bind = $mainMod, 5, workspace, 5 +bind = $mainMod, 6, workspace, 6 +bind = $mainMod, 7, workspace, 7 +bind = $mainMod, 8, workspace, 8 +bind = $mainMod, 9, workspace, 9 +bind = $mainMod, 0, workspace, 10 + +# Move active window to a workspace with mainMod + SHIFT + [0-9] +bind = $mainMod SHIFT, 1, movetoworkspace, 1 +bind = $mainMod SHIFT, 2, movetoworkspace, 2 +bind = $mainMod SHIFT, 3, movetoworkspace, 3 +bind = $mainMod SHIFT, 4, movetoworkspace, 4 +bind = $mainMod SHIFT, 5, movetoworkspace, 5 +bind = $mainMod SHIFT, 6, movetoworkspace, 6 +bind = $mainMod SHIFT, 7, movetoworkspace, 7 +bind = $mainMod SHIFT, 8, movetoworkspace, 8 +bind = $mainMod SHIFT, 9, movetoworkspace, 9 +bind = $mainMod SHIFT, 0, movetoworkspace, 10 + +# Scroll through existing workspaces with mainMod + scroll +bind = $mainMod, mouse_down, workspace, e+1 +bind = $mainMod, mouse_up, workspace, e-1 + +# Move/resize windows with mainMod + LMB/RMB and dragging +bindm = $mainMod, mouse:272, movewindow +bindm = $mainMod, mouse:273, resizewindow''; + }; + home-manager.users.insert.home.file.".config/hypr/frappe.conf" = { + text = ''$rosewaterAlpha = f2d5cf +$flamingoAlpha = eebebe +$pinkAlpha = f4b8e4 +$mauveAlpha = ca9ee6 +$redAlpha = e78284 +$maroonAlpha = ea999c +$peachAlpha = ef9f76 +$yellowAlpha = e5c890 +$greenAlpha = a6d189 +$tealAlpha = 81c8be +$skyAlpha = 99d1db +$sapphireAlpha = 85c1dc +$blueAlpha = 8caaee +$lavenderAlpha = babbf1 + +$textAlpha = c6d0f5 +$subtext1Alpha = b5bfe2 +$subtext0Alpha = a5adce + +$overlay2Alpha = 949cbb +$overlay1Alpha = 838ba7 +$overlay0Alpha = 737994 + +$surface2Alpha = 626880 +$surface1Alpha = 51576d +$surface0Alpha = 414559 + +$baseAlpha = 303446 +$mantleAlpha = 292c3c +$crustAlpha = 232634 + +$rosewater = 0xfff2d5cf +$flamingo = 0xffeebebe +$pink = 0xfff4b8e4 +$mauve = 0xffca9ee6 +$red = 0xffe78284 +$maroon = 0xffea999c +$peach = 0xffef9f76 +$yellow = 0xffe5c890 +$green = 0xffa6d189 +$teal = 0xff81c8be +$sky = 0xff99d1db +$sapphire = 0xff85c1dc +$blue = 0xff8caaee +$lavender = 0xffbabbf1 + +$text = 0xffc6d0f5 +$subtext1 = 0xffb5bfe2 +$subtext0 = 0xffa5adce + +$overlay2 = 0xff949cbb +$overlay1 = 0xff838ba7 +$overlay0 = 0xff737994 + +$surface2 = 0xff626880 +$surface1 = 0xff51576d +$surface0 = 0xff414559 + +$base = 0xff303446 +$mantle = 0xff292c3c +$crust = 0xff232634''; + }; + home-manager.users.insert.home.file.".config/waybar/frappe.css" = { + text = ''/* +* +* Catppuccin Frappe palette +* Maintainer: rubyowo +* +*/ + +@define-color base #303446; +@define-color mantle #292c3c; +@define-color crust #232634; + +@define-color text #c6d0f5; +@define-color subtext0 #a5adce; +@define-color subtext1 #b5bfe2; + +@define-color surface0 #414559; +@define-color surface1 #51576d; +@define-color surface2 #626880; + +@define-color overlay0 #737994; +@define-color overlay1 #838ba7; +@define-color overlay2 #949cbb; + +@define-color blue #8caaee; +@define-color lavender #babbf1; +@define-color sapphire #85c1dc; +@define-color sky #99d1db; +@define-color teal #81c8be; +@define-color green #a6d189; +@define-color yellow #e5c890; +@define-color peach #ef9f76; +@define-color maroon #ea999c; +@define-color red #e78284; +@define-color mauve #ca9ee6; +@define-color pink #f4b8e4; +@define-color flamingo #eebebe; +@define-color rosewater #f2d5cf;''; + }; +} \ No newline at end of file diff --git a/sunshine.nix b/sunshine.nix new file mode 100644 index 0000000..5016352 --- /dev/null +++ b/sunshine.nix @@ -0,0 +1,51 @@ +{ config, lib, pkgs, ... }: +#source: https://github.com/RandomNinjaAtk/nixos/blob/d2480c148e882f49e5caa6267060fd2d9e10af9b/services.sunshine.nix +#https://discourse.nixos.org/t/sunshine-self-hosted-game-stream/25608/16 + +with lib; + +let + + cfg = config.services.sunshine; + +in + +{ + options = { + + services.sunshine = { + enable = mkEnableOption (mdDoc "Sunshine"); + }; + + }; + + config = mkIf config.services.sunshine.enable { + + environment.systemPackages = [ + pkgs.sunshine + ]; + + security.wrappers.sunshine = { + owner = "root"; + group = "root"; + capabilities = "cap_sys_admin+p"; + source = "${pkgs.sunshine}/bin/sunshine"; + }; + + # Requires to simulate input + boot.kernelModules = [ "uinput" ]; + services.udev.extraRules = '' + KERNEL=="uinput", SUBSYSTEM=="misc", OPTIONS+="static_node=uinput", TAG+="uaccess" + ''; + + systemd.user.services.sunshine = + { + description = "sunshine"; + wantedBy = [ "graphical-session.target" ]; + serviceConfig = { + ExecStart = "${config.security.wrapperDir}/sunshine"; + }; + }; + + }; +}