diff --git a/flake.lock b/flake.lock index b305b13..0b3581e 100644 --- a/flake.lock +++ b/flake.lock @@ -42,24 +42,6 @@ "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" - } - }, "home-manager": { "inputs": { "nixpkgs": [ @@ -99,11 +81,11 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1764667669, - "narHash": "sha256-7WUCZfmqLAssbDqwg9cUDAXrSoXN79eEEq17qhTNM/Y=", + "lastModified": 1764950072, + "narHash": "sha256-BmPWzogsG2GsXZtlT+MTcAWeDK5hkbGRZTeZNW42fwA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "418468ac9527e799809c900eda37cbff999199b6", + "rev": "f61125a668a320878494449750330ca58b78c557", "type": "github" }, "original": { @@ -121,11 +103,11 @@ ] }, "locked": { - "lastModified": 1764960146, - "narHash": "sha256-wd0ph7unaRUFKPM3dIJOfMZg0K4LGl42fNtAvoqQzFM=", + "lastModified": 1765059149, + "narHash": "sha256-n6BiVAdPVN74XPjYM3PGNQCg9gF7oQI+ioRvdOfgUqs=", "owner": "nix-community", "repo": "NUR", - "rev": "0926af1a1925e04fcc9e9ddb3d500a78a4486942", + "rev": "a3a3e78202ab054dc9bedcf406437645ab3f68f4", "type": "github" }, "original": { @@ -142,11 +124,11 @@ ] }, "locked": { - "lastModified": 1764960146, - "narHash": "sha256-wd0ph7unaRUFKPM3dIJOfMZg0K4LGl42fNtAvoqQzFM=", + "lastModified": 1765059149, + "narHash": "sha256-n6BiVAdPVN74XPjYM3PGNQCg9gF7oQI+ioRvdOfgUqs=", "owner": "nix-community", "repo": "NUR", - "rev": "0926af1a1925e04fcc9e9ddb3d500a78a4486942", + "rev": "a3a3e78202ab054dc9bedcf406437645ab3f68f4", "type": "github" }, "original": { @@ -157,28 +139,12 @@ }, "root": { "inputs": { - "flake-utils": "flake-utils", "home-manager": "home-manager", "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", "nur": "nur", "nur-unstable": "nur-unstable" } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 25e07fc..226a22f 100644 --- a/flake.nix +++ b/flake.nix @@ -12,17 +12,13 @@ url = "github:nix-community/NUR"; inputs.nixpkgs.follows = "nixpkgs-unstable"; }; - flake-utils = { - url = "github:numtide/flake-utils"; - inputs.nixpkgs.follows = "nixpkgs"; - }; home-manager = { url = "github:nix-community/home-manager/release-25.11"; inputs.nixpkgs.follows = "nixpkgs"; }; }; - outputs = { self, nixpkgs, nixpkgs-unstable, nur, nur-unstable, flake-utils, home-manager, ... }: + outputs = { self, nixpkgs, nixpkgs-unstable, nur, nur-unstable, home-manager, ... }: let system = "x86_64-linux"; pkgs = import nixpkgs { diff --git a/home/alisceon.nix b/home/alisceon.nix deleted file mode 100644 index c51faab..0000000 --- a/home/alisceon.nix +++ /dev/null @@ -1,171 +0,0 @@ -{ pkgs, config, hostName, lib, ... }: { - home.username = "alisceon"; - home.homeDirectory = "/home/alisceon"; - home.stateVersion = "24.05"; - manual.manpages.enable = true; - - programs = { - fish = { - enable = true; - # Disable greeting - interactiveShellInit = '' - set fish_greeting - ''; - preferAbbrs = true; - shellAbbrs = { - ls = "exa"; - ll = "exa -lah"; - grep = "rg"; - cat = "bat"; - tsla-fan = "ipmitool -H 10.30.0.3 -U ADMIN -P ADMIN raw 0x30 0x70 0x66 0x01 0x0"; - - # NixOS commands - nixoss = "sudo nixos-rebuild switch --flake .#${hostName}"; - nixos-main = "git checkout main && git pull && sudo nixos-rebuild switch --flake .#${hostName}"; - nixossr = "sudo nixos-rebuild switch --flake .#${hostName} && reboot"; - nixost = "sudo nixos-rebuild build-vm --flake .#${hostName}"; - - # Development commands - devt = "devenv test"; - devs = "devenv shell"; - devu = "devenv up"; - devi = "nix flake init -t path:/home/alisceon/Templates/devenv#python"; - - pypod = "podman run --rm -it --network host -v '.:/run' -w '/run' python /run/"; - - # Tower commands - weboot = "nix shell nixpkgs#efibootmgr -c sudo efibootmgr -n 0000 && reboot"; - }; - }; # end fish - git = { - enable = true; - userName = "alisceon"; - userEmail = "alisceon@protonmail.com"; - extraConfig = { - push = { autoSetupRemote = true; }; - init.defaultBranch = "main"; - }; - }; # end git - vscode.enable = true; - firefox = { - enable = true; - nativeMessagingHosts = [ - pkgs.gnome-browser-connector - ]; - }; # end firefox - bat.enable = true; - ssh = { - enable = true; - matchBlocks = { - "alisceon.com" = { - hostname = "alisceon.com"; - user = "opc"; - }; - "miscbox" = { - hostname = "10.1.0.11"; - proxyJump = "alisceon.com"; - user = "opc"; - }; - "blogbox" = { - hostname = "10.1.0.10"; - proxyJump = "alisceon.com"; - user = "ubuntu"; - }; - "filurbox" = { - hostname = "oci.malice.zone"; - user = "opc"; - }; - "dnspi" = { - hostname = "10.40.0.2"; - user = "pi"; - }; - "tsla-exporter-bridge" = { - hostname = "alma02.lab.the.malice.zone"; - user = "root"; - }; - "tsla-runner-boi" = { - hostname = "alma03.lab.the.malice.zone"; - user = "root"; - }; - }; - }; # end ssh - direnv = { - enable = true; - silent = true; - }; # end direnv - }; # end programs - - # obsidian special case - programs.obsidian.enable = true; - # overide broken config - xdg.configFile."obsidian/obsidian.json".source = lib.mkForce ./conf/obsidian.json; - - home.packages = with pkgs; [ - signal-desktop - discord - eza - fd - ripgrep - ]; - - xdg = { - enable = true; - userDirs.enable = true; - mime.enable = true; - }; - - services.syncthing = { - enable = true; - }; - dconf.enable = true; - dconf.settings = { - "org/gnome/desktop/background" = { - color-shading-type = "solid"; - picture-options = "zoom"; - primary-color = "#000000000000"; - secondary-color = "#000000000000"; - picture-uri = "file:///home/alisceon/Pictures/system/bg.png"; - picture-uri-dark = "file:///home/alisceon/Pictures/system/bg.png"; - }; - "org/gnome/mutter" = { - auto-maximize = true; - }; - "org/gnome/desktop/interface" = { - accent-color = "red"; - color-scheme = "prefer-dark"; - }; - "org/gnome/shell" = { - disable-user-extensions = false; - enabled-extensions = [ pkgs.gnomeExtensions.ddterm.extensionUuid ]; - favorite-apps = [ - "org.gnome.Nautilus.desktop" - "firefox.desktop" - "code.desktop" - "obsidian.desktop" - "discord.desktop" - "signal.desktop" - ]; - }; - "org/gnome/shell/keybindings" = { - show-screenshot-ui = [ "s" ]; - }; - "org/gnome/settings-daemon/plugins/media-keys" = { - custom-keybindings = [ - "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/" - ]; - }; - "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = { - name = "GNOME Console"; - command = "kgx"; - binding = "Return"; - }; - "com/github/amezin/ddterm" = { - ddterm-toggle-hotkey = [ "Return" ]; - window-monitor = "focus"; - hide-when-focus-lost = true; - hide-window-on-esc = true; - tab-policy = "never"; - panel-icon-type = "none"; - }; - }; # end dconf.settings -} # end file diff --git a/home/alisceon/base.nix b/home/alisceon/base.nix index 638a7ee..6ee09e4 100644 --- a/home/alisceon/base.nix +++ b/home/alisceon/base.nix @@ -60,16 +60,31 @@ }; git = { enable = true; - userName = "alisceon"; - userEmail = "alisceon@protonmail.com"; - extraConfig = { + settings = { + user = { + name = "alisceon"; + email = "alisceon@protonmail.com"; + }; push = { autoSetupRemote = true; }; init.defaultBranch = "main"; }; }; # end git ssh = { enable = true; + enableDefaultConfig = false; matchBlocks = { + "*" = { + forwardAgent = false; + addKeysToAgent = "no"; + compression = false; + serverAliveInterval = 0; + serverAliveCountMax = 3; + hashKnownHosts = false; + userKnownHostsFile = "~/.ssh/known_hosts"; + controlMaster = "no"; + controlPath = "~/.ssh/master-%r@%n:%p"; + controlPersist = "no"; + }; "alisceon-core" = { hostname = "core.alisceon.com"; user = "opc"; diff --git a/home/conf/xonsh/xonshrc b/home/conf/xonsh/xonshrc index ea53e8f..b54b240 100644 --- a/home/conf/xonsh/xonshrc +++ b/home/conf/xonsh/xonshrc @@ -1,5 +1,21 @@ +## ALIASES ## +aliases["tsla-fan"] = "ipmitool -H 10.30.0.3 -U ADMIN -P ADMIN raw 0x30 0x70 0x66 0x01 0x0" +aliases["nixoss"] = "sudo nixos-rebuild switch --flake @('.#' + $(hostname))" +aliases["nixost"] = "sudo nixos-rebuild test --flake @('.#' + $(hostname))" +aliases["nixosb"] = "sudo nixos-rebuild build --flake @('.#' + $(hostname))" +aliases["nixos-dry"] = "sudo nixos-rebuild dry-build --flake @('.#' + $(hostname))" +aliases["init-python"] = "nix flake update --flake templates && nix flake init -t 'templates#python' && direnv allow" +aliases["weboot"] = "bash -c 'nix shell nixpkgs#efibootmgr -c sudo efibootmgr -n 0000 && reboot'" +aliases["ls"] = "exa" +aliases["ll"] = "exa -lah" +aliases["grep"] = "rg" +aliases["theo"] = "python ~/.config/xonsh/theo.py" +aliases["kittycatsay"] = "python ~/.config/xonsh/kittycatsay.py" + +## INTERACTIVE CONFIGURATION ## if $XONSH_INTERACTIVE: from datetime import datetime + import importlib.util t0 = datetime.now() ## ENV ## $XONSH_COLOR_STYLE = 'native' @@ -14,53 +30,26 @@ if $XONSH_INTERACTIVE: $LESS_TERMCAP_us = "\033[00;36m" $LESS_TERMCAP_ue = "\033[0m" -## XONTRIB ## -xontrib load coreutils -xontrib load fish_completer -xontrib load direnv -xontrib load clp -xontrib load bashisms -#xontrib load abbrevs #relies on xonsh.ptk_shell which was deprecated in 0.13 + ## XONTRIB ## + if importlib.util.find_spec("xontrib.coreutils") is not None: + xontrib load coreutils + if importlib.util.find_spec("xontrib.fish_completer") is not None: + xontrib load fish_completer + if importlib.util.find_spec("xontrib.direnv") is not None: + xontrib load direnv + if importlib.util.find_spec("xontrib.clp") is not None: + xontrib load clp + if importlib.util.find_spec("xontrib.bashisms") is not None: + xontrib load bashisms + if importlib.util.find_spec("xontrib.fzf_completions") is not None: + xontrib load fzf-completions + from xonsh.built_ins import XSH + XSH.env['fzf_history_binding'] = "c-r" # Ctrl+R + XSH.env['fzf_ssh_binding'] = "c-s" # Ctrl+S + XSH.env['fzf_file_binding'] = "c-t" # Ctrl+T + XSH.env['fzf_dir_binding'] = "c-g" # Ctrl+G -xontrib load fzf-completions -from xonsh.built_ins import XSH -XSH.env['fzf_history_binding'] = "c-r" # Ctrl+R -XSH.env['fzf_ssh_binding'] = "c-s" # Ctrl+S -XSH.env['fzf_file_binding'] = "c-t" # Ctrl+T -XSH.env['fzf_dir_binding'] = "c-g" # Ctrl+G - -## ALIASES ## -aliases["tsla-fan"] = "ipmitool -H 10.30.0.3 -U ADMIN -P ADMIN raw 0x30 0x70 0x66 0x01 0x0" -aliases["nixoss"] = "sudo nixos-rebuild switch --flake .#${config.networking.hostName}" -aliases["nixost"] = "sudo nixos-rebuild test --flake .#${config.networking.hostName}" -aliases["nixosb"] = "sudo nixos-rebuild build --flake .#${config.networking.hostName}" -aliases["nixosdb"] = "sudo nixos-rebuild dry-build --flake .#${config.networking.hostName}" -aliases["devt"] = "devenv test" -aliases["devtas"] = "devenv tasks list" -aliases["devtar"] = "devenv tasks run" -aliases["devs"] = "devenv shell" -aliases["devi-python"] = "nix flake init -t templates#python" -aliases["weboot"] = "bash -c 'nix shell nixpkgs#efibootmgr -c sudo efibootmgr -n 0000 && reboot'" -aliases["ls"] = "exa" -aliases["ll"] = "exa -lah" -aliases["grep"] = "rg" -aliases["theo"] = "python ~/.config/xonsh/theo.py" -aliases["kittycatsay"] = "python ~/.config/xonsh/kittycatsay.py" - -if $XONSH_INTERACTIVE: hour = t0.hour theo | kittycatsay - """ - if 5 <= hour < 10: - theo | cowsay -d - elif 10 <= hour < 16: - theo | cowsay -w - elif 16 <= hour < 18: - theo | cowsay - elif 18 <= hour < 22: - theo | cowsay -t - else: - theo | cowsay -s - """ dt = round((datetime.now() - t0).microseconds/1000000, 2) print("Load time:", dt, "seconds") \ No newline at end of file diff --git a/home/wm/sway.nix b/home/wm/sway.nix index 79af3f2..e6ea2f1 100644 --- a/home/wm/sway.nix +++ b/home/wm/sway.nix @@ -98,13 +98,13 @@ hostnameWorkspaceAssign = if hostName == "tower" then [ { output = "DP-2"; workspace = "1"; } - { output = "DP-3"; workspace = "2"; } - { output = "DP-1"; workspace = "3"; } - { output = "DP-2"; workspace = "4"; } + { output = "DP-2"; workspace = "2"; } + { output = "DP-2"; workspace = "3"; } + { output = "DP-3"; workspace = "4"; } { output = "DP-3"; workspace = "5"; } - { output = "DP-1"; workspace = "6"; } - { output = "DP-2"; workspace = "7"; } - { output = "DP-3"; workspace = "8"; } + { output = "DP-3"; workspace = "6"; } + { output = "DP-1"; workspace = "7"; } + { output = "DP-1"; workspace = "8"; } { output = "DP-1"; workspace = "9"; } ] else if hostName == "electra" then [] @@ -194,6 +194,7 @@ "${key_mod}+Return" = "exec ${term}"; "${key_mod}+d" = "exec ${dmenu}"; "${key_mod}+Shift+q" = "kill"; + "${key_mod}+F4" = "kill"; "${key_mod}+L" = "exec ${lock}"; # Workspaces "${key_mod}+f" = "fullscreen"; @@ -234,20 +235,25 @@ # Focus "${key_mod}+${key_left}" = "focus left"; + "${key_mod}+${key_right}" = "focus right"; "${key_mod}+${key_down}" = "focus down"; "${key_mod}+${key_up}" = "focus up"; - "${key_mod}+${key_right}" = "focus right"; - - "${key_mod}+Ctrl+${key_left}" = "move workspace to output left"; - "${key_mod}+Ctrl+${key_down}" = "move workspace to output down"; - "${key_mod}+Ctrl+${key_up}" = "move workspace to output up"; - "${key_mod}+Ctrl+${key_right}" = "move workspace to output right"; + # Move "${key_mod}+Shift+${key_left}" = "move left"; "${key_mod}+Shift+${key_down}" = "move down"; "${key_mod}+Shift+${key_up}" = "move up"; "${key_mod}+Shift+${key_right}" = "move right"; + # Sparkly alt-tab + "${key_mod}+Tab" = "focus right"; + "${key_mod}+Shift+Tab" = "focus left"; + "${key_mod}+Ctrl+Tab" = "move right"; + "${key_mod}+Ctrl+Shift+Tab" = "move left"; + "${key_mod}+Mod4+Tab" = "workspace next"; + "${key_mod}+Mod4+Shift+Tab" = "workspace prev"; + + # System "Mod4+space" = ''exec ${notify} -t 2000 "$(xonsh ~/.nixos_config/util/get_xkb.xonsh)"''; #Screenshot region @@ -260,6 +266,22 @@ "XF86AudioPlay" = "exec 'playerctl play-pause'"; "XF86MonBrightnessUp" = "exec ${pkgs.light}/bin/light -A 10"; "XF86MonBrightnessDown" = "exec ${pkgs.light}/bin/light -U 10"; + + # Function layer 4 esc-pgdn + "KP_End" = "exec"; + "KP_Down" = "exec"; + "KP_Next" = "exec"; + "KP_Left" = "exec"; + "KP_Begin" = "exec"; + "KP_Right" = "exec"; + "KP_Home" = "exec"; + "KP_Up" = "exec"; + "KP_Prior" = "exec"; + "KP_Insert" = "exec"; + "KP_Divide" = "exec"; + "KP_Multiply" = "exec"; + "KP_Subtract" = "exec"; + "KP_Add" = "exec"; }; # end keybindings window = { titlebar = false; @@ -304,10 +326,14 @@ }; # end colors assigns = { "1" = [{app_id = "firefox";}]; - "2" = [{class = "Code";}]; - "3" = [{class = "discord";}]; + "2" = [{class = "steam";}]; + "3" = []; + "4" = [{class = "Code";}]; "5" = [{app_id = "obsidian";}]; - "6" = [{app_id = "signal";}]; + "6" = []; + "7" = []; + "8" = [{app_id = "discord";}]; + "9" = [{app_id = "signal";}]; }; output = {} // hostnameOutput; workspaceOutputAssign = hostnameWorkspaceAssign; @@ -680,6 +706,17 @@ gesture pinch in 4 ${swaymsg} kill gesture swipe up 4 ${lock} ''; + xdg.configFile."electron-flags.conf".text = '' + --enable-features=WaylandWindowDecorations,AllowQt + --ozone-platform=wayland + --gtk-version=4 + ''; + xdg.configFile."chromium-flags.conf".text = '' + --enable-features=WaylandWindowDecorations,AllowQt + --ozone-platform=wayland + --gtk-version=4 + ''; + # this right here offends me https://source.chromium.org/chromium/chromium/src/+/main:base/nix/xdg_util.cc;l=179-180 systemd.user.sessionVariables = { GNOME_DESKTOP_SESSION_ID = "999"; diff --git a/hosts/common/wm/sway.nix b/hosts/common/wm/sway.nix index 193c128..8a2f667 100644 --- a/hosts/common/wm/sway.nix +++ b/hosts/common/wm/sway.nix @@ -73,7 +73,7 @@ enable = true; settings = { default_session = { - command = "${pkgs.greetd.tuigreet}/bin/tuigreet --time --cmd 'uwsm start -- sway-uwsm.desktop'"; + command = "${pkgs.tuigreet}/bin/tuigreet --time --cmd 'uwsm start -- sway-uwsm.desktop' --remember --asterisks''"; user = "greeter"; }; # end default_session }; # end settings diff --git a/hosts/common/workstation.nix b/hosts/common/workstation.nix index d5c970d..6abac3f 100644 --- a/hosts/common/workstation.nix +++ b/hosts/common/workstation.nix @@ -17,6 +17,13 @@ gnome-keyring.enable = true; gnome-initial-setup.enable = false; }; + # For keychron + udev.packages = [ + pkgs.via + pkgs.qmk + pkgs.qmk-udev-rules + pkgs.qmk_hid + ]; }; # end services services.fwupd.enable = true; @@ -28,6 +35,13 @@ }; }; # end programs + networking.firewall.allowedTCPPorts = [ + 1312 + 8000 + 8080 + 8888 + ]; + environment = { systemPackages = [ # Chat @@ -57,6 +71,7 @@ pkgs-unstable.obsidian pkgs.gparted pkgs.vlc + pkgs.via ]; # end systemPackages }; # end environment