diff --git a/flake.nix b/flake.nix index ca17245..d692414 100644 --- a/flake.nix +++ b/flake.nix @@ -10,7 +10,7 @@ nix-std.url = "github:chessai/nix-std"; ironbar = { - url = "github:JakeStanger/ironbar"; + url = "github:JakeStanger/ironbar"; inputs.nixpkgs.follows = "nixpkgs"; inputs.rust-overlay.follows = "rust-overlay"; }; diff --git a/home/home.nix b/home/home.nix index 645b9de..844798f 100644 --- a/home/home.nix +++ b/home/home.nix @@ -12,8 +12,8 @@ in { home.stateVersion = "22.11"; - imports = [ - inputs.ironbar.homeManagerModules.default + imports = [ + inputs.ironbar.homeManagerModules.default # inputs.anyrun.homeManagerModules.default # ./programs/eww/default.nix ]; @@ -97,28 +97,36 @@ in { icon_theme = icons.name; start = [ - { type = "workspaces"; all_monitors = true; } - { type = "sys_info"; + { + type = "workspaces"; + all_monitors = true; + } + { + type = "sys_info"; interval.memory = 30; interval.cpu = 1; format = [ - " {cpu_percent}%" - " {memory_used} / {memory_total} GB" + " {cpu_percent}%" + " {memory_used} / {memory_total} GB" ]; } ]; center = [ - { type = "focused"; icon_size = 8; } + { + type = "focused"; + icon_size = 8; + } ]; end = [ - { type = "music"; + { + type = "music"; player_type = "mpris"; on_click_middle = "playerctl play-pause"; on_scroll_up = "playerctl volume +5"; on_scroll_down = "playerctl volume -5"; } - { type = "clock"; } + {type = "clock";} ]; }; style = with palette-hex; (builtins.replaceStrings @@ -140,7 +148,7 @@ in { util.fg normal.red fonts.sans.name - "10"# (builtins.toString fonts.sans.size) + "10" # (builtins.toString fonts.sans.size) ] (builtins.readFile dots/ironbar.css)); }; @@ -191,16 +199,10 @@ in { xkb_options = "caps:escape"; }; }; - startup = [ - {command = "mullvad connect";} - {command = "swaybg -i $HOME/.nix/wallpaper.png -m fill";} - {command = "ckb-next -c -b";} - {command = "xrdb -l ~/.Xresources";} - {command = "swayosd --max-volume 100";} - {command = "keepassxc";} - {command = "swaync";} - {command = "persway daemon -d spiral -f \"[tiling] opacity 0.98; opacity 1\"";} - {command = "flashfocus -o 0.95 -t 175 -n 30 --no-flash-fullscreen -l on_open_close";} + startup = with pkgs; [ + {command = "${lib.getExe mullvad} connect";} + {command = "${lib.getExe xorg.xrdb} -l ~/.Xresources";} + {command = "${lib.getExe flashfocus} -o 0.95 -t 175 -n 30 --no-flash-fullscreen -l on_open_close";} ]; terminal = "kitty"; modifier = "Mod4"; @@ -210,7 +212,7 @@ in { "Mod4+e" = "exec thunar"; "Mod4+f" = "exec firefox"; "Mod4+Shift+e" = "exec wlogout"; - "Mod4+Shift+s" = "exec grim -g \"$(slurp)\" -t png -o \"$HOME/Pictures/$(date +%F_%H-%m-%S).png\" && notify-send \"Screenshot taken.\""; + "Mod4+Shift+s" = "exec grim -g \"$(slurp)\" -t png -o \"${config.home.homeDirectory}/Pictures/$(date +%F_%H-%m-%S).png\" && notify-send \"Screenshot taken.\""; "Mod4+Shift+Ctrl+s" = "exec kooha"; "Mod4+n" = "exec swaync-client -t"; "Mod4+Space" = "floating toggle; move absolute position center"; @@ -298,6 +300,28 @@ in { }; systemd.user.startServices = "sd-switch"; + systemd.user.services = with pkgs; + builtins.mapAttrs (name: cmd: { + Unit = { + Description = "${name}"; + }; + Service = { + ExecStart = cmd; + }; + Install = { + WantedBy = ["graphical-session.target"]; + }; + }) + { + swaybg = "${lib.getExe swaybg} -i ${rice.bg.image} -m fill"; + ckb-next = "${lib.getExe ckb-next} -c -b"; + swayosd = "${lib.getExe swayosd} --max-volume 100"; + keepassxc = "${lib.getExe keepassxc}"; + swaync = "${lib.getExe swaynotificationcenter}"; + persway = "${lib.getExe persway} daemon -d spiral -f \"[tiling] opacity 0.98; opacity 1\""; + # PYTHON APP CANT RUN AS SYSTEMD SERVICE HOW EMBARASSING + # flashfocus = "${lib.getExe flashfocus} -o 0.95 -t 175 -n 30 --no-flash-fullscreen -l on_open_close"; + }; xdg.enable = true; xresources.properties = with palette-hex; { @@ -399,7 +423,7 @@ in { # config = { # plugins = with inputs.anyrun.packages.${pkgs.system}; [ applications dictionary rink symbols stdin shell ]; # y = { fraction = 0.35; }; - # width = { absolute = 400; }; + # width = { absolute = 400; }; # height = { absolute = 600; }; # showResultsImmediately = true; # }; @@ -626,16 +650,15 @@ in { }; languages = { - language = [ { name = "rust"; - language-servers = [ "rust-analyzer" ]; + language-servers = ["rust-analyzer"]; } ]; # having tons of fun backporting the old config style to the new config schema!!!! - language-server = { + language-server = { rust-analyzer = { config = { cargo = { @@ -652,7 +675,6 @@ in { }; }; }; - }; }; diff --git a/overlay.nix b/overlay.nix index d2843e2..bfb91ea 100644 --- a/overlay.nix +++ b/overlay.nix @@ -14,10 +14,32 @@ podman-stable = final: prev: {podman-stable = final.stable.podman;}; wlroots = final: prev: { wlroots = final.unstable.wlroots_0_16.overrideAttrs (wfinal: wprev: { - postPatch = wprev.postPatch + ''substituteInPlace render/gles2/renderer.c --replace "glFlush();" "glFinish();"''; + postPatch = + wprev.postPatch + + '' + substituteInPlace render/gles2/renderer.c --replace "glFlush();" "glFinish();" + ''; }); }; - sway-unwrapped = final: prev: {sway-unwrapped = final.unstable.sway-unwrapped.override {wlroots = final.wlroots;};}; - sway = final: prev: {sway = final.unstable.sway.override {sway-unwrapped = final.sway-unwrapped;};}; + sway-unwrapped = final: prev: { + sway-unwrapped = + (final.unstable.sway-unwrapped.override { + wlroots = final.wlroots; + systemdSupport = true; + trayEnabled = true; + }) + .overrideAttrs ( + sfinal: sprev: { + patches = (sprev.patches or []) ++ [./sway-nvidia.patch]; + } + ); + }; + sway = final: prev: { + sway = final.unstable.sway.override { + sway-unwrapped = final.sway-unwrapped; + withBaseWrapper = true; + withGtkWrapper = true; + }; + }; swayfx = final: prev: {swayfx = final.unstable.swayfx.override {sway-unwrapped = final.sway-unwrapped;};}; } diff --git a/sway-nvidia.patch b/sway-nvidia.patch new file mode 100644 index 0000000..5435d4a --- /dev/null +++ b/sway-nvidia.patch @@ -0,0 +1,40 @@ +diff --git a/sway/main.c b/sway/main.c +index 85bc2f1..0129a58 100644 +--- a/sway/main.c ++++ b/sway/main.c +@@ -58,16 +58,25 @@ void detect_proprietary(int allow_unsupported_gpu) { + size_t line_size = 0; + while (getline(&line, &line_size, f) != -1) { + if (strncmp(line, "nvidia ", 7) == 0) { +- if (allow_unsupported_gpu) { +- sway_log(SWAY_ERROR, +- "!!! Proprietary Nvidia drivers are in use !!!"); +- } else { +- sway_log(SWAY_ERROR, +- "Proprietary Nvidia drivers are NOT supported. " +- "Use Nouveau. To launch sway anyway, launch with " +- "--unsupported-gpu and DO NOT report issues."); +- exit(EXIT_FAILURE); +- } ++ sway_log(SWAY_INFO, ++ "Thank you, based Nvidia user! o7" ++ ); ++ sway_log(SWAY_INFO, ++ " _ ___ __ " ++ ); ++ sway_log(SWAY_INFO, ++ " ____ _ __(_)___/ (_)___ _ _________ _____/ /_______" ++ ); ++ sway_log(SWAY_INFO, ++ " / __ \\ | / / / __ / / __ `/ / ___/ __ \\/ ___/ //_/ ___/" ++ ); ++ sway_log(SWAY_INFO, ++ " / / / / |/ / / /_/ / / /_/ / / / / /_/ / /__/ ,< (__ ) " ++ ); ++ sway_log(SWAY_INFO, ++ "/_/ /_/|___/_/\\__,_/_/\\__,_/ /_/ \\____/\\___/_/|_/____/ " ++ ); ++ + break; + } + if (strstr(line, "fglrx")) { diff --git a/system/configuration.nix b/system/configuration.nix index ecaeb8e..d6821d4 100644 --- a/system/configuration.nix +++ b/system/configuration.nix @@ -31,10 +31,10 @@ nix = { registry = lib.mapAttrs (_: value: {flake = value;}) inputs; settings = { - trusted-users = [ "bolt" ]; + trusted-users = ["bolt"]; experimental-features = "nix-command flakes"; substitute = true; - substituters = [ "https://anyrun.cachix.org" "https://jakestanger.cachix.org" ]; + substituters = ["https://anyrun.cachix.org" "https://jakestanger.cachix.org"]; trusted-public-keys = [ "jakestanger.cachix.org-1:VWJE7AWNe5/KOEvCQRxoE8UsI2Xs2nHULJ7TEjYm7mM=" "anyrun.cachix.org-1:pqBobmOjI7nKlsUMV25u9QHa9btJK65/C8vnO3p346s=" @@ -91,7 +91,7 @@ enable = true; settings = { default_session = { - command = "${lib.getExe pkgs.greetd.tuigreet} -r -g \"what's good\" --time --sessions ${pkgs.sway}/share/wayland-sessions -c 'sway --unsupported-gpu'"; + command = "${lib.getExe pkgs.greetd.tuigreet} -r -g \"what's good\" --time --sessions ${pkgs.sway}/share/wayland-sessions"; user = "greeter"; }; };