{ inputs, self, ... }: { flake.homeConfigurations."grey@takamaki" = inputs.home-manager.lib.homeManagerConfiguration { pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux; modules = [ self.homeModules."grey@takamaki" inputs.stylix.homeModules.stylix ]; extraSpecialArgs = { inherit inputs; }; }; flake.homeModules."grey@takamaki" = { pkgs, config, lib, ... }: { imports = with self.homeModules; [ global audio graphics gaming ]; info = { userName = "grey"; hostName = "takamaki"; rootPath = "/home/grey/flake"; stateVersion = "26.11"; }; services.gpg-agent = { enable = true; extraConfig = '' pinentry-program /usr/bin/pinentry ''; }; components = { windowManagers = "niri"; shells = "noctalia"; }; features = { shells.zsh.antidote.enable = true; services = { easyeffects.enable = true; }; hardware = { steam-controller.enable = true; }; applications = { cli = { fastfetch.enable = true; color-converter.enable = true; nh.enable = true; }; gui = { vscode.enable = true; equibop = { enable = true; autostart = true; }; kitty.enable = true; spotify = { enable = true; spicetify = { enable = true; theme = "comfy"; }; }; }; extraPackages = with pkgs; [ nix-init github-desktop ]; shellScripts = let mkBrightnessScript = direction: '' LOOP_COUNTER=0 DEVICE=$1 PRETTY_NAME=$(sudo ddccontrol dev:$DEVICE 2>&1 >/dev/null | grep -oP "/usr/share/ddccontrol-db/monitor/\K.+\.xml" | sed 's/.xml//') WRITTEN="foo" CONTROL="bar" while [[ "$WRITTEN" != "$CONTROL" ]] && [ $LOOP_COUNTER -lt 3 ]; do RESULT=$(sudo ddccontrol -r 0x10 -W ${direction}5 dev:$DEVICE 2> /dev/null) WRITTEN=$(echo $RESULT | grep -oP "Writing.+\(\K\d{1,3}\)" | sed 's/)//') CONTROL=$(echo $RESULT | grep -oP "Control.+\+/\K\d{1,3}/100" | sed 's/\/100//') LOOP_COUNTER=$(($LOOP_COUNTER + 1)) done noctalia msg notification-show "Set brightness to $WRITTEN for display $PRETTY_NAME" ''; in { switch-os = '' sudo efibootmgr --bootnext 0000 sudo reboot ''; universal-reboot = '' sudo reboot ''; universal-shutdown = '' sudo systemctl poweroff ''; toggle-easyeffects = lib.mkIf (config.features.services.easyeffects.enable) '' bypass_value=$(easyeffects -b 3) if [ "$bypass_value" = "1" ]; then easyeffects -b 2 else easyeffects -b 1 fi ''; increase-brightness = mkBrightnessScript "+"; decrease-brightness = mkBrightnessScript "-"; niri-scratch-workspace-toggle = '' if niri msg --json workspaces-with-hidden | jq -e '.[] | select(.name=="x") | .is_hidden' >/dev/null; then niri msg action unhide-workspace --focus=false "x" OUTPUT=$(niri msg --json focused-output | jq '.name' | sed 's/"//g') echo "OUTPUT=$OUTPUT" niri msg action move-workspace-to-monitor --reference "x" "$OUTPUT" echo "moved scratch workspace: $(niri msg --json workspaces | jq '.[] | select(.name=="x") | .output')" niri msg action focus-workspace "x" else niri msg action hide-workspace "x" fi ''; niri-listen-for-scratch-workspace-change = '' niri msg --json event-stream | while read -r event; do if echo $event | jq -e '.WorkspaceActivated.focused' >/dev/null; then if niri msg --json workspaces | jq -e '.[] | select(.name=="x") | .is_active==false' >/dev/null; then niri msg action hide-workspace "x" fi elif echo $event | jq -e '.WorkspacesChanged.workspaces.[] | select(.name=="x") | .is_active==false' >/dev/null; then niri msg action hide-workspace "x" fi done ''; }; }; }; programs.ssh.settings = { "sakamoto" = { HostName = "192.168.0.40"; Port = "22"; User = "grey"; IdentityFile = "~/.ssh/id_sakamoto"; }; }; }; }