From 54dbf8f9292ad6c788de6a9e8165436747c604b2 Mon Sep 17 00:00:00 2001 From: LordGrimmauld Date: Tue, 16 Apr 2024 11:45:34 +0200 Subject: [PATCH] Refactor, remove plasma - pulling clion from stable - sway autostart now supports packages and pulls default exe automatically - sway reload now clears rmenu cache - no longer run plasma - apply qt themeing outside plasma --- common/sway.nix | 16 ++++++------- configuration.nix | 15 +++++++++++-- flake.lock | 55 +++++++++++++++++++++++++++++---------------- flake.nix | 9 +++++--- load_common.nix | 2 +- modules/users.nix | 4 ++-- modules/xserver.nix | 4 +++- sway/sway-conf.nix | 6 +++-- 8 files changed, 73 insertions(+), 38 deletions(-) diff --git a/common/sway.nix b/common/sway.nix index 9bdada0..b7fa065 100644 --- a/common/sway.nix +++ b/common/sway.nix @@ -17,24 +17,24 @@ in } ''; - build_conf = sway_conf: + build_conf = with lib; sway_conf: let - build_definition_lines = lib.mapAttrsToList (name: value: "set \$${name} ${value}"); - build_keybind_lines = lib.mapAttrsToList (key: value: "bindsym ${key} ${value}"); - build_exec_lines = map (item: "exec " + item); - build_mode_lines = lib.mapAttrsToList (name: value: '' + build_definition_lines = mapAttrsToList (name: value: "set \$${name} ${value}"); + build_keybind_lines = mapAttrsToList (key: value: "bindsym ${key} ${value}"); + build_exec_lines = map (item: "exec " + (if isString item then item else (getExe item))); + build_mode_lines = mapAttrsToList (name: value: '' mode "${name}" { - ${lib.strings.concatLines (map (item: " " + item ) (build_conf value))}}''); + ${strings.concatLines (map (item: " " + item ) (build_conf value))}}''); in ([ ] ++ (build_definition_lines sway_conf.definitions) ++ (build_keybind_lines sway_conf.keybinds) ++ (build_exec_lines sway_conf.autolaunch) ++ (build_mode_lines sway_conf.modes) - ++ lib.optional (sway_conf.extraConfig != "") sway_conf.extraConfig + ++ optional (sway_conf.extraConfig != "") sway_conf.extraConfig ); - text = lib.strings.concatLines ( + text = lib.concatLines ( (build_conf cfg.sway.config) ++ lib.optional cfg.sway.bar.enable bar_config ++ (lib.mapAttrsToList diff --git a/configuration.nix b/configuration.nix index e93b5bd..03406f4 100644 --- a/configuration.nix +++ b/configuration.nix @@ -67,10 +67,21 @@ qt = { enable = true; - style = "breeze"; - platformTheme = "kde"; + style = "kvantum"; + platformTheme = "qt5ct"; }; + environment.systemPackages = with pkgs; [ + libsForQt5.qtstyleplugin-kvantum + catppuccin-kvantum + catppuccin-sddm-corners + libsForQt5.qtgraphicaleffects + catppuccin-kvantum + qt6ct + ]; + + # environment.etc."kvantum".source = "${pkgs.catppuccin-kvantum}/share/Kvantum"; + environment.sessionVariables = { NIXPKGS_ALLOW_UNFREE = "1"; MOZ_ENABLE_WAYLAND = "1"; diff --git a/flake.lock b/flake.lock index a393c4a..2411437 100644 --- a/flake.lock +++ b/flake.lock @@ -78,11 +78,11 @@ "yafas": "yafas" }, "locked": { - "lastModified": 1713020398, - "narHash": "sha256-fZ9snNCxKj5sJ/hymCW8aM8Lzlbzo/VYYfl/oNLh/jc=", + "lastModified": 1713212932, + "narHash": "sha256-FnKDhx5w9KRUJR0ZEI4kpL+KtAv2utAs6+ovDz1SmHo=", "owner": "chaotic-cx", "repo": "nyx", - "rev": "f0e16565b38a473664977625680f08e7cc9dec50", + "rev": "a2f034e707ad9e2be09454f171acd805015ae245", "type": "github" }, "original": { @@ -138,11 +138,11 @@ ] }, "locked": { - "lastModified": 1712765734, - "narHash": "sha256-HakehmZVdhbXHNaTzoSwIHdvy1A3A7XXEIUHV2cC7d8=", + "lastModified": 1713180885, + "narHash": "sha256-G9yAD8l8XJr3AyTADtM6j4T+tEMwn9z3ojy1lFOki5U=", "owner": "girlbossceo", "repo": "conduwuit", - "rev": "7d92cad55f58ef55d5c95ecf3753e0fa75ab11e1", + "rev": "6d47c20efa5b15a53b98d73ea72a759adaea00d1", "type": "github" }, "original": { @@ -357,11 +357,11 @@ "rust-overlay": "rust-overlay" }, "locked": { - "lastModified": 1712983637, - "narHash": "sha256-PSoOKfevRvoVZdMqijl9VcaB5OqgCoAgQ8UpsEAdEDQ=", + "lastModified": 1713128310, + "narHash": "sha256-a5u73dLvcgKlI5OOlF6iKhLgliLiF3EsBxIBhdJExSo=", "owner": "martinvonz", "repo": "jj", - "rev": "82c85ba7542b0a5c938f53d71f9a481fc37eda1d", + "rev": "0ef25bb4b6a95d5437963302f22f2e0428f6862c", "type": "github" }, "original": { @@ -394,11 +394,11 @@ ] }, "locked": { - "lastModified": 1712992043, - "narHash": "sha256-xUbqDxGiDab1et16JupBHpliGNpRSUcKfm++7t0UgBo=", + "lastModified": 1713090581, + "narHash": "sha256-1TZonJRiYAJSlwTIXahd+7Hmf/F0uDx70dd6/fNKrVM=", "owner": "YaLTeR", "repo": "niri", - "rev": "71be19b234d58f4ec447e921633506beb81a52c0", + "rev": "568fbe26fe58be7de34e46ddb980a26d12e85ac6", "type": "github" }, "original": { @@ -430,11 +430,11 @@ ] }, "locked": { - "lastModified": 1712969975, - "narHash": "sha256-QckL3hBXRRwapLNbPdjy7+5WQNl2n2o7onmQRpyHwYs=", + "lastModified": 1713173715, + "narHash": "sha256-l2pXDP1VMx/Jy4/G09Gh6xKSJ+vAXnUKlBtFRN6NEZs=", "owner": "fufexan", "repo": "nix-gaming", - "rev": "52f21f01ecbcc48d25c94a8a1e5c98cebf519a78", + "rev": "32843d6cbb0dc010e077930b3b34ff7fd318be41", "type": "github" }, "original": { @@ -468,11 +468,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1712791164, - "narHash": "sha256-3sbWO1mbpWsLepZGbWaMovSO7ndZeFqDSdX0hZ9nVyw=", + "lastModified": 1712963716, + "narHash": "sha256-WKm9CvgCldeIVvRz87iOMi8CFVB1apJlkUT4GGvA0iM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1042fd8b148a9105f3c0aca3a6177fd1d9360ba5", + "rev": "cfd6b5fc90b15709b780a5a1619695a88505a176", "type": "github" }, "original": { @@ -516,12 +516,29 @@ "type": "github" } }, + "nixpkgs-stable_2": { + "locked": { + "lastModified": 1713145326, + "narHash": "sha256-m7+IWM6mkWOg22EC5kRUFCycXsXLSU7hWmHdmBfmC3s=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "53a2c32bc66f5ae41a28d7a9a49d321172af621e", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-23.11", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "agenix": "agenix", "chaotic": "chaotic", "nix-gaming": "nix-gaming", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs", + "nixpkgs-stable": "nixpkgs-stable_2" } }, "rust-analyzer-src": { diff --git a/flake.nix b/flake.nix index 4655234..a53de31 100644 --- a/flake.nix +++ b/flake.nix @@ -5,6 +5,9 @@ nixpkgs = { url = "github:NixOS/nixpkgs/nixos-unstable"; }; + nixpkgs-stable = { + url = "github:NixOS/nixpkgs/nixos-23.11"; + }; chaotic = { url = "github:chaotic-cx/nyx/nyxpkgs-unstable"; inputs.nixpkgs.follows = "nixpkgs"; @@ -19,15 +22,16 @@ }; }; - outputs = inputs @ { self, nix-gaming, agenix, nixpkgs, chaotic, ... }: + outputs = inputs @ { self, nix-gaming, agenix, nixpkgs, nixpkgs-stable, chaotic, ... }: let system = "x86_64-linux"; + stable = import nixpkgs-stable { inherit system; config.allowUnfree = true; }; in { nixosConfigurations = { grimmauld-nixos = nixpkgs.lib.nixosSystem { inherit system; - specialArgs = { inherit inputs system; }; + specialArgs = { inherit inputs system stable; }; modules = [ agenix.nixosModules.default chaotic.nixosModules.default @@ -37,7 +41,6 @@ ./configuration.nix ./modules/users.nix - # ./modules/tlp.nix ./modules/spotify-tui.nix ./modules/xserver.nix ./modules/system-packages.nix diff --git a/load_common.nix b/load_common.nix index 235e03b..2ec12b6 100644 --- a/load_common.nix +++ b/load_common.nix @@ -54,7 +54,7 @@ let }; autolaunch = mkOption { - type = types.listOf types.str; + type = types.listOf (types.either types.str types.package); default = [ ]; description = "set of commands to be run at sway startup"; }; diff --git a/modules/users.nix b/modules/users.nix index 3ae48f9..554a281 100644 --- a/modules/users.nix +++ b/modules/users.nix @@ -1,4 +1,4 @@ -{ lib, config, pkgs, ... }: { +{ lib, config, pkgs, stable, ... }: { users.users.grimmauld = { isNormalUser = true; shell = pkgs.xonsh; @@ -28,7 +28,7 @@ freecad openscad vlc - jetbrains.clion + stable.jetbrains.clion jetbrains.idea-community jetbrains.pycharm-community blender diff --git a/modules/xserver.nix b/modules/xserver.nix index 6b72fb1..01c4cea 100644 --- a/modules/xserver.nix +++ b/modules/xserver.nix @@ -3,12 +3,14 @@ # lightdm.enable = true; sddm = { enable = true; + theme = "catppuccin-sddm-corners"; wayland.enable = true; + wayland.compositor = "weston"; }; defaultSession = "sway"; }; services.desktopManager = { - plasma6.enable = true; + # plasma6.enable = true; }; } diff --git a/sway/sway-conf.nix b/sway/sway-conf.nix index bbb51be..dc1ea20 100644 --- a/sway/sway-conf.nix +++ b/sway/sway-conf.nix @@ -8,6 +8,7 @@ wl-clipboard swaymux dunst + qt6ct ]; grimmShared.sway = { @@ -138,12 +139,13 @@ XF86MonBrightnessUp = "exec ${getExe pkgs.brightnessctl} s 10+%"; XF86MonBrightnessDown = "exec ${getExe pkgs.brightnessctl} s 10-%"; }; - autolaunch = [ + autolaunch = with pkgs; [ # fixme: absolute paths "blueman-applet" "lxqt-policykit-agent" "otd-daemon" - (getExe pkgs.dunst) + dunst + "rm -r $HOME/.cache/rmenu" # invalidate rmenu cache on sway restart "systemctl --user import-environment XDG_SESSION_TYPE XDG_CURRENT_DESKTOP" ]; extraConfig = ''