From d2be71c83c0c80927643fa88b4a694d381c107f8 Mon Sep 17 00:00:00 2001 From: chaos Date: Sun, 21 Jul 2024 21:00:14 +0100 Subject: [PATCH] remove wsl, sway, vivaldi --- flake.nix | 5 - home/apps/kitty.nix | 3 - home/apps/vivaldi.nix | 7 - home/gui/environments/sway/gammastep.nix | 8 - home/gui/environments/sway/mako.nix | 6 - home/gui/environments/sway/sway.nix | 163 ------------------- home/gui/environments/sway/waybar-bottom.nix | 13 -- home/gui/environments/sway/zsh-autostart.nix | 18 -- hosts/nixos.nix | 13 -- hosts/wsl/wsl.nix | 25 --- modules/nixos/wslBuildTarballExt.nix | 56 ------- outputs.nix | 4 - presets/nixos/desktopSway.nix | 11 -- presets/nixos/wslBase.nix | 43 ----- profiles/gui/environments/sway/sway.nix | 9 - profiles/remoteBuilders.nix | 2 +- 16 files changed, 1 insertion(+), 385 deletions(-) delete mode 100644 home/apps/vivaldi.nix delete mode 100644 home/gui/environments/sway/gammastep.nix delete mode 100644 home/gui/environments/sway/mako.nix delete mode 100644 home/gui/environments/sway/sway.nix delete mode 100644 home/gui/environments/sway/waybar-bottom.nix delete mode 100644 home/gui/environments/sway/zsh-autostart.nix delete mode 100644 hosts/wsl/wsl.nix delete mode 100644 modules/nixos/wslBuildTarballExt.nix delete mode 100644 presets/nixos/desktopSway.nix delete mode 100644 presets/nixos/wslBase.nix delete mode 100644 profiles/gui/environments/sway/sway.nix diff --git a/flake.nix b/flake.nix index 2d9e6c9..9f14f88 100644 --- a/flake.nix +++ b/flake.nix @@ -16,11 +16,6 @@ home-manager-unstable.url = "github:nix-community/home-manager"; home-manager-unstable.inputs.nixpkgs.follows = "nixpkgs-unstable"; - nixos-wsl.url = "github:nix-community/NixOS-WSL"; - nixos-wsl.inputs.nixpkgs.follows = "nixpkgs-unstable"; - nixos-wsl.inputs.flake-utils.follows = "flake-utils"; - nixos-wsl.inputs.flake-compat.follows = "flake-compat"; - tree-input.url = "github:kittywitch/tree"; tree-input.inputs.nixpkgs.follows = "nixpkgs-unstable"; diff --git a/home/apps/kitty.nix b/home/apps/kitty.nix index 7116c4c..e66d3ad 100644 --- a/home/apps/kitty.nix +++ b/home/apps/kitty.nix @@ -1,7 +1,4 @@ {...}: { - wayland.windowManager.sway.extraSessionCommands = '' - export KITTY_CACHE_DIRECTORY="/tmp/kitty"; - ''; programs.kitty = { enable = true; font.name = "Comic Code"; diff --git a/home/apps/vivaldi.nix b/home/apps/vivaldi.nix deleted file mode 100644 index d3ecb24..0000000 --- a/home/apps/vivaldi.nix +++ /dev/null @@ -1,7 +0,0 @@ -{pkgs, ...}: { - home.packages = with pkgs; [ - vivaldi - vivaldi-ffmpeg-codecs - #vivaldi-widevine - ]; -} diff --git a/home/gui/environments/sway/gammastep.nix b/home/gui/environments/sway/gammastep.nix deleted file mode 100644 index 1b726ef..0000000 --- a/home/gui/environments/sway/gammastep.nix +++ /dev/null @@ -1,8 +0,0 @@ -{...}: { - services.gammastep = { - enable = true; - tray = true; - latitude = "51.927031"; - longitude = "-0.654746"; - }; -} diff --git a/home/gui/environments/sway/mako.nix b/home/gui/environments/sway/mako.nix deleted file mode 100644 index 5d8b469..0000000 --- a/home/gui/environments/sway/mako.nix +++ /dev/null @@ -1,6 +0,0 @@ -{...}: { - services.mako = { - enable = true; - defaultTimeout = 3000; - }; -} diff --git a/home/gui/environments/sway/sway.nix b/home/gui/environments/sway/sway.nix deleted file mode 100644 index 9b95949..0000000 --- a/home/gui/environments/sway/sway.nix +++ /dev/null @@ -1,163 +0,0 @@ -{ - config, - pkgs, - lib, - tree, - ... -}: let - inherit (lib.modules) mkMerge; - inherit (lib.strings) escapeShellArgs; -in { - # import default terminal - imports = with tree; [home.apps.kitty home.apps.rofi]; - - home.sessionVariables = { - XDG_CURRENT_DESKTOP = "sway"; - XDG_SESSION_TYPE = "wayland"; - #WLR_DRM_DEVICES = "/dev/dri/card0"; - SDL_VIDEODRIVER = "wayland"; - QT_QPA_PLATFORM = "wayland"; - QT_WAYLAND_DISABLE_WINDOWDECORATION = 1; - # For Ghidra to make windows work properly - _JAVA_AWT_WM_NONREPARENTING = 1; - XCURSOR_SIZE = 64; - QT_AUTO_SCREEN_SCALE_FACTOR = 1; - SAL_USE_VCLPLUGIN = "gtk3"; # GTK3 on LibreOffice - }; - - home.pointerCursor = { - package = gnome.adwaita-icon-theme; - name = "Adwaita"; - size = 24; - - gtk.enable = true; - x11 = { - enable = true; - defaultCursor = "Adwaita"; - }; - }; - - home.packages = with pkgs; [ - grim - slurp - wl-clipboard - jq - wofi - wmctrl - libnotify - light - gobar - libdbusmenu-gtk3 - ]; - - wayland.windowManager.sway = { - enable = true; - wrapperFeatures.base = true; - wrapperFeatures.gtk = true; - config = let - modifier = "Mod1"; - - terminal = "${pkgs.kitty}/bin/kitty"; - menu = "${pkgs.rofi}/bin/rofi -show run"; - pactl = "${pkgs.pulseaudio}/bin/pactsl"; - in { - bars = [ - { - position = "top"; - fonts = { - names = ["Comic Code"]; - size = 14.0; - }; - statusCommand = escapeShellArgs [ - #"/home/chaos/Projects/rustbar/target/debug/rustbar" - "${pkgs.gobar}/bin/gobar" - "-config" - "cpu\\|mem\\|weather\\(Leighton\\ Buzzard\\)\\|bat\\(BAT0\\)\\|time" - ]; - } - {command = "${pkgs.waybar}/bin/waybar";} - ]; - - output = {"*" = {bg = "${pkgs.nixos-artwork.wallpapers.simple-dark-gray.gnomeFilePath} fill";};}; - input = {"*" = {xkb_layout = "gb";};}; - - fonts = { - names = ["Comic Code"]; - size = 18.0; - }; - - inherit modifier; - inherit terminal; - - startup = [ - # gets blueman applet working for some reason - { - command = "dbus-update-activation-environment DISPLAY"; - always = true; - } - { - command = "nm-applet"; - always = true; - } - ]; - - seat = {"*" = {"xcursor_theme" = "Adwaita 24";};}; - - gaps = { - top = 10; - bottom = 10; - left = 10; - right = 10; - inner = 20; - outer = 20; - smartGaps = true; - }; - - window = { - border = 0; - titlebar = false; - }; - - keybindings = mkMerge [ - { - "${modifier}+Return" = "exec ${terminal}"; - - "${modifier}+Left" = "focus left"; - "${modifier}+Down" = "focus down"; - "${modifier}+Up" = "focus up"; - "${modifier}+Right" = "focus right"; - - "${modifier}+Shift+Left" = "move left"; - "${modifier}+Shift+Down" = "move down"; - "${modifier}+Shift+Up" = "move up"; - "${modifier}+Shift+Right" = "move right"; - - "${modifier}+Shift+space" = "floating toggle"; - "${modifier}+space" = "focus mode_toggle"; - - "XF86AudioRaiseVolume" = "exec ${pactl} set-sink-volume @DEFAULT_SINK@ +5%"; - "XF86AudioLowerVolume" = "exec ${pactl} set-sink-volume @DEFAULT_SINK@ -5%"; - "XF86AudioMute" = "exec ${pactl} set-sink-mute @DEFAULT_SINK@ toggle"; - "XF86AudioMicMute" = "exec ${pactl} set-source-mute @DEFAULT_SOURCE@ toggle"; - "XF86MonBrightnessDown" = "exec sudo xbacklight -time 1 -dec +5"; - "XF86MonBrightnessUp" = "exec sudo xbacklight -time 1 -inc +5"; - "Print" = '' - exec ${pkgs.grim}/bin/grim -t png -g "$(${pkgs.slurp}/bin/slurp -d)" - | ${pkgs.wl-clipboard}/bin/wl-copy -t image/png''; - "Shift+Print" = "exec ${pkgs.grim}/bin/grim -t png - | ${pkgs.wl-clipboard}/bin/wl-copy -t image/png"; - - "${modifier}+d" = "exec ${menu}"; - "${modifier}+f" = "fullscreen"; - - "${modifier}+Shift+q" = "kill"; - "${modifier}+Shift+c" = "reload"; - - "${modifier}+r" = "mode resize"; - } - (mkMerge (map (workspace: { - "${modifier}+${workspace}" = "workspace ${workspace}"; - "${modifier}+Shift+${workspace}" = "move container to workspace ${workspace}"; - }) ["1" "2" "3" "4" "5" "6" "7" "8" "9"])) - ]; - }; - }; -} diff --git a/home/gui/environments/sway/waybar-bottom.nix b/home/gui/environments/sway/waybar-bottom.nix deleted file mode 100644 index 06b57df..0000000 --- a/home/gui/environments/sway/waybar-bottom.nix +++ /dev/null @@ -1,13 +0,0 @@ -{...}: { - programs.waybar = { - enable = true; - settings = [ - { - position = "bottom"; - modules-left = []; - modules-center = []; - modules-right = ["tray"]; - } - ]; - }; -} diff --git a/home/gui/environments/sway/zsh-autostart.nix b/home/gui/environments/sway/zsh-autostart.nix deleted file mode 100644 index dec627e..0000000 --- a/home/gui/environments/sway/zsh-autostart.nix +++ /dev/null @@ -1,18 +0,0 @@ -{...}: { - programs.zsh.profileExtra = '' - # If running from tty1 start sway - if [ "$(tty)" = "/dev/tty1" ]; then - systemctl --user unset-environment \ - SWAYSOCK \ - I3SOCK \q - WAYLAND_DISPLAY \ - DISPLAY \ - IN_NIX_SHELL \ - __HM_SESS_VARS_SOURCED \ - GPG_TTY \ - NIX_PATH \ - SHLVL - exec env --unset=SHLVL systemd-cat -t sway -- sway - fi - ''; -} diff --git a/hosts/nixos.nix b/hosts/nixos.nix index 0aa9576..0dedd0a 100644 --- a/hosts/nixos.nix +++ b/hosts/nixos.nix @@ -29,15 +29,12 @@ inputs.home-manager-unstable.nixosModules.home-manager - inputs.nixos-wsl.nixosModules.default - inputs.vaultui.nixosModules.default tree.modules.nixos.rcloneServe tree.modules.nixos.rcloneSync tree.modules.nixos.secrets tree.modules.nixos.postgreSQLRemoteBackup - tree.modules.nixos.wslBuildTarballExt tree.modules.nixos.encryptedDrive ]; @@ -83,16 +80,6 @@ in rec { modules = defaultModules ++ [./lappy-surface/lappy-surface.nix ./lappy-surface/hardware.nix]; }; - wsl = nixosUnstableSystem { - specialArgs = - defaultSpecialArgs - // { - hostPath = ./wsl; - }; - system = "x86_64-linux"; - modules = defaultModules ++ [./wsl/wsl.nix]; - }; - hetzner-arm = nixosUnstableSystem { specialArgs = defaultSpecialArgs diff --git a/hosts/wsl/wsl.nix b/hosts/wsl/wsl.nix deleted file mode 100644 index c34a69f..0000000 --- a/hosts/wsl/wsl.nix +++ /dev/null @@ -1,25 +0,0 @@ -{tree, ...}: { - imports = with tree; [ - users.root - users.chaos - profiles.sshd - - presets.nixos.wslBase - - profiles.cross.arm64 - profiles.remoteBuilders - ]; - - home-manager.users.root = { - home.stateVersion = "24.05"; - }; - - home-manager.users.chaos = { - home.stateVersion = "24.05"; - }; - - networking.hostName = "wsl"; - time.timeZone = "Europe/London"; - - system.stateVersion = "24.05"; -} diff --git a/modules/nixos/wslBuildTarballExt.nix b/modules/nixos/wslBuildTarballExt.nix deleted file mode 100644 index d01f605..0000000 --- a/modules/nixos/wslBuildTarballExt.nix +++ /dev/null @@ -1,56 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: let - inherit (lib.modules) mkIf; - cfg = config.wsl; -in { - config = mkIf cfg.enable { - system.build.tarballBuilderExt = pkgs.writeShellApplication { - name = "nixos-wsl-tarball-builder-ext"; - - runtimeInputs = with pkgs; [ - coreutils - gnutar - zstd - nixos-install-tools - config.nix.package - ]; - - text = '' - if ! [ $EUID -eq 0 ]; then - echo "This script must be run as root!" - exit 1 - fi - - out=''${1:-nixos-wsl.tar.zst} - - root=$(mktemp -p "''${TMPDIR:-/tmp}" -d nixos-wsl-tarball.XXXXXXXXXX) - # FIXME: fails in CI for some reason, but we don't really care because it's CI - trap 'rm -rf "$root" || true' INT TERM EXIT - - chmod o+rx "$root" - - echo "[NixOS-WSL] Installing..." - nixos-install \ - --root "$root" \ - --no-root-passwd \ - --system ${config.system.build.toplevel} \ - --substituters "" - - echo "[NixOS-WSL] Compressing..." - tar -C "$root" \ - -cz \ - --sort=name \ - --mtime='@1' \ - --owner=0 \ - --group=0 \ - --numeric-owner \ - . \ - > "$out" - ''; - }; - }; -} diff --git a/outputs.nix b/outputs.nix index 12885a3..587ad17 100644 --- a/outputs.nix +++ b/outputs.nix @@ -9,10 +9,6 @@ in { inherit (hosts) nixosConfigurations; - - extras = { - wsl-tarball-builder = hosts.nixosConfigurations.wsl.config.system.build.tarballBuilderExt; - }; } // (inputs.flake-utils.lib.eachDefaultSystem ( system: let diff --git a/presets/nixos/desktopSway.nix b/presets/nixos/desktopSway.nix deleted file mode 100644 index 71fe4ee..0000000 --- a/presets/nixos/desktopSway.nix +++ /dev/null @@ -1,11 +0,0 @@ -{tree, ...}: { - imports = with tree; [ - presets.nixos.desktopBase - profiles.gui.environments.sway - ]; - home-manager.users.chaos = { - imports = with tree; [ - home.gui.environments.sway - ]; - }; -} diff --git a/presets/nixos/wslBase.nix b/presets/nixos/wslBase.nix deleted file mode 100644 index 9410288..0000000 --- a/presets/nixos/wslBase.nix +++ /dev/null @@ -1,43 +0,0 @@ -{tree, ...}: { - imports = with tree; [ - profiles.sound.base - profiles.sound.pipewire - profiles.gui.base - - profiles.firewallAllow.aria2c - profiles.firewallAllow.soulseek - profiles.mullvad - ]; - - home-manager.users.chaos = { - imports = with tree; [ - home.base - home.dev.all - home.homeFolders - home.sshWSL - - home.programming.editors.vscode - home.programming.languages.rust - home.programming.languages.nix - - home.gui.base - - home.apps.fileRoller - home.apps.mpv - - home.apps.quassel - home.apps.toot-cli - - home.apps.mullvad - home.apps.aria2 - home.apps.rclone - home.apps.restic - ]; - }; - - wsl = { - enable = true; - defaultUser = "chaos"; - interop.register = true; - }; -} diff --git a/profiles/gui/environments/sway/sway.nix b/profiles/gui/environments/sway/sway.nix deleted file mode 100644 index 4a56fef..0000000 --- a/profiles/gui/environments/sway/sway.nix +++ /dev/null @@ -1,9 +0,0 @@ -{...}: { - programs.sway.enable = true; - programs.xwayland.enable = true; - - services.xserver = { - enable = true; - displayManager.sddm.enable = true; - }; -} diff --git a/profiles/remoteBuilders.nix b/profiles/remoteBuilders.nix index 34981dc..3446a56 100644 --- a/profiles/remoteBuilders.nix +++ b/profiles/remoteBuilders.nix @@ -17,7 +17,7 @@ "lappy-surface" ] then usbSSHKeyFile - else if builtins.elem currentHostname ["wsl"] + else if builtins.elem currentHostname [] then normalSSHKeyFile else throw "host isn't configured for remote-builders";