commit d4e2bffa385223d5567155b7df241dd4b39516e8
parent be939f08ed5f720835f2640d34e8a552c2450230
Author: Leah (ctucx) <git@ctu.cx>
Date: Tue, 26 Mar 2024 10:21:25 +0100
parent be939f08ed5f720835f2640d34e8a552c2450230
Author: Leah (ctucx) <git@ctu.cx>
Date: Tue, 26 Mar 2024 10:21:25 +0100
configurations/linux: refactor almost anything
68 files changed, 1630 insertions(+), 1600 deletions(-)
A
|
66
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
D
|
59
-----------------------------------------------------------
D
|
61
-------------------------------------------------------------
D
|
75
---------------------------------------------------------------------------
D
|
104
-------------------------------------------------------------------------------
D
|
72
------------------------------------------------------------------------
D
|
63
---------------------------------------------------------------
D
|
241
-------------------------------------------------------------------------------
D
|
55
-------------------------------------------------------
D
|
48
------------------------------------------------
D
|
47
-----------------------------------------------
D
|
141
-------------------------------------------------------------------------------
D
|
63
---------------------------------------------------------------
D
|
70
----------------------------------------------------------------------
D
|
86
-------------------------------------------------------------------------------
A
|
74
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
85
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
66
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
54
++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
59
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
253
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
60
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
R
configurations/linux/desktop/programs/wofi/style.css -> configurations/linux/programs/wofi/style.css
|
0
A
|
69
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
213
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
A
|
77
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
diff --git a/configurations/linux/bluetooth.nix b/configurations/linux/bluetooth.nix @@ -0,0 +1,66 @@ +{ config, pkgs, lib, ... }: + +let + cfg = config.ctucxConfig.configure.bluetooth; + +in { + + options = { + ctucxConfig.configure.bluetooth = lib.mkEnableOption "bluetooth"; + }; + + config = lib.mkIf cfg { + hardware.bluetooth = { + enable = true; + powerOnBoot = false; + }; + + services.blueman = { + enable = true; + }; + + home-manager.users.leah = { + home.packages = [ pkgs.blueman ]; + + xdg = { + desktopEntries = { + blueman-adapters = { + name = "Bluetooth Adapters"; + settings = { + NoDisplay = "true"; + }; + }; + }; + }; + + wayland.windowManager.sway.config.startup = [ + { always = true; command = "systemctl --user restart blueman-applet"; } + ]; + + systemd.user.services = { + blueman-applet = { + Unit = { + Description = "Blueman applet"; + Requires = [ "waybar.service" ]; + After = [ "graphical-session-pre.target" "tray.target" ]; + PartOf = [ "graphical-session.target" ]; + }; + + Service.ExecStart = "${pkgs.blueman}/bin/blueman-applet"; + Install.WantedBy = [ "graphical-session.target" ]; + }; + + mpris-proxy = { + Unit = { + Description = "Mpris proxy"; + After = [ "network.target" "sound.target" ]; + }; + + Service.ExecStart = "${pkgs.bluez}/bin/mpris-proxy"; + Install.WantedBy = [ "default.target" ]; + }; + }; + }; + }; + +}
diff --git a/configurations/linux/default.nix b/configurations/linux/default.nix @@ -4,6 +4,11 @@ imports = [ ./services + ./programs + + ./bluetooth.nix + ./fonts.nix + ./mobile-device.nix ]; deployment = { @@ -38,7 +43,7 @@ services = { timesyncd.enable = true; vnstat.enable = true; - vnstati.enable = true; + vnstati.enable = (lib.mkDefault (if (config.networking.primaryIP != "") || (config.networking.primaryIP4 != "") then true else false)); fstrim.enable = true; journald.extraConfig = "SystemMaxUse=1G";
diff --git a/configurations/linux/desktop/bluetooth.nix b/configurations/linux/desktop/bluetooth.nix @@ -1,59 +0,0 @@ -{ lib, config, pkgs, ... }: - -{ - hardware.bluetooth = { - enable = true; - powerOnBoot = false; - }; - - services.blueman = { - enable = true; - }; - - home-manager.users.leah = { - home.packages = [ pkgs.blueman ]; - - xdg = { - desktopEntries = { - blueman-adapters = { - name = "Bluetooth Adapters"; - icon = "blueman-device"; - exec = "blueman-adapters"; - terminal = false; - categories = [ "X-XFCE" "Settings" "HardwareSettings" "X-XFCE-SettingsDialog" "GTK" ]; - settings = { - NoDisplay = "true"; - }; - }; - }; - }; - - wayland.windowManager.sway.extraConfig = '' - exec_always 'systemctl --user restart blueman-applet' - ''; - - systemd.user.services = { - blueman-applet = { - Unit = { - Description = "Blueman applet"; - Requires = [ "waybar.service" ]; - After = [ "graphical-session-pre.target" "tray.target" ]; - PartOf = [ "graphical-session.target" ]; - }; - - Service.ExecStart = "${pkgs.blueman}/bin/blueman-applet"; - Install.WantedBy = [ "graphical-session.target" ]; - }; - - mpris-proxy = { - Unit = { - Description = "Mpris proxy"; - After = [ "network.target" "sound.target" ]; - }; - - Service.ExecStart = "${pkgs.bluez}/bin/mpris-proxy"; - Install.WantedBy = [ "default.target" ]; - }; - }; - }; -}
diff --git a/configurations/linux/desktop/fonts.nix b/configurations/linux/desktop/fonts.nix @@ -1,20 +0,0 @@ -{ config, pkgs, ... }: - -{ - fonts = { - fontconfig.enable = true; - fontDir.enable = true; - enableGhostscriptFonts = true; - enableDefaultFonts = true; - fonts = with pkgs; [ - dejavu_fonts - liberation_ttf - ttf_bitstream_vera - noto-fonts - noto-fonts-emoji - font-awesome - fira-code - fira-mono - ]; - }; -}
diff --git a/configurations/linux/desktop/gtk.nix b/configurations/linux/desktop/gtk.nix @@ -1,30 +0,0 @@ -{ config, lib, pkgs, home-manager, ... }: - -{ - services.dbus.packages = with pkgs; [ dconf ]; - home-manager.users.leah = { - - gtk = { - enable = true; - - iconTheme = { - name = "Adwaita"; - package = pkgs.gnome3.adwaita-icon-theme; - }; - - font = { - name = "Dejavu Sans"; - package = pkgs.dejavu_fonts; - }; - - gtk3 = { - #bookmarks - extraConfig = { - gtk-application-prefer-dark-theme = true; - gtk-recent-files-limit = 10; - }; - }; - }; - - }; -}
diff --git a/configurations/linux/desktop/mobile-device.nix b/configurations/linux/desktop/mobile-device.nix @@ -1,43 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - powerManagement = { - enable = true; - cpuFreqGovernor = lib.mkDefault "powersave"; - }; - - services = { - upower.enable = true; -# throttled.enable = true; - - logind.lidSwitch = "lock"; - logind.extraConfig = "HandlePowerKey=suspend"; - - tlp = { - enable = true; - settings = { - CPU_SCALING_GOVERNOR_ON_AC = "performance"; - CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; - - START_CHARGE_THRESH_BAT0 = 95; - STOP_CHARGE_THRESH_BAT0 = 100; - - - CPU_SCALING_MIN_FREQ_ON_AC = 800000; - CPU_SCALING_MAX_FREQ_ON_AC = 3000000; - CPU_SCALING_MIN_FREQ_ON_BAT = 800000; - CPU_SCALING_MAX_FREQ_ON_BAT = 2000000; - - SOUND_POWER_SAVE_ON_AC = 0; - SOUND_POWER_SAVE_ON_BAT = 1; - - RUNTIME_PM_ON_AC = "on"; - RUNTIME_PM_ON_BAT = "auto"; - - NATACPI_ENABLE = 1; - TPACPI_ENABLE = 1; - TPSMAPI_ENABLE = 1; - }; - }; - }; -}
diff --git a/configurations/linux/desktop/programs/alacritty.nix b/configurations/linux/desktop/programs/alacritty.nix @@ -1,61 +0,0 @@ -{ pkgs, ... }: - -{ - home-manager.users.leah = { - home = { - sessionVariables = { - TERMINAL = "alacritty"; - }; - }; - - programs = { - alacritty = { - enable = true; - settings = { - window.opacity = 0.9; - - font.normal = { - family = "DejaVu Sans Mono"; - size = 9.0; - }; - - colors = { - primary = { - background = "0x000000"; - foreground = "0xeaeaea"; - }; - - normal = { - black = "0x6c6c6c"; - red = "0xe9897c"; - green = "0xb6e77d"; - yellow = "0xecebbe"; - blue = "0xa9cdeb"; - magenta = "0xea96eb"; - cyan = "0xc9caec"; - white = "0xf2f2f2"; - }; - - bright = { - black = "0x747474"; - red = "0xf99286"; - green = "0xc3f786"; - yellow = "0xfcfbcc"; - blue = "0xb6defb"; - magenta = "0xfba1fb"; - cyan = "0xd7d9fc"; - white = "0xe2e2e2"; - }; - }; - }; - }; - }; - - wayland.windowManager.sway = { - config.terminal = "${pkgs.alacritty}/bin/alacritty"; - extraConfig = '' - exec swaymsg 'workspace 3: Term; exec ${pkgs.alacritty}/bin/alacritty; exec ${pkgs.alacritty}/bin/alacritty; workspace 1: Web;' - ''; - }; - }; -}
diff --git a/configurations/linux/desktop/programs/ddcutil.nix b/configurations/linux/desktop/programs/ddcutil.nix @@ -1,19 +0,0 @@ -{ pkgs, lib, ... }: - -{ - boot.kernelModules = [ "i2c-dev" ]; - - security.sudo.extraRules= [ - { users = [ "leah" ]; - commands = [ - { command = "${pkgs.ddcutil}/bin/ddcutil" ; - options= [ "NOPASSWD" ]; - } - ]; - } - ]; - - home-manager.users.leah = { - home.packages = [ pkgs.ddcutil ]; - }; -}
diff --git a/configurations/linux/desktop/programs/firefox.nix b/configurations/linux/desktop/programs/firefox.nix @@ -1,75 +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; - ''; - - 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/desktop/programs/gammastep.nix b/configurations/linux/desktop/programs/gammastep.nix @@ -1,17 +0,0 @@ -{ ... }: - -{ - home-manager.users.leah = { - - services.gammastep = { - enable = true; - latitude = "8.26"; - longitude = "49.01"; - temperature = { - night = 3000; - day = 4500; - }; - }; - - }; -}
diff --git a/configurations/linux/desktop/programs/gimp/default.nix b/configurations/linux/desktop/programs/gimp/default.nix @@ -1,104 +0,0 @@ -{ lib, pkgs, ... }: - -let - gimp = pkgs.stdenv.mkDerivation rec { - pname = "gimp"; - version = "2.99.6"; - - src = pkgs.fetchurl { - url = "http://download.gimp.org/pub/gimp/v${lib.versions.majorMinor version}/${pname}-${version}.tar.bz2"; - sha256 = "1836izsv4zymky43nmp8fplmb4j6kfwf03pk82wz4gas8hl4n9ld"; - }; - - patches = [ - # to remove compiler from the runtime closure, reference was retained via - # gimp --version --verbose output - (pkgs.substituteAll { - src = ./remove-cc-reference.patch; - cc_version = pkgs.stdenv.cc.cc.name; - }) - ]; - - nativeBuildInputs = with pkgs; [ - autoreconfHook - pkg-config - intltool - gettext - makeWrapper - gtk-doc - ]; - - buildInputs = with pkgs; [ - babl - gegl - gtk3 - glib - gdk-pixbuf - pango - cairo - gexiv2 - harfbuzz - isocodes - freetype - fontconfig - lcms - libpng - libjpeg - poppler - poppler_data - libtiff - openexr - libmng - librsvg - libwmf - zlib - libzip - ghostscript - aalib - shared-mime-info - libwebp - libheif - libexif - xorg.libXpm - glib-networking - libmypaint - mypaint-brushes1 - libgudev - gobject-introspection - vala - appstream-glib - libarchive - ]; - - configureFlags = [ - "--without-webkit" # old version is required - "--disable-check-update" - "--with-bug-report-url=https://github.com/NixOS/nixpkgs/issues/new" - "--with-icc-directory=/run/current-system/sw/share/color/icc" - # fix libdir in pc files (${exec_prefix} needs to be passed verbatim) - "--libdir=\${exec_prefix}/lib" - # because otherwise it would try to download stuff in build - "--without-appdata-test" - ]; - - enableParallelBuilding = true; - - # Check if librsvg was built with --disable-pixbuf-loader. - PKG_CONFIG_GDK_PIXBUF_2_0_GDK_PIXBUF_MODULEDIR = "${pkgs.librsvg}/${pkgs.gdk-pixbuf.moduleDir}"; - - preConfigure = '' - # The check runs before glib-networking is registered - export GIO_EXTRA_MODULES="${pkgs.glib-networking}/lib/gio/modules:$GIO_EXTRA_MODULES" - ''; - - postFixup = '' - wrapProgram $out/bin/gimp-${lib.versions.majorMinor version} \ - --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" - ''; - }; - -in { - - home-manager.users.leah.home.packages = [ gimp ]; - -}
diff --git a/configurations/linux/desktop/programs/gimp/remove-cc-reference.patch b/configurations/linux/desktop/programs/gimp/remove-cc-reference.patch @@ -1,12 +0,0 @@ -diff --git a/app/gimp-version.c b/app/gimp-version.c -index 3d1894a036..48bb670b64 100644 ---- a/app/gimp-version.c -+++ b/app/gimp-version.c -@@ -230,7 +230,7 @@ gimp_version (gboolean be_verbose, - GIMP_BUILD_ID, - gimp_version_get_revision (), - GIMP_BUILD_PLATFORM_FAMILY, -- CC_VERSION, -+ "@cc_version@", - lib_versions); - g_free (lib_versions);
diff --git a/configurations/linux/desktop/programs/imv.nix b/configurations/linux/desktop/programs/imv.nix @@ -1,22 +0,0 @@ -{ pkgs, ... }: - -{ - home-manager.users.leah = { - home.packages = [ pkgs.imv ]; - - xdg = { - desktopEntries = { - imv-folder = { - name = "imv (Folder)"; - genericName = "Image Viewer"; - exec = "imv-folder %f"; - terminal = false; - categories = [ "Graphics" "2DGraphics" "Viewer" ]; - settings = { - NoDisplay = "true"; - }; - }; - }; - }; - }; -}
diff --git a/configurations/linux/desktop/programs/libreoffice.nix b/configurations/linux/desktop/programs/libreoffice.nix @@ -1,72 +0,0 @@ -{ pkgs, ... }: - -{ - home-manager.users.leah = { - home = { - packages = [ pkgs.libreoffice-fresh ]; - }; - - xdg = { - desktopEntries = { - impress = { - name = "LibreOffice Impress"; - genericName = "Presentation"; - icon = "impress"; - exec = "libreoffice --impress %U"; - terminal = false; - mimeType = [ "application/vnd.oasis.opendocument.presentation" "application/vnd.oasis.opendocument.presentation-template" "application/vnd.sun.xml.impress" - "application/vnd.sun.xml.impress.template" "application/mspowerpoint" "application/vnd.ms-powerpoint" "application/vnd.openxmlformats-officedocument.presentationml.presentation" - "application/vnd.ms-powerpoint.presentation.macroEnabled.12" "application/vnd.openxmlformats-officedocument.presentationml.template" - "application/vnd.ms-powerpoint.template.macroEnabled.12" "application/vnd.openxmlformats-officedocument.presentationml.slide" - "application/vnd.openxmlformats-officedocument.presentationml.slideshow" "application/vnd.ms-powerpoint.slideshow.macroEnabled.12" - "application/vnd.oasis.opendocument.presentation-flat-xml" "application/x-iwork-keynote-sffkey" ]; - categories = [ "Office" "Presentation" "X-Red-Hat-Base" "X-MandrivaLinux-Office-Presentations" ]; - settings = { - NoDisplay = "true"; - }; - }; - - math = { - name = "LibreOffice Math"; - genericName = "Formular Editor"; - icon = "math"; - exec = "libreoffice --math %U"; - terminal = false; - mimeType = [ "application/vnd.oasis.opendocument.formula" "application/vnd.sun.xml.math" "application/vnd.oasis.opendocument.formula-template" "text/mathml" "application/mathml+xml" ]; - categories = [ "Office" "Education" "Science" "Math" "X-Red-Hat-Base" "X-MandrivaLinux-Office-Other" ]; - settings = { - NoDisplay = "true"; - }; - }; - - base = { - name = "LibreOffice Base"; - genericName = "Database Development"; - icon = "base"; - exec = "libreoffice --base %U"; - terminal = false; - mimeType = [ "application/vnd.oasis.opendocument.database" "application/vnd.sun.xml.base" ]; - categories = [ "Office" "Database" "X-Red-Hat-Base" "X-MandrivaLinux-MoreApplications-Databases" ]; - settings = { - NoDisplay = "true"; - }; - }; - - draw = { - name = "LibreOffice Draw"; - genericName = "Drawing Program"; - icon = "draw"; - exec = "libreoffice --draw %U"; - terminal = false; - mimeType = [ "application/vnd.oasis.opendocument.graphics" "application/vnd.oasis.opendocument.graphics-flat-xml" "application/vnd.oasis.opendocument.graphics-template" - "application/vnd.sun.xml.draw" "application/vnd.sun.xml.draw.template" "application/vnd.visio" "application/x-wpg" "application/vnd.corel-draw" - "application/vnd.ms-publisher" "image/x-freehand" "application/clarisworks" "application/x-pagemaker" "application/pdf" "application/x-stardraw" "image/x-emf" "image/x-wmf" ]; - categories = [ "Office" "FlowChart" "Graphics" "2DGraphics" "VectorGraphics" "X-Red-Hat-Base" "X-MandrivaLinux-Office-Drawing" ]; - settings = { - NoDisplay = "true"; - }; - }; - }; - }; - }; -}
diff --git a/configurations/linux/desktop/programs/mako.nix b/configurations/linux/desktop/programs/mako.nix @@ -1,41 +0,0 @@ -{ pkgs, ... }: - -{ - home-manager.users.leah = { - programs.mako = { - enable = true; - - defaultTimeout = 20000; - - borderColor = "#002028"; - borderSize = 2; - - backgroundColor = "#002b36AA"; - - textColor = "#fdf6e3"; - font = "Fira Code 11"; - format = "<b>%s</b> <span color=\"#93a1a1\">(%a)</span>\\n%b"; - }; - - systemd.user.services.mako = { - Unit = { - After = [ "graphical-session-pre.target" ]; - PartOf = [ "graphical-session.target" ]; - }; - - Service = { - ExecStart = "${pkgs.mako}/bin/mako"; - Restart = "always"; - RestartSec = 5; - }; - - Install = { - WantedBy = [ "graphical-session.target" ]; - }; - }; - - wayland.windowManager.sway.extraConfig = '' - exec_always 'systemctl --user restart mako' - ''; - }; -}
diff --git a/configurations/linux/desktop/programs/mpv.nix b/configurations/linux/desktop/programs/mpv.nix @@ -1,63 +0,0 @@ -{ pkgs, ... }: - -{ - home-manager.users.leah = { - programs = { - mpv = { - enable = true; - scripts = [ - pkgs.mpvScripts.mpris - ]; - }; - }; - - xdg = { - desktopEntries = { - mpv = { - name = "mpv Media Player"; - genericName = "Multimedia player"; - icon = "mpv"; - exec = "mpv --player-operation-mode=pseudo-gui -- %U"; - terminal = false; - mimeType = [ "application/ogg" "application/x-ogg" "application/mxf" "application/sdp" "application/smil" "application/x-smil" "application/streamingmedia" "application/x-streamingmedia" - "application/vnd.rn-realmedia" "application/vnd.rn-realmedia-vbr" "audio/aac" "audio/x-aac" "audio/vnd.dolby.heaac.1" "audio/vnd.dolby.heaac.2" "audio/aiff" "audio/x-aiff" - "audio/m4a" "audio/x-m4a" "application/x-extension-m4a" "audio/mp1" "audio/x-mp1" "audio/mp2" "audio/x-mp2" "audio/mp3" "audio/x-mp3" "audio/mpeg" "audio/mpeg2" "audio/mpeg3" - "audio/mpegurl" "audio/x-mpegurl" "audio/mpg" "audio/x-mpg" "audio/rn-mpeg" "audio/musepack" "audio/x-musepack" "audio/ogg" "audio/scpls" "audio/x-scpls" "audio/vnd.rn-realaudio" - "audio/wav" "audio/x-pn-wav" "audio/x-pn-windows-pcm" "audio/x-realaudio" "audio/x-pn-realaudio" "audio/x-ms-wma" "audio/x-pls" "audio/x-wav" "video/mpeg" "video/x-mpeg2" - "video/x-mpeg3" "video/mp4v-es" "video/x-m4v" "video/mp4" "application/x-extension-mp4" "video/divx" "video/vnd.divx" "video/msvideo" "video/x-msvideo" "video/ogg" "video/quicktime" - "video/vnd.rn-realvideo" "video/x-ms-afs" "video/x-ms-asf" "audio/x-ms-asf" "application/vnd.ms-asf" "video/x-ms-wmv" "video/x-ms-wmx" "video/x-ms-wvxvideo" "video/x-avi" - "video/avi" "video/x-flic" "video/fli" "video/x-flc" "video/flv" "video/x-flv" "video/x-theora" "video/x-theora+ogg" "video/x-matroska" "video/mkv" "audio/x-matroska" - "application/x-matroska" "video/webm" "audio/webm" "audio/vorbis" "audio/x-vorbis" "audio/x-vorbis+ogg" "video/x-ogm" "video/x-ogm+ogg" "application/x-ogm" "application/x-ogm-audio" - "application/x-ogm-video" "application/x-shorten" "audio/x-shorten" "audio/x-ape" "audio/x-wavpack" "audio/x-tta" "audio/AMR" "audio/ac3" "audio/eac3" "audio/amr-wb" - "video/mp2t" "audio/flac" "audio/mp4" "application/x-mpegurl" "video/vnd.mpegurl" "application/vnd.apple.mpegurl" "audio/x-pn-au" "video/3gp" "video/3gpp" "video/3gpp2" - "audio/3gpp" "audio/3gpp2" "video/dv" "audio/dv" "audio/opus" "audio/vnd.dts" "audio/vnd.dts.hd" "audio/x-adpcm" "application/x-cue" "audio/m3u" ]; - categories = [ "AudioVideo" "Audio" "Video" "Player" "TV" ]; - }; - - umpv = { - name = "umpv Media Player"; - genericName = "Multimedia player"; - icon = "mpv"; - exec = "umpv --player-operation-mode=pseudo-gui -- %U"; - terminal = false; - mimeType = [ "application/ogg" "application/x-ogg" "application/mxf" "application/sdp" "application/smil" "application/x-smil" "application/streamingmedia" "application/x-streamingmedia" - "application/vnd.rn-realmedia" "application/vnd.rn-realmedia-vbr" "audio/aac" "audio/x-aac" "audio/vnd.dolby.heaac.1" "audio/vnd.dolby.heaac.2" "audio/aiff" "audio/x-aiff" - "audio/m4a" "audio/x-m4a" "application/x-extension-m4a" "audio/mp1" "audio/x-mp1" "audio/mp2" "audio/x-mp2" "audio/mp3" "audio/x-mp3" "audio/mpeg" "audio/mpeg2" "audio/mpeg3" - "audio/mpegurl" "audio/x-mpegurl" "audio/mpg" "audio/x-mpg" "audio/rn-mpeg" "audio/musepack" "audio/x-musepack" "audio/ogg" "audio/scpls" "audio/x-scpls" "audio/vnd.rn-realaudio" - "audio/wav" "audio/x-pn-wav" "audio/x-pn-windows-pcm" "audio/x-realaudio" "audio/x-pn-realaudio" "audio/x-ms-wma" "audio/x-pls" "audio/x-wav" "video/mpeg" "video/x-mpeg2" - "video/x-mpeg3" "video/mp4v-es" "video/x-m4v" "video/mp4" "application/x-extension-mp4" "video/divx" "video/vnd.divx" "video/msvideo" "video/x-msvideo" "video/ogg" "video/quicktime" - "video/vnd.rn-realvideo" "video/x-ms-afs" "video/x-ms-asf" "audio/x-ms-asf" "application/vnd.ms-asf" "video/x-ms-wmv" "video/x-ms-wmx" "video/x-ms-wvxvideo" "video/x-avi" - "video/avi" "video/x-flic" "video/fli" "video/x-flc" "video/flv" "video/x-flv" "video/x-theora" "video/x-theora+ogg" "video/x-matroska" "video/mkv" "audio/x-matroska" - "application/x-matroska" "video/webm" "audio/webm" "audio/vorbis" "audio/x-vorbis" "audio/x-vorbis+ogg" "video/x-ogm" "video/x-ogm+ogg" "application/x-ogm" "application/x-ogm-audio" - "application/x-ogm-video" "application/x-shorten" "audio/x-shorten" "audio/x-ape" "audio/x-wavpack" "audio/x-tta" "audio/AMR" "audio/ac3" "audio/eac3" "audio/amr-wb" - "video/mp2t" "audio/flac" "audio/mp4" "application/x-mpegurl" "video/vnd.mpegurl" "application/vnd.apple.mpegurl" "audio/x-pn-au" "video/3gp" "video/3gpp" "video/3gpp2" - "audio/3gpp" "audio/3gpp2" "video/dv" "audio/dv" "audio/opus" "audio/vnd.dts" "audio/vnd.dts.hd" "audio/x-adpcm" "application/x-cue" "audio/m3u" ]; - categories = [ "AudioVideo" "Audio" "Video" "Player" "TV" ]; - settings = { - NoDisplay = "true"; - }; - }; - }; - }; - }; -}
diff --git a/configurations/linux/desktop/programs/physlock.nix b/configurations/linux/desktop/programs/physlock.nix @@ -1,10 +0,0 @@ -{ ... }: - -{ - services = { - physlock = { - enable = true; - lockMessage = "Hi!"; - }; - }; -}
diff --git a/configurations/linux/desktop/programs/sublime-text3.nix b/configurations/linux/desktop/programs/sublime-text3.nix @@ -1,7 +0,0 @@ -{ pkgs, ... }: - -{ - home-manager.users.leah = { - home.packages = [ pkgs.sublime3 ]; - }; -}
diff --git a/configurations/linux/desktop/programs/sway.nix b/configurations/linux/desktop/programs/sway.nix @@ -1,241 +0,0 @@ -{ config, pkgs, lib, ... }: - -{ -# environment.noXlibs = true; - - nixpkgs.overlays = [(self: super: { - - wlroots = super.wlroots.overrideAttrs (old: { - mesonFlags = (old.mesonFlags or []) ++ [ - "-Dxwayland=disabled" - ]; - }); - - sway-unwrapped = super.sway-unwrapped.overrideAttrs (old: { - mesonFlags = (old.mesonFlags or []) ++ [ - "-Dxwayland=disabled" - ]; - }); - - wl-clipboard-x11 = super.stdenv.mkDerivation rec { - pname = "wl-clipboard-x11"; - version = "5"; - - src = super.fetchFromGitHub { - owner = "brunelli"; - repo = "wl-clipboard-x11"; - rev = "v${version}"; - sha256 = "1y7jv7rps0sdzmm859wn2l8q4pg2x35smcrm7mbfxn5vrga0bslb"; - }; - - dontBuild = true; - dontConfigure = true; - propagatedBuildInputs = [ super.wl-clipboard ]; - makeFlags = [ "PREFIX=$(out)" ]; - }; - - xsel = self.wl-clipboard-x11; - xclip = self.wl-clipboard-x11; - })]; - - home-manager.users.leah = { - - home.packages = with pkgs; [ - qt5.qtwayland wl-clipboard - ]; - - programs.bash.initExtra = '' - if [ "$(tty)" = "/dev/tty1" ]; then - exec sway - fi - ''; - - wayland.windowManager.sway = let - cfg = config.home-manager.users.leah.wayland.windowManager.sway; - modifier = cfg.config.modifier; - - in { - enable = true; - xwayland = false; - wrapperFeatures.gtk = true; - - extraSessionCommands = '' - export QT_QPA_PLATFORM=wayland - export QT_WAYLAND_FORCE_DPI=physical - export QT_WAYLAND_DISABLE_WINDOWDECORATION=1 - - export _JAVA_AWT_WM_NONREPARENTING=1 - - # be careful with those, they *will* break some applications - export SDL_VIDEODRIVER=wayland - export GDK_BACKEND=wayland - ''; - - extraConfig = '' - # Import the most important environment variables into the D-Bus and systemd - # user environments (e.g. required for screen sharing and Pinentry prompts): - exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP - ''; - - config = { - fonts = { - names = [ "Noto Sans Mono" "FontAwesome5Free" ]; - style = ""; - size = 11.0; - }; - - colors = { - focused = { - background = "#3b8756"; - border = "#3b8756"; - childBorder = "#3b8756"; - text = "#eceff4"; - indicator = "#8fbcbb"; - }; - }; - - window = { - titlebar = false; - hideEdgeBorders = "smart"; - border = 5; - }; - - input = { - "*" = { - xkb_layout = "us,ru,de"; - xkb_variant = "mac,mac,qwerty"; - xkb_options = "grp:alt_shift_toggle"; - natural_scroll = "enabled"; - }; - - "1452:613:Apple_Inc._Magic_Trackpad_2" = { - accel_profile = "adaptive"; - }; - }; - - output = { - "*" = { - bg = "~/Pictures/photos.ctu.cx/Bahnbilder/2019.06/20190622-153441.jpg fill"; - scale = lib.mkDefault "1"; - }; - }; - - assigns = { - "1: Web" = [{ app_id = "firefox"; }]; - "2: Mail" = [{ app_id = "thunderbird"; }]; - "4: Code" = [{ app_id = "subl"; }]; - }; - - bars = []; - - modifier = "Mod4"; - - workspaceAutoBackAndForth = true; - - keybindings = { - "${modifier}+Return" = "exec ${cfg.config.terminal}"; - "${modifier}+Space" = "exec ${pkgs.wofi}/bin/wofi --style ${./wofi/style.css} --conf ${./wofi/config} --show drun"; - "${modifier}+l" = "exec ${pkgs.systemd}/bin/loginctl lock-session"; - "${modifier}+z" = "exec sleep 1 && systemctl suspend"; - - "Shift+Print" = "exec ${pkgs.grim}/bin/grim ~/Pictures/Screenshots/$(date +\"%Y-%m-%d_%H:%m:%S\").png"; - "${modifier}+Shift+Print" = "exec ${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp)\" ~/Pictures/Screenshots/$(date +\"%Y-%m-%d_%H:%m:%S\").png"; - "Print" = "exec ${pkgs.grim}/bin/grim - | ${pkgs.wl-clipboard}/bin/wl-copy -t image/png"; - "${modifier}+Print" = "exec ${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp)\" - | ${pkgs.wl-clipboard}/bin/wl-copy -t image/png"; - - "XF86MonBrightnessUp" = "exec ${pkgs.brightnessctl}/bin/brightnessctl s +5%"; - "XF86MonBrightnessDown" = "exec ${pkgs.brightnessctl}/bin/brightnessctl s 5%-"; - - "XF86AudioRaiseVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%"; - "XF86AudioLowerVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -5%"; - "XF86AudioMute" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle"; - "XF86AudioMicMute" = "exec ${pkgs.pulseaudio}/bin/pactl set-source-mute @DEFAULT_SOURCE@ toggle"; - - #laptop - "XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause"; - "XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next"; - "XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous"; - - #desktop - "XF86LaunchA" = "exec ${pkgs.playerctl}/bin/playerctl play-pause"; - "XF86MyComputer" = "exec ${pkgs.playerctl}/bin/playerctl next"; - "XF86Search" = "exec ${pkgs.playerctl}/bin/playerctl previous"; - - "${modifier}+Shift+e" = "exec swaynag -t warning -m 'Do you really want to exit sway?' -b 'Yep' 'swaymsg exit'"; - - "${modifier}+Shift+q" = "kill"; - "Alt+F4" = "kill"; - - "${modifier}+Shift+c" = "reload"; - - "${modifier}+Left" = "focus left"; - "${modifier}+Down" = "focus down"; - "${modifier}+Up" = "focus up"; - "${modifier}+Right" = "focus right"; - "${modifier}+a" = "focus parent"; - - - "${modifier}+Shift+Left" = "move left"; - "${modifier}+Shift+Down" = "move down"; - "${modifier}+Shift+Up" = "move up"; - "${modifier}+Shift+Right" = "move right"; - - "${modifier}+1" = "workspace 1: Web"; - "${modifier}+2" = "workspace 2: Mail"; - "${modifier}+3" = "workspace 3: Term; layout tabbed"; - "${modifier}+4" = "workspace 4: Code"; - "${modifier}+5" = "workspace number 5"; - "${modifier}+6" = "workspace 6: Files"; - "${modifier}+7" = "workspace number 7"; - "${modifier}+8" = "workspace number 8"; - "${modifier}+9" = "workspace number 9"; - "${modifier}+0" = "workspace number 10"; - - "${modifier}+Shift+1" = "move container to workspace 1: Web"; - "${modifier}+Shift+2" = "move container to workspace 2: Mail"; - "${modifier}+Shift+3" = "move container to workspace 3: Term"; - "${modifier}+Shift+4" = "move container to workspace 4: Code"; - "${modifier}+Shift+5" = "move container to workspace number 5"; - "${modifier}+Shift+6" = "move container to workspace 6: Files"; - "${modifier}+Shift+7" = "move container to workspace number 7"; - "${modifier}+Shift+8" = "move container to workspace number 8"; - "${modifier}+Shift+9" = "move container to workspace number 9"; - "${modifier}+Shift+0" = "move container to workspace number 10"; - - "${modifier}+s" = "layout stacking"; - "${modifier}+w" = "layout tabbed"; - "${modifier}+e" = "layout toggle split"; - - "${modifier}+f" = "fullscreen"; - - "${modifier}+r" = "mode \"resize\""; - "${modifier}+b" = "mode \"waybar\""; - - "${modifier}+Shift+space" = "floating toggle"; - }; - - modes = { - "resize" = { - "Right" = "resize shrink width 10px"; - "Left" = "resize grow width 10px"; - "Down" = "resize shrink height 10px"; - "Up" = "resize grow height 10px"; - - "Return" = "mode \"default\""; - "Escape" = "mode \"default\""; - "${modifier}+r" = "mode \"default\""; - }; - - "waybar" = { - "space" = "exec pkill -SIGUSR1 waybar"; - "r" = "exec pkill -SIGUSR2 waybar"; - - "Return" = "mode \"default\""; - "Escape" = "mode \"default\""; - "${modifier}+r" = "mode \"default\""; - }; - }; - }; - }; - }; -}
diff --git a/configurations/linux/desktop/programs/swaylock.nix b/configurations/linux/desktop/programs/swaylock.nix @@ -1,23 +0,0 @@ -{ config, pkgs, ... }: - -{ - security.pam.services.swaylock = {}; - - home-manager.users.leah.systemd.user.services = { - swaylock = { - Unit = { - Requisite = [ "graphical-session.target" ]; - PartOf = [ "lock.target" "sleep.target" ]; - }; - - Service = { - ExecStart = "${pkgs.swaylock}/bin/swaylock -i /home/leah/Pictures/Backgrounds/lock.png"; - ExecStopPost = "${pkgs.systemd}/bin/loginctl unlock-session"; - }; - - Install = { - WantedBy = [ "lock.target" "sleep.target" ]; - }; - }; - }; -}
diff --git a/configurations/linux/desktop/programs/systemd-lock-handler.nix b/configurations/linux/desktop/programs/systemd-lock-handler.nix @@ -1,55 +0,0 @@ -{ pkgs, ... }: - -let - systemd-lock-handler = pkgs.buildGoModule rec { - name = "systemd-lock-handler"; - src = pkgs.fetchFromSourcehut { - owner = "~whynothugo"; - repo = "systemd-lock-handler"; - rev = "a0b3cec818520f2970b7da36b2cf25d860d8d017"; - sha256 = "1cna5kpcm9sb7azyk3355g5lb6vs8fyszkwjalv2ld159n80w63f"; - }; - vendorHash = "09n8g7m8pk442jgji7ws8mwp92c3ig8nvbbkbghh2pcgbgkyc3gn"; - }; - -in { - home-manager.users.leah.systemd.user = { - services.systemd-lock-handler = { - Unit = { - Description = "Logind lock event to systemd target translation"; - Documentation = [ "https://sr.ht/~whynothugo/systemd-lock-handler" ]; - }; - - Service = { - Type = "notify"; - ExecStart = "${systemd-lock-handler}/bin/systemd-lock-handler"; - }; - - Install = { - WantedBy = [ "default.target" ]; - }; - }; - - targets = { - lock = { - Unit = { - Description = "Lock the current session"; - Conflicts = [ "unlock.target" ]; - }; - }; - - unlock = { - Unit = { - Description = "Unlock the current session"; - Conflicts = [ "lock.target" ]; - }; - }; - - sleep = { - Unit = { - Description = "User-level target triggered when the system is about to sleep"; - }; - }; - }; - }; -}
diff --git a/configurations/linux/desktop/programs/thunar.nix b/configurations/linux/desktop/programs/thunar.nix @@ -1,48 +0,0 @@ -{ pkgs, ... }: - -{ - imports = [ - ../services/gvfs.nix - ]; - - services = { - tumbler.enable = true; - }; - - home-manager.users.leah = { - home.packages = with pkgs; [ - xfce.thunar - ]; - - xdg = { - desktopEntries = { - thunar-bulk-rename = { - name = "Bulk Rename"; - genericName = "Bulk Rename"; - icon = "org.xfce.thunar"; - exec = "thunar --bulk-rename %F"; - terminal = false; - categories = [ "System" "Utility" "Core" "GTK" "Filesystem" ]; - settings = { - NoDisplay = "true"; - }; - }; - - thunar-settings = { - name = "File Manager Settings"; - icon = "org.xfce.thunar"; - exec = "thunar-settings"; - terminal = false; - categories = [ "XFCE" "GTK" "Settings" "DesktopSettings" "X-XFCE-SettingsDialog" "X-XFCE-PersonalSettings" ]; - settings = { - NoDisplay = "true"; - }; - }; - }; - }; - - wayland.windowManager.sway.extraConfig = '' - exec swaymsg 'workspace 6: Files; exec thunar; workspace 1: Web;' - ''; - }; -}
diff --git a/configurations/linux/desktop/programs/thunderbird.nix b/configurations/linux/desktop/programs/thunderbird.nix @@ -1,47 +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' - ''; - - 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/programs/utilities.nix b/configurations/linux/desktop/programs/utilities.nix @@ -1,10 +0,0 @@ -{ pkgs, ... }: - -{ - home-manager.users.leah = { - home.packages = with pkgs; [ - pavucontrol - AusweisApp2 - ]; - }; -}
diff --git a/configurations/linux/desktop/programs/waybar/default.nix b/configurations/linux/desktop/programs/waybar/default.nix @@ -1,141 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - home-manager.users.leah = { - wayland.windowManager.sway.extraConfig = '' - exec_always 'systemctl --user restart waybar' - ''; - - programs = { - waybar = { - enable = true; - systemd.enable = true; - - style = builtins.readFile ./style.css; - - settings = [{ - layer = "top"; - position = "top"; - - height = 40; - - modules-left = [ "sway/workspaces" "sway/mode" ]; - modules-center = [ "clock" ]; - modules-right = ( - if config.networking.hostName != "stasicontainer" then [ - "tray" "disk" "memory" "cpu" "idle_inhibitor" "network#wifi" "battery" "pulseaudio" - ] else [ - "tray" "disk" "memory" "cpu" "idle_inhibitor" "network#ethernet" "pulseaudio" - ] - ); - - modules = { - "sway/workspaces" = { - disable-scroll = true; - }; - - "sway/mode" = { - tooltip = false; - format = "<span style=\"italic\">{}</span>"; - }; - - clock = { - interval = 1; - format = "{:%H:%M:%S}"; - format-alt = "{:%Y-%m-%d}"; - tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>"; - }; - - tray = { - tooltip = false; -# icon-size = 21; - spacing = 10; - }; - - disk = { - format = " {}%"; - tooltip-format = "SSD: {used} / {total} used"; - }; - - memory = { - format = " {}%"; - tooltip-format = "RAM: {used:0.1f}G / {total:0.1f}G used"; - }; - - cpu = { - format = " {usage}%"; - tooltip = false; - }; - - battery = { - bat = "BAT0"; - adapter = "AC"; - interval = 10; - full-at = 99; - states = { - full = 100; - good = 99; - warning = 40; - critical = 15; - }; - - format = "{icon} <span color='white'>{capacity}%</span>"; - format-charging = " <span color='white'>{capacity}%</span>"; - format-plugged = " <span color='white'>{capacity}%</span>"; - format-empty = ""; - format-full = ""; - format-icons = ["" "" "" "" ""]; - }; - - "network#ethernet" = { - interface = "eno1"; - tooltip-format = "{ifname}: {ipaddr}/{cidr}"; - - format-ethernet = ""; - format-linked = ""; - format-disconnected = ""; - }; - - "network#wifi" = { - interface = "wlan0*"; - tooltip-format = "{ifname}: {ipaddr}/{cidr}"; - - format-ethernet = ""; - format-wifi = " {essid} ({signalStrength}%)"; - format-linked = ""; - format-disconnected = ""; - }; - - pulseaudio = { - scroll-step = 1; - on-click = "${pkgs.pavucontrol}/bin/pavucontrol"; - on-click-right = "PULSE_SERVER=10.0.0.1 ${pkgs.pavucontrol}/bin/pavucontrol"; - - format = "{format_source} {icon} {volume}%"; - format-bluetooth = "{format_source} {icon} {volume}%"; - format-bluetooth-muted = "{format_source} "; - format-muted = "{format_source} "; - format-source = ""; - format-source-muted = ""; - format-icons = { - headphone = ""; - phone = ""; - portable = ""; - car = ""; - default = ["" "" ""]; - }; - }; - - idle_inhibitor = { - format = "{icon}"; - format-icons = { - activated = ""; - deactivated = ""; - }; - }; - }; - }]; - }; - }; - }; -}
diff --git a/configurations/linux/desktop/programs/waybar/style.css b/configurations/linux/desktop/programs/waybar/style.css @@ -1,63 +0,0 @@ -@keyframes blink { - to { - background: transparent; - color: #fff; - } -} - -* { - font-family: 'Noto Sans'; - font-size: 15px; - border: none; - border-radius: 0; - min-height: 0; - transition: none; - box-shadow: none; -} - -window#waybar { - /* background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); */ - background: rgba(0, 0, 0, 0.5); - color: white; - border-bottom: 2px solid rgba(59, 135, 86, 0.5); -} - -#workspaces button.focused { - background: rgba(255, 255, 255, 0.1); - border-bottom: 3px solid rgb(74, 169, 108); -} - -#workspaces button:hover { - background: rgba(255, 255, 255, 0.06); -} - -#clock { - font-size: 16px; - font-family: 'Noto Mono', monospace; -} - -#disk, #memory, #cpu, #idle_inhibitor, #battery, #pulseaudio, #network { - padding: 0px 15px; -} - -#battery { - color: #a3be8c; -} - -#battery.charging { - color: #a3be8c; -} - -#battery.critical:not(.charging) { - background: rgba(245, 60, 60, 0.4); - color: #fff; - - border-radius: 15px; - margin: 6px; - - animation-name: blink; - animation-duration: 1s; - animation-timing-function: linear; - animation-iteration-count: infinite; - animation-direction: alternate; -}
diff --git a/configurations/linux/desktop/qt.nix b/configurations/linux/desktop/qt.nix @@ -1,15 +0,0 @@ -{ config, lib, pkgs, home-manager, ... }: - -{ - home-manager.users.leah = { - - home.sessionVariables = { - QT_QPA_PLATFORMTHEME = "gnome"; - }; - - home.packages = with pkgs; [ - pkgs.qgnomeplatform - ]; - - }; -}
diff --git a/configurations/linux/desktop/sdr.nix b/configurations/linux/desktop/sdr.nix @@ -1,26 +0,0 @@ -{ config, pkgs, ... }: - -{ - hardware.rtl-sdr.enable = true; - - users.users.leah.extraGroups = [ "plugdev" ]; - - users.groups.plugdev = {}; - services.udev.extraRules = '' - ATTR{idVendor}=="1d50", ATTR{idProduct}=="604b", SYMLINK+="hackrf-jawbreaker-%k", MODE="660", GROUP="plugdev" - ATTR{idVendor}=="1d50", ATTR{idProduct}=="6089", SYMLINK+="hackrf-one-%k", MODE="660", GROUP="plugdev" - ATTR{idVendor}=="1d50", ATTR{idProduct}=="cc15", SYMLINK+="rad1o-%k", MODE="660", GROUP="plugdev" - ATTR{idVendor}=="1fc9", ATTR{idProduct}=="000c", SYMLINK+="nxp-dfu-%k", MODE="660", GROUP="plugdev" - ''; - - home-manager.users.leah = { - home.packages = with pkgs; [ - hackrf - gqrx - welle-io - multimon-ng - dsd - dump1090 - ]; - }; -}
diff --git a/configurations/linux/desktop/services/easyeffects.nix b/configurations/linux/desktop/services/easyeffects.nix @@ -1,31 +0,0 @@ -{ pkgs, ... }: - -{ - home-manager.users.leah = { - home.packages = with pkgs; [ - easyeffects - ]; - - systemd.user.services.easyeffects = { - 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.easyeffects}/bin/easyeffects --gapplication-service"; - Restart = "always"; - RestartSec = 5; - }; - - Install = { - WantedBy = [ "graphical-session.target" ]; - }; - }; - - wayland.windowManager.sway.extraConfig = '' - exec_always 'systemctl --user restart easyeffects' - ''; - }; -}
diff --git a/configurations/linux/desktop/services/gvfs.nix b/configurations/linux/desktop/services/gvfs.nix @@ -1,16 +0,0 @@ -{ pkgs, ... }: - -{ - services = { - gvfs.enable = true; - gvfs.package = (pkgs.gvfs.overrideAttrs (old: { - mesonFlags = (old.mesonFlags or []) ++ [ - "-Dafp=false" - "-Dgphoto2=false" - ]; - })).override { - gnomeSupport = false; - samba = null; - }; - }; -}
diff --git a/configurations/linux/desktop/services/pipewire.nix b/configurations/linux/desktop/services/pipewire.nix @@ -1,70 +0,0 @@ -{ config, lib, pkgs, ... }: - - -let - serverHosts = [ "lollo" ]; - -in { - imports = [ - ./avahi.nix - ]; - - security.rtkit.enable = true; - networking.firewall = { - extraCommands = (if config.networking.hostName == "stasicontainer" then '' - iptables -A nixos-fw -m iprange --src-range 10.0.0.0-10.0.0.255 -p tcp --dport 4713 -j nixos-fw-accept - iptables -A nixos-fw -m iprange --src-range 195.39.246.32-195.39.246.47 -p tcp --dport 4713 -j nixos-fw-accept - '' else ""); - }; - - services = { - pipewire = { - enable = true; - socketActivation = true; - - alsa.enable = true; - pulse.enable = true; - - config = { - pipewire-pulse = { - "context.exec" = []; - "stream.properties" = {}; - "context.properties" = {}; - "context.spa-libs" = { - "audio.convert.*" = "audioconvert/libspa-audioconvert"; - "support.*" = "support/libspa-support"; - }; - "context.modules" = [ - { - name = "libpipewire-module-rtkit"; - args = {}; - flags = [ "ifexists" "nofail" ]; - } - { name = "libpipewire-module-protocol-native"; } - { name = "libpipewire-module-client-node"; } - { name = "libpipewire-module-adapter"; } - { name = "libpipewire-module-metadata"; } - { - name = "libpipewire-module-protocol-pulse"; - args = { - "server.address" = ( - if builtins.elem config.networking.hostName serverHosts then [ - "unix:native" - "tcp:4713" - ] else [ - "unix:native" - ] - ); - "vm.overrides" = { - "pulse.min.quantum" = "1024/48000"; - }; - }; - } - { name = "libpipewire-module-zeroconf-discover"; } - ]; - }; - }; - }; - }; - -}
diff --git a/configurations/linux/desktop/services/spotifyd.nix b/configurations/linux/desktop/services/spotifyd.nix @@ -1,43 +0,0 @@ -{ inputs, config, pkgs, ... }: - -{ - - networking.firewall.allowedUDPPorts = [ 57621 ]; - networking.firewall.allowedTCPPorts = [ 33903 57621 ]; - - age.secrets = { - spotify-username = { - file = ../../secrets/spotify/username.age; - owner = "leah"; - }; - spotify-password = { - file = ../../secrets/spotify/password.age; - owner = "leah"; - }; - }; - - home-manager.users.leah = { - services.spotifyd = { - enable = true; -# package = inputs.nixpkgsUnstable.spotifyd; - settings = { - global = { - username_cmd = "${pkgs.coreutils}/bin/cat ${config.age.secrets.spotify-username.path}"; - password_cmd = "${pkgs.coreutils}/bin/cat ${config.age.secrets.spotify-password.path}"; - - use_mpris = true; - backend = "pulseaudio"; - bitrate = 320; - cache_path = "/home/leah/.cache/spotifyd"; - initial_volume = "80"; - zeroconf_port = 33903; - device_type = "speaker"; - }; - }; - }; - - wayland.windowManager.sway.extraConfig = '' - exec_always 'systemctl --user restart spotifyd' - ''; - }; -}
diff --git a/configurations/linux/desktop/sway.nix b/configurations/linux/desktop/sway.nix @@ -1,86 +0,0 @@ -{ config, lib, pkgs, home-manager, ... }: - -{ - - nixpkgs.config.allowUnfree = true; - environment.noXlibs = false; - - hardware = { - opengl = { - enable = true; - driSupport = true; - extraPackages = with pkgs; [ - vaapiIntel - vaapiVdpau - libvdpau-va-gl - intel-media-driver - ]; - }; - - trackpoint = { - enable = true; - device = "TPPS/2 JYT_Synaptics TrackPoint"; - emulateWheel = true; - speed = 85; - sensitivity = 80; - }; - }; - - programs = { - dconf.enable = true; - }; - - services = { - nscd.enable = true; - getty.autologinUser = "leah"; - }; - - users.users.leah.extraGroups = [ "dialout" ]; - - home-manager.users.leah = { - manual.html.enable = true; - }; - - imports = [ - ./fonts.nix - ./gtk.nix - ./qt.nix - ./xdg.nix - - ./programs/systemd-lock-handler.nix - - ../common/programs/gpg.nix - ../common/programs/password-store.nix - ../common/programs/ansible.nix - ../common/programs/texlive.nix - - ./services/pipewire.nix - ./services/easyeffects.nix - ./services/usbmuxd.nix - - ./programs/sway.nix - - ./programs/swaylock.nix - ./programs/gammastep.nix - ./programs/waybar - ./programs/mako.nix - - ./programs/alacritty.nix - - ./programs/firefox.nix - ./programs/thunderbird.nix - - ./programs/mpv.nix - ./programs/imv.nix - - ./programs/sublime-text3.nix - ./programs/libreoffice.nix - ./programs/gimp - - ./programs/thunar.nix - ./programs/utilities.nix - - ./services/syncthing.nix - ]; - -}
diff --git a/configurations/linux/desktop/xdg-portal.nix b/configurations/linux/desktop/xdg-portal.nix @@ -1,14 +0,0 @@ -{ config, lib, pkgs, home-manager, ... }: - -{ - - xdg = { - portal = { - enable = true; - extraPortals = with pkgs; [ - xdg-desktop-portal-wlr - ]; - }; - }; - -}
diff --git a/configurations/linux/fonts.nix b/configurations/linux/fonts.nix @@ -0,0 +1,31 @@ +{ config, pkgs, lib, ... }: + +let + cfg = config.ctucxConfig.configure.fonts; + +in { + + options = { + ctucxConfig.configure.fonts = lib.mkEnableOption "fonts"; + }; + + config = lib.mkIf cfg { + fonts = { + fontconfig.enable = true; + fontDir.enable = true; + enableGhostscriptFonts = true; + enableDefaultPackages = true; + packages = with pkgs; [ + dejavu_fonts + liberation_ttf + ttf_bitstream_vera + noto-fonts + noto-fonts-emoji + font-awesome + fira-code + fira-mono + ]; + }; + }; + +}
diff --git a/configurations/linux/gtk.nix b/configurations/linux/gtk.nix @@ -0,0 +1,32 @@ +{ config, lib, pkgs, home-manager, ... }: + +{ + + services.dbus.packages = with pkgs; [ dconf ]; + home-manager.users.leah = { + + gtk = { + enable = true; + + iconTheme = { + name = "Adwaita"; + package = pkgs.gnome3.adwaita-icon-theme; + }; + + font = { + name = "Dejavu Sans"; + package = pkgs.dejavu_fonts; + }; + + gtk3 = { + #bookmarks + extraConfig = { + gtk-application-prefer-dark-theme = true; + gtk-recent-files-limit = 10; + }; + }; + }; + + }; + +}
diff --git a/configurations/linux/mobile-device.nix b/configurations/linux/mobile-device.nix @@ -0,0 +1,54 @@ +{ config, pkgs, lib, ... }: + +let + cfg = config.ctucxConfig.configure.mobileDevice; + +in { + + options = { + ctucxConfig.configure.mobileDevice = lib.mkEnableOption "mobile device"; + }; + + config = lib.mkIf cfg { + powerManagement = { + enable = true; + cpuFreqGovernor = lib.mkDefault "powersave"; + }; + + services = { + upower.enable = true; + # throttled.enable = true; + + logind.lidSwitch = "lock"; + logind.extraConfig = "HandlePowerKey=suspend"; + + tlp = { + enable = true; + settings = { + CPU_SCALING_GOVERNOR_ON_AC = "performance"; + CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; + + START_CHARGE_THRESH_BAT0 = 95; + STOP_CHARGE_THRESH_BAT0 = 100; + + + CPU_SCALING_MIN_FREQ_ON_AC = 800000; + CPU_SCALING_MAX_FREQ_ON_AC = 3000000; + CPU_SCALING_MIN_FREQ_ON_BAT = 800000; + CPU_SCALING_MAX_FREQ_ON_BAT = 2000000; + + SOUND_POWER_SAVE_ON_AC = 0; + SOUND_POWER_SAVE_ON_BAT = 1; + + RUNTIME_PM_ON_AC = "on"; + RUNTIME_PM_ON_BAT = "auto"; + + NATACPI_ENABLE = 1; + TPACPI_ENABLE = 1; + TPSMAPI_ENABLE = 1; + }; + }; + }; + }; + +}
diff --git a/configurations/linux/programs/alacritty.nix b/configurations/linux/programs/alacritty.nix @@ -0,0 +1,74 @@ +{ config, pkgs, lib, ... }: + +let + cfg = config.ctucxConfig.programs.alacritty; + +in { + + options = { + ctucxConfig.programs.alacritty = { + enable = lib.mkEnableOption "alacritty terminal emulator"; + }; + }; + + config = lib.mkIf cfg.enable { + home-manager.users.leah = { + home = { + sessionVariables = { + TERMINAL = "alacritty"; + }; + }; + + programs = { + alacritty = { + enable = true; + settings = { + window.opacity = 0.9; + + font.normal = { + family = "DejaVu Sans Mono"; + size = 9.0; + }; + + colors = { + primary = { + background = "0x000000"; + foreground = "0xeaeaea"; + }; + + normal = { + black = "0x6c6c6c"; + red = "0xe9897c"; + green = "0xb6e77d"; + yellow = "0xecebbe"; + blue = "0xa9cdeb"; + magenta = "0xea96eb"; + cyan = "0xc9caec"; + white = "0xf2f2f2"; + }; + + bright = { + black = "0x747474"; + red = "0xf99286"; + green = "0xc3f786"; + yellow = "0xfcfbcc"; + blue = "0xb6defb"; + magenta = "0xfba1fb"; + cyan = "0xd7d9fc"; + white = "0xe2e2e2"; + }; + }; + }; + }; + }; + + wayland.windowManager.sway = { + config.terminal = "${pkgs.alacritty}/bin/alacritty"; + extraConfig = '' + exec swaymsg 'workspace 3: Term; exec ${pkgs.alacritty}/bin/alacritty; exec ${pkgs.alacritty}/bin/alacritty; workspace 1: Web;' + ''; + }; + }; + }; + +}
diff --git a/configurations/linux/programs/ausweisapp.nix b/configurations/linux/programs/ausweisapp.nix @@ -0,0 +1,21 @@ +{ config, pkgs, lib, ... }: + +let + cfg = config.ctucxConfig.programs.ausweisapp; + +in { + + options = { + ctucxConfig.programs.ausweisapp = { + enable = lib.mkEnableOption "ausweisapp"; + }; + }; + + config = lib.mkIf cfg.enable { + home-manager.users.leah = { + home.packages = with pkgs; [ + AusweisApp2 + ]; + }; + }; +}
diff --git a/configurations/linux/programs/ddcutil.nix b/configurations/linux/programs/ddcutil.nix @@ -0,0 +1,32 @@ +{ config, pkgs, lib, ... }: + +let + cfg = config.ctucxConfig.programs.ddcutil; + +in { + + options = { + ctucxConfig.programs.ddcutil = { + enable = lib.mkEnableOption "ddcutil"; + }; + }; + + config = lib.mkIf cfg.enable { + boot.kernelModules = [ "i2c-dev" ]; + + security.sudo.extraRules= [ + { users = [ "leah" ]; + commands = [ + { command = "${pkgs.ddcutil}/bin/ddcutil" ; + options= [ "NOPASSWD" ]; + } + ]; + } + ]; + + home-manager.users.leah = { + home.packages = [ pkgs.ddcutil ]; + }; + }; + +}
diff --git a/configurations/linux/programs/default.nix b/configurations/linux/programs/default.nix @@ -0,0 +1,23 @@ +{ ... }: + +{ + + imports = [ + ./sway.nix + ./gnome.nix + + ./alacritty.nix + + ./ddcutil.nix + + ./firefox.nix + ./thunderbird.nix + ./libreoffice.nix + ./ausweisapp.nix + + ./thunar.nix + ./mpv.nix + ./imv.nix + ]; + +}+ \ No newline at end of file
diff --git a/configurations/linux/programs/firefox.nix b/configurations/linux/programs/firefox.nix @@ -0,0 +1,85 @@ +{ config, pkgs, lib, ... }: + +let + cfg = config.ctucxConfig.programs.firefox; + 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 { + + options = { + ctucxConfig.programs.firefox = { + enable = lib.mkEnableOption "firefox web browser"; + }; + }; + + config = lib.mkIf cfg.enable { + 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.config.startup = [ + { command = "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/gnome.nix b/configurations/linux/programs/gnome.nix @@ -0,0 +1,65 @@ +{ config, pkgs, lib, ... }: + +let + cfg = config.ctucxConfig.wm.gnome; + +in { + + options = { + ctucxConfig.wm.gnome = { + enable = lib.mkEnableOption "gnome"; + }; + }; + + config = lib.mkIf cfg.enable { + services.xserver.enable = true; + services.xserver.displayManager.gdm.enable = true; + services.xserver.desktopManager.gnome.enable = true; + + services.xserver.excludePackages = with pkgs; [ + xterm + ]; + + services.gnome = { + tracker-miners.enable = false; + tracker.enable = false; + evolution-data-server.enable = lib.mkForce false; + }; + + environment.gnome.excludePackages = with pkgs.gnome; [ + pkgs.gnome-connections + pkgs.gnome-console + pkgs.gnome-text-editor + pkgs.gnome-tour + pkgs.gnome-photos + pkgs.evince + pkgs.snapshot + pkgs.loupe + gnome-calendar + gnome-clocks + gnome-contacts + gnome-font-viewer + gnome-logs + gnome-maps + gnome-music + gnome-disk-utility + gnome-weather + baobab + epiphany + file-roller + cheese + simple-scan + seahorse + yelp + geary + totem + ]; + + environment.systemPackages = with pkgs.gnome; [ + gnome-terminal + gnome-tweaks + ]; + + }; + +}+ \ No newline at end of file
diff --git a/configurations/linux/programs/imv.nix b/configurations/linux/programs/imv.nix @@ -0,0 +1,31 @@ +{ config, pkgs, lib, ... }: + +let + cfg = config.ctucxConfig.programs.imv; + +in { + + options = { + ctucxConfig.programs.imv = { + enable = lib.mkEnableOption "imv image viewer"; + }; + }; + + config = lib.mkIf cfg.enable { + home-manager.users.leah = { + home.packages = [ pkgs.imv ]; + + xdg = { + desktopEntries = { + imv-folder = { + name = "imv (Folder)"; + settings = { + NoDisplay = "true"; + }; + }; + }; + }; + }; + }; + +}
diff --git a/configurations/linux/programs/libreoffice.nix b/configurations/linux/programs/libreoffice.nix @@ -0,0 +1,54 @@ +{ config, pkgs, lib, ... }: + +let + cfg = config.ctucxConfig.programs.libreoffice; + +in { + + options = { + ctucxConfig.programs.libreoffice = { + enable = lib.mkEnableOption "libreoffice office suite"; + }; + }; + + config = lib.mkIf cfg.enable { + home-manager.users.leah = { + home = { + packages = [ pkgs.libreoffice-fresh ]; + }; + + xdg = { + desktopEntries = { + impress = { + name = "LibreOffice Impress"; + settings = { + NoDisplay = "true"; + }; + }; + + math = { + name = "LibreOffice Math"; + settings = { + NoDisplay = "true"; + }; + }; + + base = { + name = "LibreOffice Base"; + settings = { + NoDisplay = "true"; + }; + }; + + draw = { + name = "LibreOffice Draw"; + settings = { + NoDisplay = "true"; + }; + }; + }; + }; + }; + }; + +}
diff --git a/configurations/linux/programs/mpv.nix b/configurations/linux/programs/mpv.nix @@ -0,0 +1,59 @@ +{ config, pkgs, lib, ... }: + +let + cfg = config.ctucxConfig.programs.mpv; + +in { + + options = { + ctucxConfig.programs.mpv = { + enable = lib.mkEnableOption "mpv media player"; + }; + }; + + config = lib.mkIf cfg.enable { + home-manager.users.leah = { + programs = { + mpv = { + enable = true; + scripts = [ + pkgs.mpvScripts.mpris + ]; + }; + }; + + xdg = { + desktopEntries = { + mpv = { + name = "mpv Media Player"; + genericName = "Multimedia player"; + icon = "mpv"; + exec = "mpv --player-operation-mode=pseudo-gui -- %U"; + terminal = false; + mimeType = [ "application/ogg" "application/x-ogg" "application/mxf" "application/sdp" "application/smil" "application/x-smil" "application/streamingmedia" "application/x-streamingmedia" + "application/vnd.rn-realmedia" "application/vnd.rn-realmedia-vbr" "audio/aac" "audio/x-aac" "audio/vnd.dolby.heaac.1" "audio/vnd.dolby.heaac.2" "audio/aiff" "audio/x-aiff" + "audio/m4a" "audio/x-m4a" "application/x-extension-m4a" "audio/mp1" "audio/x-mp1" "audio/mp2" "audio/x-mp2" "audio/mp3" "audio/x-mp3" "audio/mpeg" "audio/mpeg2" "audio/mpeg3" + "audio/mpegurl" "audio/x-mpegurl" "audio/mpg" "audio/x-mpg" "audio/rn-mpeg" "audio/musepack" "audio/x-musepack" "audio/ogg" "audio/scpls" "audio/x-scpls" "audio/vnd.rn-realaudio" + "audio/wav" "audio/x-pn-wav" "audio/x-pn-windows-pcm" "audio/x-realaudio" "audio/x-pn-realaudio" "audio/x-ms-wma" "audio/x-pls" "audio/x-wav" "video/mpeg" "video/x-mpeg2" + "video/x-mpeg3" "video/mp4v-es" "video/x-m4v" "video/mp4" "application/x-extension-mp4" "video/divx" "video/vnd.divx" "video/msvideo" "video/x-msvideo" "video/ogg" "video/quicktime" + "video/vnd.rn-realvideo" "video/x-ms-afs" "video/x-ms-asf" "audio/x-ms-asf" "application/vnd.ms-asf" "video/x-ms-wmv" "video/x-ms-wmx" "video/x-ms-wvxvideo" "video/x-avi" + "video/avi" "video/x-flic" "video/fli" "video/x-flc" "video/flv" "video/x-flv" "video/x-theora" "video/x-theora+ogg" "video/x-matroska" "video/mkv" "audio/x-matroska" + "application/x-matroska" "video/webm" "audio/webm" "audio/vorbis" "audio/x-vorbis" "audio/x-vorbis+ogg" "video/x-ogm" "video/x-ogm+ogg" "application/x-ogm" "application/x-ogm-audio" + "application/x-ogm-video" "application/x-shorten" "audio/x-shorten" "audio/x-ape" "audio/x-wavpack" "audio/x-tta" "audio/AMR" "audio/ac3" "audio/eac3" "audio/amr-wb" + "video/mp2t" "audio/flac" "audio/mp4" "application/x-mpegurl" "video/vnd.mpegurl" "application/vnd.apple.mpegurl" "audio/x-pn-au" "video/3gp" "video/3gpp" "video/3gpp2" + "audio/3gpp" "audio/3gpp2" "video/dv" "audio/dv" "audio/opus" "audio/vnd.dts" "audio/vnd.dts.hd" "audio/x-adpcm" "application/x-cue" "audio/m3u" ]; + categories = [ "AudioVideo" "Audio" "Video" "Player" "TV" ]; + }; + + umpv = { + name = "umpv Media Player"; + settings = { + NoDisplay = "true"; + }; + }; + }; + }; + }; + }; + +}
diff --git a/configurations/linux/programs/sway.nix b/configurations/linux/programs/sway.nix @@ -0,0 +1,253 @@ +{ config, pkgs, lib, ... }: + +let + cfg = config.ctucxConfig.wm.sway; + +in { + + options = { + ctucxConfig.wm.sway = { + enable = lib.mkEnableOption "swaywm"; + }; + }; + + config = lib.mkIf cfg.enable { + nixpkgs.overlays = [(self: super: { + + wlroots = super.wlroots.overrideAttrs (old: { + mesonFlags = (old.mesonFlags or []) ++ [ + "-Dxwayland=disabled" + ]; + }); + + sway-unwrapped = super.sway-unwrapped.overrideAttrs (old: { + mesonFlags = (old.mesonFlags or []) ++ [ + "-Dxwayland=disabled" + ]; + }); + + xsel = self.wl-clipboard-x11; + xclip = self.wl-clipboard-x11; + + })]; + + + + xdg.portal = { + config.common.default = [ "wlr" ]; + wlr.enable = true; + }; + + home-manager.users.leah = { + + home.packages = with pkgs; [ + qt5.qtwayland wl-clipboard + ]; + + programs.bash.initExtra = '' + if [ "$(tty)" = "/dev/tty1" ]; then + exec sway + fi + ''; + + wayland.windowManager.sway = let + cfg = config.home-manager.users.leah.wayland.windowManager.sway; + modifier = cfg.config.modifier; + + in { + enable = true; + systemd.enable = true; + + xwayland = false; + wrapperFeatures.gtk = true; + + extraSessionCommands = '' + export QT_QPA_PLATFORM=wayland + export QT_WAYLAND_FORCE_DPI=physical + export QT_WAYLAND_DISABLE_WINDOWDECORATION=1 + + export _JAVA_AWT_WM_NONREPARENTING=1 + + # be careful with those, they *will* break some applications + export SDL_VIDEODRIVER=wayland + export GDK_BACKEND=wayland + ''; + + extraConfig = '' + # Import the most important environment variables into the D-Bus and systemd + # user environments (e.g. required for screen sharing and Pinentry prompts): + exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP + ''; + + config = { + fonts = { + names = [ "Noto Sans Mono" "FontAwesome5Free" ]; + style = ""; + size = 11.0; + }; + + colors = { + focused = { + background = "#3b8756"; + border = "#3b8756"; + childBorder = "#3b8756"; + text = "#eceff4"; + indicator = "#8fbcbb"; + }; + }; + + window = { + titlebar = false; + hideEdgeBorders = "smart"; + border = 5; + }; + + input = { + + "*" = { + xkb_layout = "us,ru,de"; + xkb_variant = "mac,mac,qwerty"; + xkb_options = "grp:alt_shift_toggle"; + natural_scroll = "enabled"; + }; + + "1046:9110:Goodix_Capacitive_TouchScreen" = { + map_to_output = "DSI-1"; + }; + + "1452:613:Apple_Inc._Magic_Trackpad_2" = { + accel_profile = "adaptive"; + }; + + }; + + output = { + + "DSI-1" = { + transform = "90"; + scale = "1.2"; + }; + + "*" = { + bg = "~/Pictures/photos.ctu.cx/Bahnbilder/2019.06/20190622-153441.jpg fill"; + scale = lib.mkDefault "1"; + }; + + }; + + assigns = { + "1: Web" = [{ app_id = "firefox"; }]; + "2: Mail" = [{ app_id = "thunderbird"; }]; + }; + + bars = []; + + modifier = "Mod4"; + + workspaceAutoBackAndForth = true; + + keybindings = { + "${modifier}+Return" = "exec ${cfg.config.terminal}"; + "${modifier}+Space" = "exec ${pkgs.wofi}/bin/wofi --style ${./wofi/style.css} --conf ${./wofi/config} --show drun"; + "${modifier}+l" = "exec ${pkgs.systemd}/bin/loginctl lock-session"; + "${modifier}+z" = "exec sleep 1 && systemctl suspend"; + "${modifier}+Tab" = "exec ${pkgs.rofi-wayland}/bin/rofi -show wifi -modi 'wifi:${pkgs.rofi-iwd-wifi-menu}/bin/iwdrofimenu'"; + + + "Shift+Print" = "exec ${pkgs.grim}/bin/grim ~/Pictures/Screenshots/$(date +\"%Y-%m-%d_%H:%m:%S\").png"; + "${modifier}+Shift+Print" = "exec ${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp)\" ~/Pictures/Screenshots/$(date +\"%Y-%m-%d_%H:%m:%S\").png"; + "Print" = "exec ${pkgs.grim}/bin/grim - | ${pkgs.wl-clipboard}/bin/wl-copy -t image/png"; + "${modifier}+Print" = "exec ${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp)\" - | ${pkgs.wl-clipboard}/bin/wl-copy -t image/png"; + + "XF86MonBrightnessUp" = "exec ${pkgs.brightnessctl}/bin/brightnessctl s +5%"; + "XF86MonBrightnessDown" = "exec ${pkgs.brightnessctl}/bin/brightnessctl s 5%-"; + + "XF86AudioRaiseVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%"; + "XF86AudioLowerVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -5%"; + "XF86AudioMute" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-mute @DEFAULT_SINK@ toggle"; + "XF86AudioMicMute" = "exec ${pkgs.pulseaudio}/bin/pactl set-source-mute @DEFAULT_SOURCE@ toggle"; + + "XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause"; + "XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl next"; + "XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl previous"; + + "${modifier}+Shift+e" = "exec swaynag -t warning -m 'Do you really want to exit sway?' -b 'Yep' 'swaymsg exit'"; + + "${modifier}+Shift+q" = "kill"; + "Alt+F4" = "kill"; + + "${modifier}+Shift+c" = "reload"; + + "${modifier}+Left" = "focus left"; + "${modifier}+Down" = "focus down"; + "${modifier}+Up" = "focus up"; + "${modifier}+Right" = "focus right"; + "${modifier}+a" = "focus parent"; + + + "${modifier}+Shift+Left" = "move left"; + "${modifier}+Shift+Down" = "move down"; + "${modifier}+Shift+Up" = "move up"; + "${modifier}+Shift+Right" = "move right"; + + "${modifier}+1" = "workspace 1: Web"; + "${modifier}+2" = "workspace 2: Mail"; + "${modifier}+3" = "workspace 3: Term; layout tabbed"; + "${modifier}+4" = "workspace 4: Files"; + "${modifier}+5" = "workspace number 5"; + "${modifier}+6" = "workspace number 6"; + "${modifier}+7" = "workspace number 7"; + "${modifier}+8" = "workspace number 8"; + "${modifier}+9" = "workspace number 9"; + "${modifier}+0" = "workspace number 10"; + + "${modifier}+Shift+1" = "move container to workspace 1: Web"; + "${modifier}+Shift+2" = "move container to workspace 2: Mail"; + "${modifier}+Shift+3" = "move container to workspace 3: Term"; + "${modifier}+Shift+4" = "move container to workspace 4: Files"; + "${modifier}+Shift+5" = "move container to workspace number 5"; + "${modifier}+Shift+6" = "move container to workspace number 6"; + "${modifier}+Shift+7" = "move container to workspace number 7"; + "${modifier}+Shift+8" = "move container to workspace number 8"; + "${modifier}+Shift+9" = "move container to workspace number 9"; + "${modifier}+Shift+0" = "move container to workspace number 10"; + + "${modifier}+s" = "layout stacking"; + "${modifier}+w" = "layout tabbed"; + "${modifier}+e" = "layout toggle split"; + + "${modifier}+f" = "fullscreen"; + + "${modifier}+r" = "mode \"resize\""; + "${modifier}+b" = "mode \"waybar\""; + + "${modifier}+Shift+space" = "floating toggle"; + }; + + modes = { + "resize" = { + "Right" = "resize shrink width 10px"; + "Left" = "resize grow width 10px"; + "Down" = "resize shrink height 10px"; + "Up" = "resize grow height 10px"; + + "Return" = "mode \"default\""; + "Escape" = "mode \"default\""; + "${modifier}+r" = "mode \"default\""; + }; + + "waybar" = { + "space" = "exec pkill -SIGUSR1 waybar"; + "r" = "exec pkill -SIGUSR2 waybar"; + + "Return" = "mode \"default\""; + "Escape" = "mode \"default\""; + "${modifier}+r" = "mode \"default\""; + }; + }; + }; + }; + }; + }; + +}
diff --git a/configurations/linux/programs/thunar.nix b/configurations/linux/programs/thunar.nix @@ -0,0 +1,50 @@ +{ config, pkgs, lib, ... }: + +let + cfg = config.ctucxConfig.programs.thunar; + +in { + + options = { + ctucxConfig.programs.thunar = { + enable = lib.mkEnableOption "thunar file manager"; + }; + }; + + config = lib.mkIf cfg.enable { + ctucxConfig.services.gvfs.enable = true; + + services = { + tumbler.enable = true; + }; + + home-manager.users.leah = { + home.packages = with pkgs; [ + xfce.thunar + ]; + + xdg = { + desktopEntries = { + thunar-bulk-rename = { + name = "Bulk Rename"; + settings = { + NoDisplay = "true"; + }; + }; + + thunar-settings = { + name = "Thunar settings"; + settings = { + NoDisplay = "true"; + }; + }; + }; + }; + + wayland.windowManager.sway.extraConfig = '' + exec swaymsg 'workspace 4: Files; exec thunar; workspace 1: Web;' + ''; + }; + }; + +}
diff --git a/configurations/linux/programs/thunderbird.nix b/configurations/linux/programs/thunderbird.nix @@ -0,0 +1,60 @@ +{ config, pkgs, lib, ... }: + +let + cfg = config.ctucxConfig.programs.thunderbird; + +in { + + options = { + ctucxConfig.programs.thunderbird = { + enable = lib.mkEnableOption "thunderbird mail "; + }; + }; + + config = lib.mkIf cfg.enable { + 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.config.startup = [ + { always = true; command = "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/qt.nix b/configurations/linux/qt.nix @@ -0,0 +1,17 @@ +{ config, lib, pkgs, home-manager, ... }: + +{ + + home-manager.users.leah = { + + home.sessionVariables = { + QT_QPA_PLATFORMTHEME = "gnome"; + }; + + home.packages = with pkgs; [ + pkgs.qgnomeplatform + ]; + + }; + +}
diff --git a/configurations/linux/services/default.nix b/configurations/linux/services/default.nix @@ -8,10 +8,21 @@ ./dns.nix ./syncthing.nix ./syncthing-nginx.nix + + ./systemd-lock-handler.nix + + ./swaylock.nix + ./waybar.nix + ./mako.nix + ./wlsunset.nix + + ./pipewire.nix + ./easyeffects.nix + ./gvfs.nix ]; - ctucxConfig.monitoring.exporters.enable = (lib.mkDefault (if (config.networking.primaryIP != "") || (config.networing.primaryIP4 != "") then true else false)); - ctucxConfig.dnsServer.enable = (lib.mkDefault (builtins.elem "dnsServer" config.deployment.tags)); - ctucxConfig.resticServer.enable = (lib.mkDefault (builtins.elem "resticServer" config.deployment.tags)); + ctucxConfig.monitoring.exporters.enable = (lib.mkDefault (if (config.networking.primaryIP != "") || (config.networking.primaryIP4 != "") then true else false)); + ctucxConfig.services.dnsServer.enable = (lib.mkDefault (builtins.elem "dnsServer" config.deployment.tags)); + ctucxConfig.services.resticServer.enable = (lib.mkDefault (builtins.elem "resticServer" config.deployment.tags)); } \ No newline at end of file
diff --git a/configurations/linux/services/dns.nix b/configurations/linux/services/dns.nix @@ -1,12 +1,12 @@ { nodes, config, lib, pkgs, ...}: let - cfg = config.ctucxConfig.dnsServer; + cfg = config.ctucxConfig.services.dnsServer; in { options = { - ctucxConfig.dnsServer = { + ctucxConfig.services.dnsServer = { enable = lib.mkEnableOption "dns"; }; };
diff --git a/configurations/linux/services/easyeffects.nix b/configurations/linux/services/easyeffects.nix @@ -0,0 +1,44 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.ctucxConfig.services.easyeffects; + +in { + + options = { + ctucxConfig.services.easyeffects = { + enable = lib.mkEnableOption "easyeffects"; + }; + }; + + config = lib.mkIf cfg.enable { + home-manager.users.leah = { + home.packages = with pkgs; [ + easyeffects + ]; + + systemd.user.services.easyeffects = { + 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.easyeffects}/bin/easyeffects --gapplication-service"; + Restart = "always"; + RestartSec = 5; + }; + + Install = { + WantedBy = [ "graphical-session.target" ]; + }; + }; + + wayland.windowManager.sway.config.startup = [ + { always = true; command = "systemctl --user restart easyeffects"; } + ]; + }; + }; + +}
diff --git a/configurations/linux/services/gvfs.nix b/configurations/linux/services/gvfs.nix @@ -0,0 +1,29 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.ctucxConfig.services.gvfs; + +in { + + options = { + ctucxConfig.services.gvfs = { + enable = lib.mkEnableOption "gvfs"; + }; + }; + + config = lib.mkIf cfg.enable { + services = { + gvfs.enable = true; + gvfs.package = (pkgs.gvfs.overrideAttrs (old: { + mesonFlags = (old.mesonFlags or []) ++ [ + "-Dafp=false" + "-Dgphoto2=false" + ]; + })).override { + gnomeSupport = false; + samba = null; + }; + }; + }; + +}
diff --git a/configurations/linux/services/mako.nix b/configurations/linux/services/mako.nix @@ -0,0 +1,54 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.ctucxConfig.services.mako; + +in { + + options = { + ctucxConfig.services.mako = { + enable = lib.mkEnableOption "mako notification deamon"; + }; + }; + + config = lib.mkIf cfg.enable { + home-manager.users.leah = { + services.mako = { + enable = true; + + defaultTimeout = 20000; + + borderColor = "#002028"; + borderSize = 2; + + backgroundColor = "#002b36AA"; + + textColor = "#fdf6e3"; + font = "Fira Code 11"; + format = "<b>%s</b> <span color=\"#93a1a1\">(%a)</span>\\n%b"; + }; + + systemd.user.services.mako = { + Unit = { + After = [ "graphical-session-pre.target" ]; + PartOf = [ "graphical-session.target" ]; + }; + + Service = { + ExecStart = "${pkgs.mako}/bin/mako"; + Restart = "always"; + RestartSec = 5; + }; + + Install = { + WantedBy = [ "graphical-session.target" ]; + }; + }; + + wayland.windowManager.sway.config.startup = [ + { always = true; command = "systemctl --user restart mako"; } + ]; + }; + }; + +}+ \ No newline at end of file
diff --git a/configurations/linux/services/pipewire.nix b/configurations/linux/services/pipewire.nix @@ -0,0 +1,33 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.ctucxConfig.services.pipewire; + +in { + + options = { + ctucxConfig.services.pipewire = { + enable = lib.mkEnableOption "pipewire sound server"; + }; + }; + + config = lib.mkIf cfg.enable { + + security.rtkit.enable = true; + + services = { + pipewire = { + enable = true; + socketActivation = true; + + alsa.enable = true; + pulse.enable = true; + }; + }; + + home-manager.users.leah.home.packages = lib.mkIf config.ctucxConfig.wm.sway.enable [ + pkgs.pavucontrol + ]; + }; + +}
diff --git a/configurations/linux/services/prometheus-exporters.nix b/configurations/linux/services/prometheus-exporters.nix @@ -42,9 +42,9 @@ in { nginx = { enable = true; virtualHosts."${config.networking.fqdn}" = { - enableACME = lib.mkDefault true; - forceSSL = lib.mkDefault true; - kTLS = lib.mkDefault true; + enableACME = (lib.mkDefault (if (config.networking.primaryIP != "") || (config.networking.primaryIP4 != "") then true else false)); + forceSSL = (lib.mkDefault (if (config.networking.primaryIP != "") || (config.networking.primaryIP4 != "") then true else false)); + kTLS = (lib.mkDefault (if (config.networking.primaryIP != "") || (config.networking.primaryIP4 != "") then true else false)); locations."/node-exporter".proxyPass = "http://${toString config.services.prometheus.exporters.node.listenAddress}:${toString config.services.prometheus.exporters.node.port}/metrics"; locations."/systemd-exporter".proxyPass = "http://${toString config.services.prometheus.exporters.systemd.listenAddress}:${toString config.services.prometheus.exporters.systemd.port}/metrics"; locations."/scaphandre-exporter".proxyPass = lib.mkIf config.services.prometheus.exporters.scaphandre.enable "http://[::1]:${toString config.services.prometheus.exporters.scaphandre.port}/scaphandre-exporter";
diff --git a/configurations/linux/services/restic-server.nix b/configurations/linux/services/restic-server.nix @@ -1,12 +1,12 @@ { config, lib, pkgs, ...}: let - cfg = config.ctucxConfig.resticServer; + cfg = config.ctucxConfig.services.resticServer; in { options = { - ctucxConfig.resticServer = { + ctucxConfig.services.resticServer = { enable = lib.mkEnableOption "restic server"; }; };
diff --git a/configurations/linux/services/swaylock.nix b/configurations/linux/services/swaylock.nix @@ -0,0 +1,40 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.ctucxConfig.services.swaylock; + +in { + + options = { + ctucxConfig.services.swaylock = { + enable = lib.mkEnableOption "swaybar screenlock"; + }; + }; + + config = lib.mkIf cfg.enable { + + ctucxConfig.services.systemd-lock-handler.enable = true; + + security.pam.services.swaylock = {}; + + home-manager.users.leah.systemd.user.services = { + swaylock = { + Unit = { + Requisite = [ "graphical-session.target" ]; + PartOf = [ "lock.target" "sleep.target" ]; + }; + + Service = { + ExecStart = "${pkgs.swaylock}/bin/swaylock -i /home/leah/Pictures/Backgrounds/lock.png"; + ExecStopPost = "${pkgs.systemd}/bin/loginctl unlock-session"; + }; + + Install = { + WantedBy = [ "lock.target" "sleep.target" ]; + }; + }; + }; + + }; + +}
diff --git a/configurations/linux/services/syncthing-nginx.nix b/configurations/linux/services/syncthing-nginx.nix @@ -1,17 +1,17 @@ { config, lib, pkgs, ... }: let - cfg = config.ctucxConfig.syncthingWithNginx; + cfg = config.ctucxConfig.services.syncthingWithNginx; in { options = { - ctucxConfig.syncthingWithNginx = { + ctucxConfig.services.syncthingWithNginx = { enable = lib.mkEnableOption "syncthing with nginx reverse-proxy"; }; }; config = lib.mkIf cfg.enable { - ctucxConfig.syncthing.enable = true; + ctucxConfig.services.syncthing.enable = true; dns.zones."ctu.cx".subdomains."syncthing.${config.networking.hostName}".CNAME = [ "${config.networking.fqdn}." ];
diff --git a/configurations/linux/services/syncthing.nix b/configurations/linux/services/syncthing.nix @@ -1,12 +1,12 @@ { inputs, config, pkgs, lib, ... }: let - cfg = config.ctucxConfig.syncthing; + cfg = config.ctucxConfig.services.syncthing; syncthingConfig = import ../../common/syncthing-config.nix { inherit inputs pkgs config lib; }; in { options = { - ctucxConfig.syncthing = { + ctucxConfig.services.syncthing = { enable = lib.mkEnableOption "syncthing"; }; };
diff --git a/configurations/linux/services/systemd-lock-handler.nix b/configurations/linux/services/systemd-lock-handler.nix @@ -0,0 +1,69 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.ctucxConfig.services.systemd-lock-handler; + systemd-lock-handler = pkgs.buildGoModule rec { + name = "systemd-lock-handler"; + src = pkgs.fetchFromSourcehut { + owner = "~whynothugo"; + repo = "systemd-lock-handler"; + rev = "cb3f544ef4f2730a27adcfebe0df7556dfeb01bd"; + sha256 = "sha256-sTVAabwWtyvHuDp/+8FKNbfej1x/egoa9z1jLIMJuBg="; + }; + + vendorHash = "sha256-dWzojV3tDA5lLdpAQNC9NaADGyvV7dNOS3x8mfgNNtA="; + }; + +in { + + options = { + ctucxConfig.services.systemd-lock-handler = { + enable = lib.mkEnableOption "waybar"; + }; + }; + + config = lib.mkIf cfg.enable { + + home-manager.users.leah.systemd.user = { + services.systemd-lock-handler = { + Unit = { + Description = "Logind lock event to systemd target translation"; + Documentation = [ "https://sr.ht/~whynothugo/systemd-lock-handler" ]; + }; + + Service = { + Type = "notify"; + ExecStart = "${systemd-lock-handler}/bin/systemd-lock-handler"; + }; + + Install = { + WantedBy = [ "default.target" ]; + }; + }; + + targets = { + lock = { + Unit = { + Description = "Lock the current session"; + Conflicts = [ "unlock.target" ]; + }; + }; + + unlock = { + Unit = { + Description = "Unlock the current session"; + Conflicts = [ "lock.target" ]; + }; + }; + + sleep = { + Unit = { + Description = "User-level target triggered when the system is about to sleep"; + }; + }; + }; + }; + + }; + +}
diff --git a/configurations/linux/services/waybar.nix b/configurations/linux/services/waybar.nix @@ -0,0 +1,213 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.ctucxConfig.services.waybar; + +in { + + options = { + ctucxConfig.services.waybar = { + enable = lib.mkEnableOption "waybar"; + }; + }; + + config = lib.mkIf cfg.enable { + + home-manager.users.leah = { + wayland.windowManager.sway.config.startup = [ + { always = true; command = "systemctl --user restart waybar"; } + ]; + + systemd.user.services.waybar.Service.Environment = "PATH=$PATH:${pkgs.iwd}/bin"; + + programs = { + waybar = { + enable = true; + systemd.enable = true; + + package = pkgs.waybar.override { + hyprlandSupport = false; + }; + + settings = [{ + layer = "top"; + position = "top"; + + height = 40; + + modules-left = [ "sway/workspaces" "sway/mode" ]; + modules-center = [ "clock" ]; + modules-right = [ + "tray" "disk" "memory" "cpu" "idle_inhibitor" "network#wifi" "battery" "pulseaudio" + ]; + + "sway/workspaces" = { + disable-scroll = true; + }; + + "sway/mode" = { + tooltip = false; + format = "<span style=\"italic\">{}</span>"; + }; + + clock = { + interval = 1; + format = "{:%H:%M:%S}"; + format-alt = "{:%Y-%m-%d}"; + tooltip-format = "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>"; + }; + + tray = { + tooltip = false; + # icon-size = 21; + spacing = 10; + }; + + disk = { + format = " {}%"; + tooltip-format = "SSD: {used} / {total} used"; + }; + + memory = { + format = " {}%"; + tooltip-format = "RAM: {used:0.1f}G / {total:0.1f}G used"; + }; + + cpu = { + format = " {usage}%"; + tooltip = false; + }; + + battery = { + bat = "BAT0"; + adapter = "AC"; + interval = 10; + full-at = 99; + states = { + full = 100; + good = 99; + warning = 40; + critical = 15; + }; + + format = "{icon} <span color='white'>{capacity}%</span>"; + format-charging = " <span color='white'>{capacity}%</span>"; + format-plugged = " <span color='white'>{capacity}%</span>"; + format-empty = ""; + format-full = ""; + format-icons = ["" "" "" "" ""]; + }; + + "network#wifi" = { + interface = "wlan0*"; + tooltip-format = "{ifname}: {ipaddr}/{cidr}"; + + on-click = "${pkgs.rofi-wayland}/bin/rofi -show wifi -modi 'wifi:${pkgs.rofi-iwd-wifi-menu}/bin/iwdrofimenu'"; + + format-ethernet = ""; + format-wifi = " {essid} ({signalStrength}%)"; + format-linked = ""; + format-disconnected = ""; + }; + + pulseaudio = { + scroll-step = 1; + on-click = "${pkgs.pavucontrol}/bin/pavucontrol"; + + format = "{format_source} {icon} {volume}%"; + format-bluetooth = "{format_source} {icon} {volume}%"; + format-bluetooth-muted = "{format_source} "; + format-muted = "{format_source} "; + format-source = ""; + format-source-muted = ""; + format-icons = { + headphone = ""; + phone = ""; + portable = ""; + car = ""; + default = ["" "" ""]; + }; + }; + + idle_inhibitor = { + format = "{icon}"; + format-icons = { + activated = ""; + deactivated = ""; + }; + }; + }]; + + style = '' + @keyframes blink { + to { + background: transparent; + color: #fff; + } + } + + * { + font-family: 'Noto Sans'; + font-size: 15px; + border: none; + border-radius: 0; + min-height: 0; + transition: none; + box-shadow: none; + } + + window#waybar { + /* background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0)); */ + background: rgba(0, 0, 0, 0.5); + color: white; + border-bottom: 2px solid rgba(59, 135, 86, 0.5); + } + + #workspaces button.focused { + background: rgba(255, 255, 255, 0.1); + border-bottom: 3px solid rgb(74, 169, 108); + } + + #workspaces button:hover { + background: rgba(255, 255, 255, 0.06); + } + + #clock { + font-size: 16px; + font-family: 'Noto Mono', monospace; + } + + #disk, #memory, #cpu, #idle_inhibitor, #battery, #pulseaudio, #network { + padding: 0px 15px; + } + + #battery { + color: #a3be8c; + } + + #battery.charging { + color: #a3be8c; + } + + #battery.critical:not(.charging) { + background: rgba(245, 60, 60, 0.4); + color: #fff; + + border-radius: 15px; + margin: 6px; + + animation-name: blink; + animation-duration: 1s; + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; + } + ''; + + }; + }; + + }; + }; + +}
diff --git a/configurations/linux/services/wlsunset.nix b/configurations/linux/services/wlsunset.nix @@ -0,0 +1,28 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.ctucxConfig.services.wlsunset; + +in { + + options = { + ctucxConfig.services.wlsunset = { + enable = lib.mkEnableOption "waybar"; + }; + }; + + config = lib.mkIf cfg.enable { + + home-manager.users.leah.services.wlsunset = { + enable = true; + latitude = "8.26"; + longitude = "49.01"; + temperature = { + night = 3000; + day = 4500; + }; + }; + + }; + +}
diff --git a/configurations/linux/sway.nix b/configurations/linux/sway.nix @@ -0,0 +1,77 @@ +{ config, lib, pkgs, home-manager, ... }: + +{ + + imports = [ + ./gtk.nix + ./qt.nix + ]; + + users.users.leah.extraGroups = [ "dialout" ]; + + nixpkgs.config.allowUnfree = true; + + hardware.opengl = { + enable = true; + driSupport = true; + extraPackages = with pkgs; [ + vaapiIntel + vaapiVdpau + libvdpau-va-gl + intel-media-driver + ]; + }; + + programs = { + dconf.enable = true; + }; + + services = { + nscd.enable = true; + getty.autologinUser = "leah"; + }; + + home-manager.users.leah = { + manual.html.enable = true; + }; + + ctucxConfig = { + configure = { + mobileDevice = false; + fonts = true; + bluetooth = true; + }; + + wm.sway.enable = true; + + services = { + swaylock.enable = true; + waybar.enable = true; + mako.enable = true; + wlsunset.enable = true; + + pipewire.enable = true; + easyeffects.enable = true; + + syncthing.enable = true; + }; + + programs = { + ddcutil.enable = true; + alacritty.enable = true; + + firefox.enable = true; + thunderbird.enable = true; + libreoffice.enable = true; + + ausweisapp.enable = true; + + thunar.enable = true; + imv.enable = true; + mpv.enable = true; + + bitwarden-cli.enable = true; + }; + }; + +}
diff --git a/machines/coladose/configuration.nix b/machines/coladose/configuration.nix @@ -4,6 +4,7 @@ imports = [ ./hardware-configuration.nix + ../../configurations/linux/sway.nix ]; deployment.allowLocalDeployment = true;