diff --git a/default.code-workspace b/default.code-workspace index 5af56afd..6fb22c3c 100644 --- a/default.code-workspace +++ b/default.code-workspace @@ -112,6 +112,21 @@ } }, "todo-tree.regex.regex": "($TAGS)((\\-.*|)\\(.*\\)):", // ($TAGS)((\\-.*|)\\(.*\\)): + "todo-tree.filtering.excludeGlobs": [ + "**/node_modules", + "**/README.md" + ], + "todo-tree.tree.groupedByTag": false, + "todo-tree.tree.groupedBySubTag": false, + "todo-tree.tree.flat": true, + + "dateTime.showSeconds": true, + + // GitLens + "gitlens.plusFeatures.enabled": false, // Disable the annoying pop-ups + "gitlens.launchpad.indicator.enabled": false, // Disable launchpad indicator as we are not using that functionality + "gitlens.statusBar.enabled": false, // Do not bloat the status bar + "gitlens.statusBar.pullRequests.enabled": false, }, "extensions": { diff --git a/flake.nix b/flake.nix index 84d9264c..2a728d69 100644 --- a/flake.nix +++ b/flake.nix @@ -218,6 +218,8 @@ inputs.nixpkgs.legacyPackages.${system}.ncurses inputs.nixpkgs.legacyPackages.${system}.pkg-config + + inputs.nixpkgs.legacyPackages.${system}.ungoogled-chromium # Web browser used in the integrated developer environment for interacting with the outside resources ]; inputsFrom = [ config.mission-control.devShell diff --git a/src/nixos/machines/morph/config/security.nix b/src/nixos/machines/morph/config/security.nix index da212eb1..690526ad 100644 --- a/src/nixos/machines/morph/config/security.nix +++ b/src/nixos/machines/morph/config/security.nix @@ -21,10 +21,10 @@ in { ]; # SECURITY(Krey): Currently a necessary malware to keep the CPU functional.. Such is the curse of i686/amd64 systems - hardware.cpu.intel.updateMicrocode = mkForce true; + hardware.cpu.amd.updateMicrocode = mkForce true; # NOTE(Krey): System designed to not need this - hardware.enableRedistributableFirmware = mkForce false; + hardware.enableRedistributableFirmware = mkForce true; } ]; } diff --git a/src/nixos/machines/morph/config/setup.nix b/src/nixos/machines/morph/config/setup.nix index 816b1c36..1d97b00d 100644 --- a/src/nixos/machines/morph/config/setup.nix +++ b/src/nixos/machines/morph/config/setup.nix @@ -13,6 +13,7 @@ in { nix.distributedBuilds = true; # Perform distributed builds if requested + services.sunshine.enable = true; services.openssh.enable = true; services.tor.enable = true; # FIXME(Krey): Kernel Panic on wake-up diff --git a/src/nixos/machines/morph/default.nix b/src/nixos/machines/morph/default.nix index 88feb460..7dcd66dc 100644 --- a/src/nixos/machines/morph/default.nix +++ b/src/nixos/machines/morph/default.nix @@ -9,6 +9,7 @@ # Users self.nixosModules.users-kreyren + self.homeManagerModules."kreyren@morph" # Files ./config/bootloader.nix @@ -27,6 +28,7 @@ ./services/binfmt.nix ./services/distributedBuilds.nix ./services/openssh.nix + ./services/sunshine.nix ./services/tor.nix ]; }; diff --git a/src/nixos/machines/morph/services/sunshine.nix b/src/nixos/machines/morph/services/sunshine.nix new file mode 100644 index 00000000..7e4ddced --- /dev/null +++ b/src/nixos/machines/morph/services/sunshine.nix @@ -0,0 +1,123 @@ +{ self, pkgs, config, lib, aagl, ... }: + +# MORPH-specific configuration of Sunshine + +let + inherit (lib) mkIf; + + akl-scripts = pkgs.kodi.packages.buildKodiAddon rec { + pname = "akl.scripts"; + namespace = "script.module.akl"; + version = "1.1.2"; + + src = pkgs.fetchzip { + url = "https://github.com/chrisism/repository.chrisism.dev/raw/refs/heads/main/matrix/script.module.akl/script.module.akl-1.1.2.zip"; + hash = "sha256-lS04rfGBgr+42JBkw1TKIfwI5x1MKHA2/9/r42yqSwY="; + }; + + propagatedBuildInputs = with pkgs.kodi.packages; [ + six + xbmcswift2 + routing + requests + ]; + + passthru = { + pythonPath = "lib"; + }; + + meta = with lib; { + homepage = "https://github.com/chrisism/repository.chrisism.dev/blob/main/matrix/plugin.program.akl"; + description = "Advanced Kodi Launcher"; + # maintainers = teams.kodi.members; + }; + }; + + # FIXME(Krey): Requires resources/scheme.sql installed in $USER/.kodi/addons/plugins.program.aki/resources/scheme.sql otherwise the addon will fail to deploy + akl = pkgs.kodi.packages.buildKodiAddon rec { + pname = "akl"; + namespace = "plugin.program.akl"; + version = "1.5.1"; + + src = pkgs.fetchzip { + url = "https://github.com/chrisism/repository.chrisism.dev/raw/refs/heads/main/matrix/plugin.program.akl/plugin.program.akl-1.5.1.zip"; + hash = "sha256-RK+DHt5LxGMPHV3i3HEZ8PSe7ukIa3wlN2yzuZnj/tc="; + }; + + propagatedBuildInputs = with pkgs.kodi.packages; [ + six + xbmcswift2 + routing + akl-scripts + ]; + + passthru = { + pythonPath = "resources/lib"; + }; + + meta = with lib; { + homepage = "https://github.com/chrisism/repository.chrisism.dev/blob/main/matrix/plugin.program.akl"; + description = "Advanced Kodi Launcher"; + # maintainers = teams.kodi.members; + }; + }; +in mkIf config.services.sunshine.enable { + services.sunshine.capSysAdmin = true; # Assign CAP_SYS_ADMIN for DRM/KMS screen capture + services.sunshine.openFirewall = true; # Open Firewall for local network + + # Enable Auto-Login + # FIXME-SECURITY(Krey): Require that the user is logged-in and out remotely + # services.displayManager.autoLogin.enable = true; + # services.displayManager.autoLogin.user = "kreyren"; + + # Desktop Environment - Kodi + # FIXME(Krey): Struggling to figure out a way to add and play linux games through kodi rn + # services.xserver.enable = true; + # services.xserver.desktopManager.kodi.enable = true; + # services.xserver.displayManager.lightdm.greeter.enable = false; + # # System-wide plugins - https://github.com/NixOS/nixpkgs/tree/nixos-24.05/pkgs/applications/video/kodi/addons + # services.xserver.desktopManager.kodi.package = pkgs.kodi.withPackages (p: with p; [ + # # osmc-skin + # # sponsorblock + # # youtube + # # akl + # # akl-scripts + # ]); + + # Desktop Environment - GNOME (Backup UI) + services.xserver.enable = true; + services.xserver.displayManager.gdm.enable = true; + services.xserver.displayManager.gdm.wayland = false; # Do not use wayland as it has issues rn + services.xserver.desktopManager.gnome.enable = true; + programs.dconf.enable = true; # Needed for home-manager to not fail deployment (https://github.com/nix-community/home-manager/issues/3113) + + # Tor Access to The Web UI + services.tor.relay.onionServices."sunshine".map = mkIf config.services.tor.enable [{ port = 80; target = { port = 47990; }; }]; # Provide the admin panel over onions to make it accessible + + # Broadcasted Applications + # services.sunshine.applications = { + # apps = [ + # { + # name = "Desktop"; + # image-path = "desktop.png"; + # } + # { + # name = "That Anime Game"; + # image-path = "${./images/sunshine-aagl-cover.png}"; + # # FIXME-QA(Krey): This doesn't work to open the anime-game + # detached = [ "${self.inputs.aagl.packages.x86_64-linux.anime-game-launcher}/bin/anime-game-launcher" ]; + # } + # { + # # DNM(Krey): For Testing.. + # name = "Alacritty"; + # image-path = "desktop.png"; + # detached = [ "${pkgs.alacritty}/bin/alacritty" ]; + # } + # ]; + # }; + + # # Impermanence + # environment.persistence."/nix/persist/system".directories = mkIf config.boot.impermanence.enable [ + # "/home/sunshine/.local/share/anime-game-launcher" + # ]; +} diff --git a/src/nixos/users/users/kreyren/home/machines/default.nix b/src/nixos/users/users/kreyren/home/machines/default.nix index 02d68cb1..1a7bb506 100644 --- a/src/nixos/users/users/kreyren/home/machines/default.nix +++ b/src/nixos/users/users/kreyren/home/machines/default.nix @@ -2,6 +2,7 @@ imports = [ ./ignucius ./lengo + ./morph ./sinnenfreude ./tupac ]; diff --git a/src/nixos/users/users/kreyren/home/machines/morph/default.nix b/src/nixos/users/users/kreyren/home/machines/morph/default.nix new file mode 100644 index 00000000..a09c4943 --- /dev/null +++ b/src/nixos/users/users/kreyren/home/machines/morph/default.nix @@ -0,0 +1,41 @@ +{ config, inputs, self, ... }: + +let + inherit (config.flake) homeManagerModules; +in { + # Module + flake.homeManagerModules."kreyren@morph".imports = [ + homeManagerModules.kreyren + { + home-manager = { + users.kreyren.imports = [ + ./home-configuration.nix + ]; + backupFileExtension = "backup"; # To avoid build failures on generated files + }; + } + ]; + + # FIXME(Krey): Figure out how to make this work on non-standalone nix distro scenario or on foreign infrastructure managements + # # Standalone declaration + # flake.homeManagerConfigurations."kreyren@ignucius" = inputs.home-manager-nixpkgs.lib.homeManagerConfiguration { + # pkgs = import inputs.nixpkgs { + # system = "x86_64-linux"; + # nixpkgs.config.allowUnfree = true; + # }; + # modules = [ + # { home.stateVersion = "23.11"; } + + # self.nixosModules.homeManagerConfiguration.kreyren.default + + # ./home-configuration.nix + # ]; + + # extraSpecialArgs = { + # unstable = import inputs.nixpkgs-unstable { + # system = "x86_64-linux"; + # nixpkgs.config.allowUnfree = true; + # }; + # }; + # }; +} diff --git a/src/nixos/users/users/kreyren/home/machines/morph/home-configuration.nix b/src/nixos/users/users/kreyren/home/machines/morph/home-configuration.nix new file mode 100644 index 00000000..5b02d4f4 --- /dev/null +++ b/src/nixos/users/users/kreyren/home/machines/morph/home-configuration.nix @@ -0,0 +1,173 @@ +{ config, pkgs, lib, unstable, aagl, nixosConfig, ... }: + +# Kreyren's Home-Manager configuration for the MORPH system + +let + inherit (lib) mkIf getName; + inherit (builtins) elem; +in { + # TODO(Krey): Enable this only when GTK is used by the UI + gtk.enable = true; + + home.impermanence.enable = true; + + # Terminal + # TOOD(Krey): Different UIs will likely require different terminal solutions.. Decide how to handle later.. + programs.alacritty.enable = true; # Rust-based Video-accelarated terminal + # FIXME(Krey): Doesn't work with scaling below 100% on GNOME + programs.kitty.enable = false; # Alternative Rust-based Hardware-accelarated terminal for testing, potentially superrior to alacritty + + # Shell + # TODO(Krey): Different UIs will likely require different shell solutions, decide how to handle later.. + programs.bash.enable = true; + programs.starship.enable = true; + + # Utilities + programs.direnv.enable = true; # To manage git repositories + programs.git.enable = true; # Generic use only + programs.gpg.enable = true; + programs.nix-index.enable = true; + services.gpg-agent.enable = true; + + # Web Browsers + programs.firefox.enable = true; # Configured as fully hardened web browser (Privacy > Comfort) + programs.librewolf.enable = true; # Configured as lesser security web browser (Comfort > Privacy) + + # File Editors + programs.vim.enable = true; + programs.vscode.enable = true; + + # Non-Free Allow List + nixpkgs.config.allowUnfreePredicate = pkg: elem (getName pkg) [ + # FIXME(Krey): Using vscodium, no idea why this needs 'vscode' set + "vscode" + + # FIXME(Krey): It's ET: Legacy, what's proprietary there? + "etlegacy" + "etlegacy-assets" + + # Flexibility of communication with some projects that hate privacy or what the fuck + "discord" + ]; + + home.packages = [ + # Instant-Chats + (mkIf config.gtk.enable pkgs.fractal) # GTK4+ Matrix Client Written in Rust + # FIXME-QA(Krey): Enable this on QT-based desktop environments + # pkgs.nheko # QT-based Matrix Client + + # Temporary management of Post-Quantum Safety until matrix manages it, see https://github.com/matrix-org/matrix-spec/issues/975 for details + unstable.simplex-chat-desktop + + # Temporary managment of IRC until it's implemented in our matrix server + pkgs.hexchat # Unmaintained package, no better known for the protocol + + # Discord client for flexibility + pkgs.dissent + + pkgs.libreoffice + + # polymc.polymc + + # 3D Printing Slicers + pkgs.prusa-slicer + pkgs.super-slicer-beta # Prusa-slicer fork by community. Includes additional features, but lags behind in releases + pkgs.orca-slicer # Prusa-slicer fork by BambuLab adapted by the community + + # Games + aagl.anime-game-launcher # An Anime Game <3 + pkgs.colobot + pkgs.etlegacy # Wolfenstein: Enemy Territory + pkgs.airshipper # Veloren + pkgs.mindustry + + # Web Browsers + pkgs.tor-browser-bundle-bin # Standard Tor Web Browser + (pkgs.brave.overrideAttrs (super: { + postInstall = '' + wrapProgram $out/bin/brave \ + --append-flags "--no-proxy-server" + ''; + })) # Standard Insecure Web Browser + + # Engineering + pkgs.blender + pkgs.freecad + pkgs.gimp + pkgs.kicad-small + + # Utility + pkgs.keepassxc + pkgs.yt-dlp + pkgs.android-tools + pkgs.picocom # Interface for Serial Console devices + pkgs.bottles # Wine Management Tool + pkgs.mtr # Packet Loss Tester + pkgs.sc-controller # Steam Controller Software + pkgs.monero-gui + pkgs.dialect # Language Translator + pkgs.endeavour # To-Do Notes + # FIXME-QA(Krey): As of 24th Jun 2024 this doesn't build + # pkgs.gaphor # Mind Maps + # TODO(Krey): This should probably be applied depending on the used UI + pkgs.kooha # Screen Recorder + # FIXME(Krey): Broken in stable + pkgs.qbittorrent # Torrents + pkgs.tealdeer # TLDR Pages Implementation + pkgs.nextcloud-client + # FIXME(Krey): To be managed.. + #(mkIf (config.system.nixos.release != "24.11") pkgs.printrun) # Currently broken in unstable+ + + # Video + pkgs.stremio # Media Server Client + pkgs.freetube # YouTube Client + pkgs.mpv + pkgs.vlc + ]; + + # Per-system adjustments to the GNOME Extensions + # TODO(Krey): This should be applied based on used UI + dconf.settings = mkIf nixosConfig.services.xserver.desktopManager.gnome.enable { + # Set power management for a scenario where user is logged-in + "org/gnome/settings-daemon/plugins/power" = { + power-button-action = "hibernate"; + sleep-inactive-ac-timeout = 600; # 60*10=600 Seconds -> 10 Minutes + sleep-inactive-ac-type = "suspend"; + }; + + # System Monitor + "org/gnome/gnome-system-monitor" = { + show-dependencies = false; + show-whose-processes= "user"; + }; + + "org/gnome/gnome-system-monitor/disktreenew" = { + col-6-visible = true; + col-6-width = 0; + }; + + "org/gnome/shell/extensions/vitals" = { + fixed-widths = true; + hide-icons = true; + hide-zeros = false; + icon-style = 1; + include-static-info = false; + menu-centered = false; + network-speed-format = 1; + position-in-panel = 0; + show-battery = true; + show-gpu = false; # Nvidia only, system without dGPU + update-time = 3; + use-higher-precision = true; + + hot-sensors = [ + "__temperature_max__" + "_system_load_1m_" + "_memory_usage_" + "__network-tx_max__" + "__network-rx_max__" + "_battery_rate_" + ]; + }; + }; +} diff --git a/src/nixos/users/users/kreyren/home/modules/editors/vscode/vscode.nix b/src/nixos/users/users/kreyren/home/modules/editors/vscode/vscode.nix index 0715c37c..10e835cf 100644 --- a/src/nixos/users/users/kreyren/home/modules/editors/vscode/vscode.nix +++ b/src/nixos/users/users/kreyren/home/modules/editors/vscode/vscode.nix @@ -27,6 +27,12 @@ in mkIf config.programs.vscode.enable { # Set Theme # FIXME(Krey): Needs to be packaged #"workbench.colorTheme" = "Shades of Purple (Super Dark)"; + "workbench.colorTheme" = "Abyss"; + + "window.newWindowDimensions" = "fullscreen"; + + # To make the built-in web browser in vscodium to work + "browse-lite.chromeExecutable" = "${pkgs.ungoogled-chromium}/bin/chromium"; }; }; }