diff --git a/flake.lock b/flake.lock index 5e893a8..7a5829e 100644 --- a/flake.lock +++ b/flake.lock @@ -159,6 +159,22 @@ "type": "github" } }, + "nix-flatpak": { + "locked": { + "lastModified": 1699822045, + "narHash": "sha256-ZKKbXcf7UXirQokVYNF0gN5AulWPDPsXXce6KolGr+g=", + "owner": "gmodena", + "repo": "nix-flatpak", + "rev": "bb4a08e975c5a64a909cc42de31cb02408c9bda8", + "type": "github" + }, + "original": { + "owner": "gmodena", + "ref": "main", + "repo": "nix-flatpak", + "type": "github" + } + }, "nix-github-actions": { "inputs": { "nixpkgs": [ @@ -312,6 +328,7 @@ "home-manager": "home-manager_2", "home-manager-unstable": "home-manager-unstable", "jovian": "jovian", + "nix-flatpak": "nix-flatpak", "nix-impermanence": "nix-impermanence", "nix-index-db": "nix-index-db", "nix-index-db-unstable": "nix-index-db-unstable", diff --git a/flake.nix b/flake.nix index 0db6b75..9119495 100755 --- a/flake.nix +++ b/flake.nix @@ -60,7 +60,9 @@ vscode-extensions = { url = "github:nix-community/nix-vscode-extensions"; inputs.nixpkgs.follows = "nixpkgs-unstable"; + }; + nix-flatpak.url = github:gmodena/nix-flatpak/main; }; outputs = { ... } @inputs: with inputs; { diff --git a/roles/desktop/services/flatpak.nix b/roles/desktop/services/flatpak.nix index daea0f7..8d92e91 100644 --- a/roles/desktop/services/flatpak.nix +++ b/roles/desktop/services/flatpak.nix @@ -1,20 +1,12 @@ -{ config, pkgs, ... }: +{ config, pkgs, flakeSelf, ... }: { services.flatpak.enable = true; - /* - Create systemd service that adds flathub after getting network - This adds it automatically, which avoids the whack ass way I was - doing that before - */ - systemd.services.flathub-add = { - description = "Add flathub repo to system flatpak install"; - script = "${pkgs.flatpak}/bin/flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo"; - serviceConfig.Type = "oneshot"; - wantedBy = [ "network-online.target" ]; - # Run after networking is working - after = [ "NetworkManager-wait-online.service" ]; - restartIfChanged = false; + home-manager = { + sharedModules = [{ imports = [ flakeSelf.inputs.nix-flatpak.homeManagerModules.nix-flatpak ]; }]; + users.toast = { + services.flatpak.packages = [ "tv.plex.PlexDesktop" ]; + }; }; } diff --git a/roles/kde/plasma.nix b/roles/kde/plasma.nix index 329e2fa..cbcaa8c 100644 --- a/roles/kde/plasma.nix +++ b/roles/kde/plasma.nix @@ -85,36 +85,47 @@ in environment.systemPackages = [ breezeTint lookAndFeel plasmaDefaults ]; # Plasma configs should be on all users - home-manager.sharedModules = [{ - imports = [ flakeSelf.inputs.plasma-manager.homeManagerModules.plasma-manager ]; - gtk = { - enable = true; - cursorTheme = { package = pkgs.breeze-qt5; name = "breeze_cursors"; }; - iconTheme = { package = pkgs.breeze-icons; name = "breeze-dark"; }; - theme = { package = pkgs.breeze-gtk; name = "Breeze"; }; - # Gtk2 doesn't have a dark mode, so I just tell gtk 3 and 4 to use the dark variant - gtk3.extraConfig.gtk-application-prefer-dark-theme = true; - gtk4.extraConfig.gtk-application-prefer-dark-theme = true; - }; - programs.plasma = { - enable = true; - workspace.clickItemTo = "select"; - shortcuts = { - "kwin" = { - "Switch One Desktop to the Left" = [ "Meta+Ctrl+Left" ]; - "Switch One Desktop to the Right" = [ "Meta+Ctrl+Right" ]; - }; + home-manager.sharedModules = [ + ( + { config, ... }: + let gtk2rc = "${config.xdg.configHome}/gtk-2.0/gtkrc"; in + { + gtk.gtk2.configLocation = gtk2rc; + # Kde has an annoying habit of overwriting the gtk2 config file + home.file."${gtk2rc}".force = true; + } + ) + { + imports = [ flakeSelf.inputs.plasma-manager.homeManagerModules.plasma-manager ]; + gtk = { + enable = true; + cursorTheme = { package = pkgs.breeze-qt5; name = "breeze_cursors"; }; + iconTheme = { package = pkgs.breeze-icons; name = "breeze-dark"; }; + theme = { package = pkgs.breeze-gtk; name = "Breeze"; }; + # Gtk2 doesn't have a dark mode, so I just tell gtk 3 and 4 to use the dark variant + gtk3.extraConfig.gtk-application-prefer-dark-theme = true; + gtk4.extraConfig.gtk-application-prefer-dark-theme = true; }; - configFile = { - "kwinrc" = { - "Desktops" = { - "Number" = 2; - "Rows" = 1; + programs.plasma = { + enable = true; + workspace.clickItemTo = "select"; + shortcuts = { + "kwin" = { + "Switch One Desktop to the Left" = [ "Meta+Ctrl+Left" ]; + "Switch One Desktop to the Right" = [ "Meta+Ctrl+Right" ]; }; - "TabBox"."LayoutName" = "thumbnail_grid"; }; - "plasmanotifyrc"."Notifications"."NormalAlwaysOnTop" = true; + configFile = { + "kwinrc" = { + "Desktops" = { + "Number" = 2; + "Rows" = 1; + }; + "TabBox"."LayoutName" = "thumbnail_grid"; + }; + "plasmanotifyrc"."Notifications"."NormalAlwaysOnTop" = true; + }; }; - }; - }]; + } + ]; }