From b921c2ac470a7cd22e063ae8f165437642e6c073 Mon Sep 17 00:00:00 2001 From: Jan Bulthuis Date: Wed, 31 Jul 2024 13:39:09 +0200 Subject: [PATCH] Progress on some things, can't remember what though --- .../background/glpaper/shaders/waves.glsl | 4 +-- modules/users/modules/desktop/bar/waybar.nix | 9 ++++++ .../modules/desktop/window-manager/river.nix | 31 ++++++++++++------- modules/users/modules/language/rust.nix | 14 +++++++-- modules/users/modules/obsidian/default.nix | 6 +++- modules/users/modules/rofi/rofi-rbw.nix | 1 - modules/users/modules/vscode/default.nix | 5 ++- pkgs/default.nix | 14 --------- pkgs/river/owm.nix | 20 ++++++++++++ users/jan.nix | 5 +-- 10 files changed, 74 insertions(+), 35 deletions(-) create mode 100644 pkgs/river/owm.nix diff --git a/modules/users/modules/desktop/background/glpaper/shaders/waves.glsl b/modules/users/modules/desktop/background/glpaper/shaders/waves.glsl index 526d10d..5693608 100644 --- a/modules/users/modules/desktop/background/glpaper/shaders/waves.glsl +++ b/modules/users/modules/desktop/background/glpaper/shaders/waves.glsl @@ -5,7 +5,7 @@ precision mediump float; uniform float time; uniform vec2 resolution; -#define iTime time * 0.01 + 10.0 +#define iTime time * 0.05 + 50.0 #define iResolution resolution #define fragCoord gl_FragCoord #define fragColor gl_FragColor @@ -105,4 +105,4 @@ void main() vec2 uv = fragCoord.xy/iResolution.x; float shade = pattern(uv); fragColor = vec4(colormap(shade).rgb, shade); -} \ No newline at end of file +} diff --git a/modules/users/modules/desktop/bar/waybar.nix b/modules/users/modules/desktop/bar/waybar.nix index 289eb9d..145ddf9 100644 --- a/modules/users/modules/desktop/bar/waybar.nix +++ b/modules/users/modules/desktop/bar/waybar.nix @@ -20,6 +20,7 @@ in home.packages = with pkgs; [ pulsemixer playerctl + wpa_supplicant_gui # TODO: Move ]; programs.waybar = { @@ -34,6 +35,7 @@ in "mpris" ]; modules-right = [ + "network" "pulseaudio" "battery" "clock" @@ -55,6 +57,13 @@ in ]; disable-click = false; }; + network = { + tooltip = false; + on-click = "wpa_gui"; + format-wifi = "直 {essid}"; # Spacing achieved using "Thin Space" + format-ethernet = "TODO"; + format-disconnected = "睊"; + }; pulseaudio = { tooltip = false; format = "{icon}   {volume}%"; # Spacing achieved using "Thin Space" diff --git a/modules/users/modules/desktop/window-manager/river.nix b/modules/users/modules/desktop/window-manager/river.nix index 8fcea9d..ba50b1b 100644 --- a/modules/users/modules/desktop/window-manager/river.nix +++ b/modules/users/modules/desktop/window-manager/river.nix @@ -22,27 +22,33 @@ in # TODO: Move elsewhere and make keybindings more configurable modules.rofi.enable = true; + # TODO: Move elsewhere + home.packages = with pkgs; [ + brightnessctl + # owm + ]; + # Change desktop to execute river modules.desktop.initScript = '' river ''; # Update background after rebuild - home.activation = { - river = lib.hm.dag.entryBetween [ "reloadSystemd" ] [ "installPackages" ] '' - # Close waybar - PATH="${pkgs.procps}/bin:$PATH" $DRY_RUN_CMD pkill waybar + # home.activation = { + # river = lib.hm.dag.entryBetween [ "reloadSystemd" ] [ "installPackages" ] '' + # # Close waybar + # PATH="${pkgs.procps}/bin:$PATH" $DRY_RUN_CMD pkill waybar - # Kill rivertile - PATH="${pkgs.procps}/bin:$PATH" $DRY_RUN_CMD pkill rivertile + # # Kill rivertile + # PATH="${pkgs.procps}/bin:$PATH" $DRY_RUN_CMD pkill rivertile - # Kill glpaper - PATH="${pkgs.procps}/bin:$PATH" $DRY_RUN_CMD pkill glpaper + # # Kill glpaper + # PATH="${pkgs.procps}/bin:$PATH" $DRY_RUN_CMD pkill glpaper - # Restart river - PATH="${pkgs.river}/bin:${pkgs.systemd}/bin:$PATH" $DRY_RUN_CMD ~/.config/river/init - ''; - }; + # # Restart river + # PATH="${pkgs.river}/bin:${pkgs.systemd}/bin:${pkgs.waybar}/bin:$PATH" $DRY_RUN_CMD ~/.config/river/init + # ''; + # }; # River setup wayland.windowManager.river = { @@ -230,6 +236,7 @@ in "-app-id" = { "'bar'" = "csd"; "'*'" = "ssd"; + "'wpa_gui'" = "float"; }; }; }; diff --git a/modules/users/modules/language/rust.nix b/modules/users/modules/language/rust.nix index 245f5af..c556ddd 100644 --- a/modules/users/modules/language/rust.nix +++ b/modules/users/modules/language/rust.nix @@ -17,18 +17,28 @@ in config = mkIf cfg.enable { # Development packages home.packages = with pkgs; [ + # rustup rustc cargo + gcc + # lldb + gdb rust-analyzer rustfmt ]; # VSCode configuration programs.vscode = { - extensions = with pkgs.vscode-extensions; [ rust-lang.rust-analyzer ]; + extensions = with pkgs.vscode-extensions; [ + rust-lang.rust-analyzer + # ms-vscode.cpp-tools + vadimcn.vscode-lldb + ]; userSettings = { - "[rust]" = { }; + "[rust]" = { + "editor.inlayHints.enabled" = "off"; + }; }; }; diff --git a/modules/users/modules/obsidian/default.nix b/modules/users/modules/obsidian/default.nix index 014cf1c..e7057e3 100644 --- a/modules/users/modules/obsidian/default.nix +++ b/modules/users/modules/obsidian/default.nix @@ -14,5 +14,9 @@ in enable = mkEnableOption "obsidian"; }; - config = mkIf cfg.enable { home.packages = with pkgs; [ obsidian ]; }; + config = mkIf cfg.enable { + modules.unfree.allowedPackages = [ "obsidian" ]; + + home.packages = with pkgs; [ obsidian ]; + }; } diff --git a/modules/users/modules/rofi/rofi-rbw.nix b/modules/users/modules/rofi/rofi-rbw.nix index 1859ed6..451486d 100644 --- a/modules/users/modules/rofi/rofi-rbw.nix +++ b/modules/users/modules/rofi/rofi-rbw.nix @@ -22,7 +22,6 @@ in enable = true; settings = { base_url = "https://keys.bulthuis.dev"; - identity_url = "https://keys.bulthuis.dev"; email = "jan@bulthuis.dev"; pinentry = pkgs.pinentry; }; diff --git a/modules/users/modules/vscode/default.nix b/modules/users/modules/vscode/default.nix index 717cfd3..4042892 100644 --- a/modules/users/modules/vscode/default.nix +++ b/modules/users/modules/vscode/default.nix @@ -32,7 +32,10 @@ in enable = true; mutableExtensionsDir = false; - extensions = with pkgs.vscode-extensions; [ eamodio.gitlens ]; + extensions = with pkgs.vscode-extensions; [ + eamodio.gitlens + ms-vscode.hexeditor + ]; userSettings = { # Font setup diff --git a/pkgs/default.nix b/pkgs/default.nix index e66b7f9..79adbaf 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -6,20 +6,6 @@ }: with lib; -# let -# mkPackage = path: (mkOption { -# type = types.package; -# default = (pkgs.callPackage path) {}; -# description = (mkPackage path).default.name; -# }); -# in { -# options.pkgs = { -# # Add all custom packages -# wqy-zenhei = mkPackage ./fonts/wqy-zenhei.nix; -# wqy-microhei = mkPackage ./fonts/wqy-microhei.nix; -# wqy-bitmapsong = mkPackage ./fonts/wqy-bitmapsong.nix; -# }; -# } { nixpkgs.config.packageOverrides = pkgs: rec { wqy-zenhei = pkgs.callPackage ./fonts/wqy-zenhei.nix { }; diff --git a/pkgs/river/owm.nix b/pkgs/river/owm.nix new file mode 100644 index 0000000..0503578 --- /dev/null +++ b/pkgs/river/owm.nix @@ -0,0 +1,20 @@ +{ + lib, + config, + pkgs, + ... +}: + +pkgs.rustPlatform.buildRustPackage rec { + pname = "owm"; + version = "0.1.0"; + + src = pkgs.fetchFromGitHub { + owner = "justinlovinger"; + repo = pname; + rev = "master"; + sha256 = "sha256-l9usg0XGtghCX8elvjExYJgMuMGeujOoS2n1hCQkN78="; + }; + + cargoSha256 = ""; +} diff --git a/users/jan.nix b/users/jan.nix index 0475b22..e847732 100644 --- a/users/jan.nix +++ b/users/jan.nix @@ -34,6 +34,7 @@ }; neovim.enable = true; rofi-rbw.enable = true; + obsidian.enable = true; # Programming languages nix.enable = true; @@ -58,10 +59,10 @@ # Color scheme themes.catppuccin = { - enable = false; + enable = true; flavor = "latte"; }; - themes.sakura.enable = true; + themes.sakura.enable = false; }; # TODO: Remove everything below, it is here out of convenience and should be elsewhere