ctucx.git: nixfiles

ctucx' nixfiles

commit 4774016b33a4ce8a16e36edf2894b044ad36dd72
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
configurations/linux/bluetooth.nix -> configurations/linux/desktop/bluetooth.nix
|
0
R
configurations/linux/fonts.nix -> configurations/linux/desktop/fonts.nix
|
0
R
configurations/linux/gtk.nix -> configurations/linux/desktop/gtk.nix
|
0
R
configurations/linux/mobile-device.nix -> configurations/linux/desktop/mobile-device.nix
|
0
R
configurations/linux/programs/alacritty.nix -> configurations/linux/desktop/programs/alacritty.nix
|
0
R
configurations/linux/programs/ddcutil.nix -> configurations/linux/desktop/programs/ddcutil.nix
|
0
A
configurations/linux/desktop/programs/firefox.nix
|
75
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
R
configurations/linux/programs/gammastep.nix -> configurations/linux/desktop/programs/gammastep.nix
|
0
R
configurations/linux/programs/gimp/default.nix -> configurations/linux/desktop/programs/gimp/default.nix
|
0
R
configurations/linux/programs/gimp/remove-cc-reference.patch -> configurations/linux/desktop/programs/gimp/remove-cc-reference.patch
|
0
R
configurations/linux/programs/imv.nix -> configurations/linux/desktop/programs/imv.nix
|
0
R
configurations/linux/programs/libreoffice.nix -> configurations/linux/desktop/programs/libreoffice.nix
|
0
R
configurations/linux/programs/mako.nix -> configurations/linux/desktop/programs/mako.nix
|
0
R
configurations/linux/programs/mpv.nix -> configurations/linux/desktop/programs/mpv.nix
|
0
R
configurations/linux/programs/physlock.nix -> configurations/linux/desktop/programs/physlock.nix
|
0
R
configurations/linux/programs/sublime-text3.nix -> configurations/linux/desktop/programs/sublime-text3.nix
|
0
R
configurations/linux/programs/sway.nix -> configurations/linux/desktop/programs/sway.nix
|
0
R
configurations/linux/programs/swaylock.nix -> configurations/linux/desktop/programs/swaylock.nix
|
0
R
configurations/linux/programs/systemd-lock-handler.nix -> configurations/linux/desktop/programs/systemd-lock-handler.nix
|
0
R
configurations/linux/programs/thunar.nix -> configurations/linux/desktop/programs/thunar.nix
|
0
A
configurations/linux/desktop/programs/thunderbird.nix
|
47
+++++++++++++++++++++++++++++++++++++++++++++++
R
configurations/linux/programs/utilities.nix -> configurations/linux/desktop/programs/utilities.nix
|
0
R
configurations/linux/programs/waybar/default.nix -> configurations/linux/desktop/programs/waybar/default.nix
|
0
R
configurations/linux/programs/waybar/style.css -> configurations/linux/desktop/programs/waybar/style.css
|
0
R
configurations/linux/programs/wofi/config -> configurations/linux/desktop/programs/wofi/config
|
0
R
configurations/linux/programs/wofi/style.css -> configurations/linux/desktop/programs/wofi/style.css
|
0
R
configurations/linux/qt.nix -> configurations/linux/desktop/qt.nix
|
0
R
configurations/linux/sdr.nix -> configurations/linux/desktop/sdr.nix
|
0
R
configurations/linux/desktop-sway.nix -> configurations/linux/desktop/sway.nix
|
0
A
configurations/linux/desktop/xdg-portal.nix
|
14
++++++++++++++
D
configurations/linux/programs/firefox.nix
|
51
---------------------------------------------------
D
configurations/linux/programs/thunderbird.nix
|
31
-------------------------------
M
configurations/linux/xdg.nix
|
28
+---------------------------
diff --git a/configurations/linux/bluetooth.nix b/configurations/linux/desktop/bluetooth.nix
diff --git a/configurations/linux/fonts.nix b/configurations/linux/desktop/fonts.nix
diff --git a/configurations/linux/gtk.nix b/configurations/linux/desktop/gtk.nix
diff --git a/configurations/linux/mobile-device.nix b/configurations/linux/desktop/mobile-device.nix
diff --git a/configurations/linux/programs/alacritty.nix b/configurations/linux/desktop/programs/alacritty.nix
diff --git a/configurations/linux/programs/ddcutil.nix b/configurations/linux/desktop/programs/ddcutil.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/gammastep.nix b/configurations/linux/desktop/programs/gammastep.nix
diff --git a/configurations/linux/programs/gimp/default.nix b/configurations/linux/desktop/programs/gimp/default.nix
diff --git a/configurations/linux/programs/gimp/remove-cc-reference.patch b/configurations/linux/desktop/programs/gimp/remove-cc-reference.patch
diff --git a/configurations/linux/programs/imv.nix b/configurations/linux/desktop/programs/imv.nix
diff --git a/configurations/linux/programs/libreoffice.nix b/configurations/linux/desktop/programs/libreoffice.nix
diff --git a/configurations/linux/programs/mako.nix b/configurations/linux/desktop/programs/mako.nix
diff --git a/configurations/linux/programs/mpv.nix b/configurations/linux/desktop/programs/mpv.nix
diff --git a/configurations/linux/programs/physlock.nix b/configurations/linux/desktop/programs/physlock.nix
diff --git a/configurations/linux/programs/sublime-text3.nix b/configurations/linux/desktop/programs/sublime-text3.nix
diff --git a/configurations/linux/programs/sway.nix b/configurations/linux/desktop/programs/sway.nix
diff --git a/configurations/linux/programs/swaylock.nix b/configurations/linux/desktop/programs/swaylock.nix
diff --git a/configurations/linux/programs/systemd-lock-handler.nix b/configurations/linux/desktop/programs/systemd-lock-handler.nix
diff --git a/configurations/linux/programs/thunar.nix b/configurations/linux/desktop/programs/thunar.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/programs/utilities.nix b/configurations/linux/desktop/programs/utilities.nix
diff --git a/configurations/linux/programs/waybar/default.nix b/configurations/linux/desktop/programs/waybar/default.nix
diff --git a/configurations/linux/programs/waybar/style.css b/configurations/linux/desktop/programs/waybar/style.css
diff --git a/configurations/linux/programs/wofi/config b/configurations/linux/desktop/programs/wofi/config
diff --git a/configurations/linux/programs/wofi/style.css b/configurations/linux/desktop/programs/wofi/style.css
diff --git a/configurations/linux/qt.nix b/configurations/linux/desktop/qt.nix
diff --git a/configurations/linux/sdr.nix b/configurations/linux/desktop/sdr.nix
diff --git a/configurations/linux/desktop-sway.nix b/configurations/linux/desktop/sway.nix
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 @@
       };
     };
   };
+
 }