commit 4774016b33a4ce8a16e36edf2894b044ad36dd72
parent 04da9a400f225341251845c82365b9b695bea006
Author: Leah (ctucx) <git@ctu.cx>
Date: Sat, 17 Jun 2023 10:40:27 +0200
parent 04da9a400f225341251845c82365b9b695bea006
Author: Leah (ctucx) <git@ctu.cx>
Date: Sat, 17 Jun 2023 10:40:27 +0200
configurations/linux: some refactoring
33 files changed, 137 insertions(+), 109 deletions(-)
R
|
0
A
|
75
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
R
|
0
A
|
47
+++++++++++++++++++++++++++++++++++++++++++++++
R
|
0
diff --git a/configurations/linux/mobile-device.nix b/configurations/linux/desktop/mobile-device.nix
diff --git a/configurations/linux/desktop/programs/firefox.nix b/configurations/linux/desktop/programs/firefox.nix @@ -0,0 +1,75 @@ +{ pkgs, ... }: + +let + ff2mpv = pkgs.stdenv.mkDerivation { + name = "ff2mpv"; + src = pkgs.fetchFromGitHub{ + owner = "woodruffw"; + repo = "ff2mpv"; + rev = "refs/tags/v3.9.1"; + sha256 = "0g18wf6dlnqhypmlpzn35jk3ya1vycxd6vv4nngvcx2s30fn6rcg"; + }; + + buildInputs = with pkgs; [ + python3 + ]; + + installPhase = '' + mkdir -p $out/bin; + mkdir -p $out/lib/mozilla/native-messaging-hosts; + + cp $src/ff2mpv.py $out/bin/ff2mpv; + + chmod +x $out/bin/ff2mpv; + substitute $src/ff2mpv.json $out/lib/mozilla/native-messaging-hosts/ff2mpv.json \ + --replace "/home/william/scripts/ff2mpv" "$out/bin/ff2mpv" \ + ''; + }; + +in { + + home-manager.users.leah = { + home = { + file = { + ".mozilla/native-messaging-hosts/ff2mpv.json".source = "${ff2mpv}/lib/mozilla/native-messaging-hosts/ff2mpv.json"; + }; + sessionVariables = { + BROWSER = "firefox"; + }; + }; + + programs = { + firefox = { + enable = true; + package = pkgs.firefox; + }; + }; + + wayland.windowManager.sway.extraConfig = '' + exec firefox; + ''; + + xdg = { + enable = true; + mime.enable = true; + + #force hm to override existing mimeapps.list file + configFile."mimeapps.list".force = true; + + mimeApps = { + enable = true; + defaultApplications = { + "x-scheme-handler/http" = "firefox.desktop"; + "x-scheme-handler/https" = "firefox.desktop"; + "x-scheme-handler/chrome" = "firefox.desktop"; + + "image/svg+xml" = "firefox.desktop"; + + "text/html" = "firefox.desktop"; + "text/xml" = "firefox.desktop"; + }; + }; + }; + + }; +}
diff --git a/configurations/linux/programs/mako.nix b/configurations/linux/desktop/programs/mako.nix
diff --git a/configurations/linux/programs/sway.nix b/configurations/linux/desktop/programs/sway.nix
diff --git a/configurations/linux/desktop/programs/thunderbird.nix b/configurations/linux/desktop/programs/thunderbird.nix @@ -0,0 +1,47 @@ +{ pkgs, ... }: + +{ + home-manager.users.leah = { + home.packages = with pkgs; [ + thunderbird + ]; + + systemd.user.services.thunderbird = { + Unit = { + After = [ "graphical-session-pre.target" ]; + PartOf = [ "graphical-session.target" ]; + }; + + Service = { + Environment = "PATH=/run/wrappers/bin:/home/leah/.nix-profile/bin:/etc/profiles/per-user/leah/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin"; + ExecStart = "${pkgs.thunderbird}/bin/thunderbird"; + Restart = "always"; + RestartSec = 5; + }; + + Install = { + WantedBy = [ "graphical-session.target" ]; + }; + }; + + wayland.windowManager.sway.extraConfig = '' + exec_always 'systemctl --user restart thunderbird' + ''; + + xdg = { + enable = true; + mime.enable = true; + + #force hm to override existing mimeapps.list file + configFile."mimeapps.list".force = true; + + mimeApps = { + enable = true; + defaultApplications = { + "x-scheme-handler/mailto" = "thunderbird.desktop"; + }; + }; + }; + + }; +}
diff --git a/configurations/linux/desktop/xdg-portal.nix b/configurations/linux/desktop/xdg-portal.nix @@ -0,0 +1,14 @@ +{ config, lib, pkgs, home-manager, ... }: + +{ + + xdg = { + portal = { + enable = true; + extraPortals = with pkgs; [ + xdg-desktop-portal-wlr + ]; + }; + }; + +}
diff --git a/configurations/linux/programs/firefox.nix b/configurations/linux/programs/firefox.nix @@ -1,51 +0,0 @@ -{ pkgs, ... }: - -let - ff2mpv = pkgs.stdenv.mkDerivation { - name = "ff2mpv"; - src = pkgs.fetchFromGitHub{ - owner = "woodruffw"; - repo = "ff2mpv"; - rev = "refs/tags/v3.9.1"; - sha256 = "0g18wf6dlnqhypmlpzn35jk3ya1vycxd6vv4nngvcx2s30fn6rcg"; - }; - - buildInputs = with pkgs; [ - python3 - ]; - - installPhase = '' - mkdir -p $out/bin; - mkdir -p $out/lib/mozilla/native-messaging-hosts; - - cp $src/ff2mpv.py $out/bin/ff2mpv; - - chmod +x $out/bin/ff2mpv; - substitute $src/ff2mpv.json $out/lib/mozilla/native-messaging-hosts/ff2mpv.json \ - --replace "/home/william/scripts/ff2mpv" "$out/bin/ff2mpv" \ - ''; - }; - -in { - home-manager.users.leah = { - home = { - file = { - ".mozilla/native-messaging-hosts/ff2mpv.json".source = "${ff2mpv}/lib/mozilla/native-messaging-hosts/ff2mpv.json"; - }; - sessionVariables = { - BROWSER = "firefox"; - }; - }; - - programs = { - firefox = { - enable = true; - package = pkgs.firefox; - }; - }; - - wayland.windowManager.sway.extraConfig = '' - exec firefox; - ''; - }; -}
diff --git a/configurations/linux/programs/thunderbird.nix b/configurations/linux/programs/thunderbird.nix @@ -1,31 +0,0 @@ -{ pkgs, ... }: - -{ - home-manager.users.leah = { - home.packages = with pkgs; [ - thunderbird - ]; - - systemd.user.services.thunderbird = { - Unit = { - After = [ "graphical-session-pre.target" ]; - PartOf = [ "graphical-session.target" ]; - }; - - Service = { - Environment = "PATH=/run/wrappers/bin:/home/leah/.nix-profile/bin:/etc/profiles/per-user/leah/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin"; - ExecStart = "${pkgs.thunderbird}/bin/thunderbird"; - Restart = "always"; - RestartSec = 5; - }; - - Install = { - WantedBy = [ "graphical-session.target" ]; - }; - }; - - wayland.windowManager.sway.extraConfig = '' - exec_always 'systemctl --user restart thunderbird' - ''; - }; -}
diff --git a/configurations/linux/xdg.nix b/configurations/linux/xdg.nix @@ -1,39 +1,12 @@ { config, lib, pkgs, home-manager, ... }: { - xdg = { - portal = { - enable = true; - extraPortals = with pkgs; [ - xdg-desktop-portal-wlr - ]; - }; - }; home-manager.users.leah = { xdg = { enable = true; mime.enable = true; - #force hm to override existing mimeapps.list file - configFile."mimeapps.list".force = true; - - mimeApps = { - enable = true; - defaultApplications = { - "x-scheme-handler/http" = "firefox.desktop"; - "x-scheme-handler/https" = "firefox.desktop"; - "x-scheme-handler/chrome" = "firefox.desktop"; - - "x-scheme-handler/mailto" = "thunderbird.desktop"; - - "image/svg+xml" = "firefox.desktop"; - - "text/html" = "firefox.desktop"; - "text/xml" = "firefox.desktop"; - }; - }; - userDirs = { enable = true; desktop = "\$HOME/Desktop"; @@ -47,4 +20,5 @@ }; }; }; + }