diff options
Diffstat (limited to 'share')
| -rw-r--r-- | share/cfg/firefox/default.nix | 3 | ||||
| -rw-r--r-- | share/cfg/gallery-dl.nix | 35 | ||||
| -rw-r--r-- | share/cfg/hyprland.nix | 25 | ||||
| -rw-r--r-- | share/cfg/waybar.nix | 7 | ||||
| -rw-r--r-- | share/hm-modules/default.nix | 7 | ||||
| -rw-r--r-- | share/hm-modules/hyprdesktop.nix | 77 | ||||
| -rw-r--r-- | share/hm-modules/wpaperd.nix | 13 | ||||
| -rw-r--r-- | share/home/minimal.nix | 4 | ||||
| -rw-r--r-- | share/nixos-modules/iwd-ext.nix | 11 | ||||
| -rw-r--r-- | share/system/client-common.nix | 11 | ||||
| -rw-r--r-- | share/system/virt.nix | 29 |
11 files changed, 69 insertions, 153 deletions
diff --git a/share/cfg/firefox/default.nix b/share/cfg/firefox/default.nix index 07281ec..5590d5d 100644 --- a/share/cfg/firefox/default.nix +++ b/share/cfg/firefox/default.nix @@ -4,8 +4,7 @@ let css-files = map (n: ./usercss/${n}) (builtins.attrNames (builtins.readDir ./usercss)); userChrome = builtins.concatStringsSep "\n" (map builtins.readFile css-files); -in -{ +in { home.sessionVariables.BROWSER = "firefox"; programs.firefox = { diff --git a/share/cfg/gallery-dl.nix b/share/cfg/gallery-dl.nix index 3ee065b..802141f 100644 --- a/share/cfg/gallery-dl.nix +++ b/share/cfg/gallery-dl.nix @@ -1,5 +1,4 @@ -{ config, ... }: -{ +{ config, ... }: { programs.gallery-dl = { settings.extractor = { base-directory = "${config.xdg.userDirs.download}/gallery-dl"; @@ -8,24 +7,15 @@ { name = "metadata"; mode = "json"; - whitelist = [ - "danbooru" - "moebooru" - "gelbooru" - "sankaku" - "nhentai" - "rule34" - ]; + whitelist = + [ "danbooru" "moebooru" "gelbooru" "sankaku" "nhentai" "rule34" ]; } { name = "zip"; compression = "store"; extension = "cbz"; filter = "extension not in ('zip', 'rar')"; - whitelist = [ - "nhentai" - "mangadex" - ]; + whitelist = [ "nhentai" "mangadex" ]; } ]; @@ -34,21 +24,14 @@ reddit = { archive-format = "s_{subreddit}{filename}"; directory = { - "locals().get('is_gallery')" = [ - "Reddit" - "S" - "{subreddit!C}" - "{title[:120]!t:?/_/R /_/}{id}" - ]; - "" = [ - "Reddit" - "S" - "{subreddit!C}" - ]; + "locals().get('is_gallery')" = + [ "Reddit" "S" "{subreddit!C}" "{title[:120]!t:?/_/R /_/}{id}" ]; + "" = [ "Reddit" "S" "{subreddit!C}" ]; }; filename = { - "locals().get('is_gallery')" = "{title[:120]!t:?/_/R /_/}{id}{num:?_//>02}.{extension}"; + "locals().get('is_gallery')" = + "{title[:120]!t:?/_/R /_/}{id}{num:?_//>02}.{extension}"; "" = "{title[:120]!t:?/_/R /_/}{id}.{extension}"; }; }; diff --git a/share/cfg/hyprland.nix b/share/cfg/hyprland.nix index b9353ef..629f105 100644 --- a/share/cfg/hyprland.nix +++ b/share/cfg/hyprland.nix @@ -17,8 +17,7 @@ let }; terminal = "kitty"; }; -in -{ +in { wayland.windowManager.hyprland = { extraConfig = '' $mod = SUPER @@ -36,22 +35,12 @@ in # workspaces # binds $mod + [shift +] {1..10} to [move to] workspace {1..10} - ${builtins.concatStringsSep "\n" ( - builtins.genList ( - x: - let - ws = - let - c = (x + 1) / 10; - in - builtins.toString (x + 1 - (c * 10)); - in - '' - bind = $mod, ${ws}, workspace, ${toString (x + 1)} - bind = $mod SHIFT, ${ws}, movetoworkspacesilent, ${toString (x + 1)} - '' - ) 10 - )} + ${builtins.concatStringsSep "\n" (builtins.genList (x: + let ws = let c = (x + 1) / 10; in builtins.toString (x + 1 - (c * 10)); + in '' + bind = $mod, ${ws}, workspace, ${toString (x + 1)} + bind = $mod SHIFT, ${ws}, movetoworkspacesilent, ${toString (x + 1)} + '') 10)} bind = $mod SHIFT, C, killactive bind = $mod SHIFT, F, togglefloating diff --git a/share/cfg/waybar.nix b/share/cfg/waybar.nix index 7a9fb96..892850a 100644 --- a/share/cfg/waybar.nix +++ b/share/cfg/waybar.nix @@ -1,5 +1,4 @@ -{ lib, ... }: -{ +{ lib, ... }: { programs.waybar = { systemd = { enable = true; @@ -25,9 +24,7 @@ ]; # TODO: fix clock format - clock = { - format = "{:%H:%M}"; - }; + clock = { format = "{:%H:%M}"; }; "battery#capacity" = { format = lib.concatStringsSep "\n" [ "{icon}" "{capacity}%" ]; diff --git a/share/hm-modules/default.nix b/share/hm-modules/default.nix index 695f3fe..e20d424 100644 --- a/share/hm-modules/default.nix +++ b/share/hm-modules/default.nix @@ -1,6 +1 @@ -{ ... }: { - imports = [ - ./hyprdesktop.nix - ./wpaperd.nix - ]; -} +{ ... }: { imports = [ ./hyprdesktop.nix ./wpaperd.nix ]; } diff --git a/share/hm-modules/hyprdesktop.nix b/share/hm-modules/hyprdesktop.nix index eef388f..a9f2ed4 100644 --- a/share/hm-modules/hyprdesktop.nix +++ b/share/hm-modules/hyprdesktop.nix @@ -1,20 +1,8 @@ -{ config -, pkgs -, lib -, ... -}: +{ config, pkgs, lib, ... }: let - inherit (lib) - mkIf - mkOption - mkEnableOption - types - mdDoc - lists - ; + inherit (lib) mkIf mkOption mkEnableOption types mdDoc lists; cfg = config.custom.hyprdesktop; -in -{ +in { imports = [ ../home/minimal.nix ]; options.custom.hyprdesktop = { @@ -61,8 +49,7 @@ in config = mkIf cfg.enable { wayland.windowManager.hyprland.enable = true; - home.packages = - with pkgs; + home.packages = with pkgs; [ xh # Nice to use HTTP client bc # CLI calculator @@ -120,28 +107,20 @@ in # Flat-Remix icon themes don't contain all the icons that Foliate uses, # so I'm bringing in the adwaita icons as a fallback. gnome3.adwaita-icon-theme - ] - ++ lists.optionals cfg.hasBluetooth [ overskride ] + ] ++ lists.optionals cfg.hasBluetooth [ overskride ] ++ lists.optionals cfg.enableGaming [ jdk17_headless superTuxKart wineWowPackages.full winetricks - ] - ++ lists.optionals (cfg.enableWindowsCompat || cfg.enableGaming) [ + ] ++ lists.optionals (cfg.enableWindowsCompat || cfg.enableGaming) [ wineWowPackages.full winetricks qemu_kvm - ] - ++ lists.optionals cfg.hasBrightnessCtl [ brightnessctl ] - ++ lists.optionals cfg.enableGitAnnex [ - git-annex - git-remote-gcrypt - ]; + ] ++ lists.optionals cfg.hasBrightnessCtl [ brightnessctl ] + ++ lists.optionals cfg.enableGitAnnex [ git-annex git-remote-gcrypt ]; - home.shellAliases = { - sl = "sl -awFc5"; - }; + home.shellAliases = { sl = "sl -awFc5"; }; services.dunst.enable = true; services.wpaperd.enable = true; @@ -173,28 +152,22 @@ in }; xdg = { - systemDirs.data = - let - gds = pkgs.gsettings-desktop-schemas; - gtk3 = pkgs.gtk3; - in - [ - "${gds}/share/gsettings-schemas/${gds.name}" - "${gtk3}/share/gsettings-schemas/${gtk3.name}" - ]; - userDirs = - let - annex = "${config.home.homeDirectory}/Annex"; - in - { - enable = true; - createDirectories = true; - } - // mkIf cfg.enableGitAnnex { - pictures = "${annex}/Pictures"; - music = "${annex}/Music"; - documents = "${annex}/Documents"; - }; + systemDirs.data = let + gds = pkgs.gsettings-desktop-schemas; + gtk3 = pkgs.gtk3; + in [ + "${gds}/share/gsettings-schemas/${gds.name}" + "${gtk3}/share/gsettings-schemas/${gtk3.name}" + ]; + userDirs = let annex = "${config.home.homeDirectory}/Annex"; + in { + enable = true; + createDirectories = true; + } // mkIf cfg.enableGitAnnex { + pictures = "${annex}/Pictures"; + music = "${annex}/Music"; + documents = "${annex}/Documents"; + }; portal.xdgOpenUsePortal = true; }; diff --git a/share/hm-modules/wpaperd.nix b/share/hm-modules/wpaperd.nix index 68a98a9..022f54d 100644 --- a/share/hm-modules/wpaperd.nix +++ b/share/hm-modules/wpaperd.nix @@ -1,14 +1,9 @@ -{ config -, lib -, pkgs -, ... -}: +{ config, lib, pkgs, ... }: with lib; let cfg = config.services.wpaperd; tomlFormat = pkgs.formats.toml { }; -in -{ +in { options.services.wpaperd = { enable = mkEnableOption "enable wpaperd"; @@ -49,7 +44,9 @@ in }; config = mkIf cfg.enable { - assertions = [ (hm.assertions.assertPlatform "services.wpaperd" pkgs platforms.linux) ]; + assertions = [ + (hm.assertions.assertPlatform "services.wpaperd" pkgs platforms.linux) + ]; home.packages = [ cfg.package ]; diff --git a/share/home/minimal.nix b/share/home/minimal.nix index c4f878a..566fa42 100644 --- a/share/home/minimal.nix +++ b/share/home/minimal.nix @@ -18,7 +18,7 @@ xdg.enable = true; home.shellAliases = { - ip = ''ip --color=auto''; + ip = "ip --color=auto"; tempdir = "cd $(mktemp -d)"; }; @@ -39,7 +39,7 @@ W3M_DIR = "${dataHome}/w3m"; RENPY_PATH_TO_SAVES = "${dataHome}"; PSQL_HISTORY = "${dataHome}/psql_history"; - _JAVA_OPTIONS = ''-Djava.util.prefs.userRoot=${configHome}/java''; + _JAVA_OPTIONS = "-Djava.util.prefs.userRoot=${configHome}/java"; OMNISHARPHOME = "${configHome}/omnisharp"; DOTNET_CLI_HOME = "${dataHome}/dotnet"; # shell diff --git a/share/nixos-modules/iwd-ext.nix b/share/nixos-modules/iwd-ext.nix index ddf0494..09327a9 100644 --- a/share/nixos-modules/iwd-ext.nix +++ b/share/nixos-modules/iwd-ext.nix @@ -13,8 +13,7 @@ let }; configFile = ini.generate "main.conf" (recursiveUpdate defaults cfg.settings); -in -{ +in { options.networking.wireless.iwd-ext = { enable = mkEnableOption (lib.mdDoc "iwd"); @@ -51,12 +50,8 @@ in type = types.attrsOf ini.type; default = { }; example = { - HomeNetwork = { - Security.PreSharedKey = "totallysecurepsk"; - }; - "@NETWORK_2_SSID@" = { - Security.PreSharedKey = "@NETWORK_2_PSK@"; - }; + HomeNetwork = { Security.PreSharedKey = "totallysecurepsk"; }; + "@NETWORK_2_SSID@" = { Security.PreSharedKey = "@NETWORK_2_PSK@"; }; }; description = lib.mdDoc '' diff --git a/share/system/client-common.nix b/share/system/client-common.nix index 879f593..4d3c3ca 100644 --- a/share/system/client-common.nix +++ b/share/system/client-common.nix @@ -1,9 +1,6 @@ # Common configuration options for client machines (i.e. not servers) -{ pkgs, ... }: -{ - imports = [ - ./steam.nix - ]; +{ pkgs, ... }: { + imports = [ ./steam.nix ]; programs.hyprland.enable = true; boot.supportedFilesystems = [ "ntfs" "bcachefs" ]; @@ -37,9 +34,7 @@ enable = true; enableSSHSupport = true; pinentryPackage = pkgs.pinentry-gnome3; - settings = { - default-cache-ttl = 1200; - }; + settings = { default-cache-ttl = 1200; }; }; sound.enable = true; diff --git a/share/system/virt.nix b/share/system/virt.nix index 0207064..6f5a9fe 100644 --- a/share/system/virt.nix +++ b/share/system/virt.nix @@ -2,25 +2,18 @@ let # https://stackoverflow.com/questions/75855410/nix-map-list-of-keys-to-attribute-set-members attrSetRepeatValue = value: list: - let - acc = { }; # accumulator - in - builtins.foldl' (acc: key: acc // { "${key}" = value; }) acc list; -in -{ - users.users = attrSetRepeatValue - { extraGroups = [ "libvirtd" ]; } - virt-users; + let acc = { }; # accumulator + in builtins.foldl' (acc: key: acc // { "${key}" = value; }) acc list; +in { + users.users = attrSetRepeatValue { extraGroups = [ "libvirtd" ]; } virt-users; - home-manager.users = attrSetRepeatValue - { - home.packages = [ pkgs.quickemu ]; - dconf.settings."org/virt-manager/virt-manager/connections" = { - autoconnect = [ "qemu:///system" ]; - uris = [ "qemu:///system" ]; - }; - } - virt-users; + home-manager.users = attrSetRepeatValue { + home.packages = [ pkgs.quickemu ]; + dconf.settings."org/virt-manager/virt-manager/connections" = { + autoconnect = [ "qemu:///system" ]; + uris = [ "qemu:///system" ]; + }; + } virt-users; programs.virt-manager.enable = true; virtualisation.libvirtd = { |
