diff options
Diffstat (limited to 'home')
-rw-r--r-- | home/default.nix | 10 | ||||
-rw-r--r-- | home/emacs/default.nix | 14 | ||||
-rw-r--r-- | home/firefox/default.nix | 61 | ||||
-rw-r--r-- | home/gpg/default.nix | 33 | ||||
-rw-r--r-- | home/gtk/default.nix | 47 | ||||
-rw-r--r-- | home/mail/accounts/default.nix | 71 | ||||
-rw-r--r-- | home/mail/default.nix | 11 | ||||
-rw-r--r-- | home/pass/default.nix | 40 | ||||
-rw-r--r-- | home/pass/git-pass-mapping.ini | 9 | ||||
-rw-r--r-- | home/scanner/default.nix | 11 | ||||
-rw-r--r-- | home/terminal/alacritty/default.nix | 21 | ||||
-rw-r--r-- | home/terminal/default.nix | 17 | ||||
-rw-r--r-- | home/wm/default.nix | 19 | ||||
-rw-r--r-- | home/wm/gammastep/default.nix | 16 | ||||
-rw-r--r-- | home/wm/mako/default.nix | 28 | ||||
-rw-r--r-- | home/wm/sway/default.nix | 90 | ||||
-rw-r--r-- | home/wm/swaylock/config | 4 | ||||
-rw-r--r-- | home/wm/swaylock/default.nix | 27 | ||||
-rw-r--r-- | home/wm/theme/default.nix | 63 | ||||
-rw-r--r-- | home/wm/waybar/default.nix | 138 | ||||
-rw-r--r-- | home/wm/wofi/default.nix | 59 | ||||
-rw-r--r-- | home/xdg/default.nix | 44 |
22 files changed, 833 insertions, 0 deletions
diff --git a/home/default.nix b/home/default.nix index be4c47d..8fdc93f 100644 --- a/home/default.nix +++ b/home/default.nix @@ -3,15 +3,25 @@ { imports = [ ./beets + ./emacs ./feh + ./firefox ./fish ./flac ./git ./go + ./gpg + ./gtk + ./mail ./packages + ./pass ./python + ./scanner ./ssh + ./terminal ./tmux + ./wm + ./xdg ./yt-dlp ]; } diff --git a/home/emacs/default.nix b/home/emacs/default.nix new file mode 100644 index 0000000..b6c07d3 --- /dev/null +++ b/home/emacs/default.nix @@ -0,0 +1,14 @@ +{ lib, config, pkgs, ... }: +let cfg = config.my.home.emacs; +in { + options.my.home.emacs = with lib; { + enable = mkEnableOption "emacs configuration"; + }; + + config.home.packages = with pkgs; + lib.mkIf cfg.enable ([ + emacsPgtkGcc + # see https://github.com/hlissner/doom-emacs/issues/4138 + (aspellWithDicts (dicts: with dicts; [ en en-computers en-science ])) + ]); +} diff --git a/home/firefox/default.nix b/home/firefox/default.nix new file mode 100644 index 0000000..7b6485d --- /dev/null +++ b/home/firefox/default.nix @@ -0,0 +1,61 @@ +{ config, lib, pkgs, ... }: +let cfg = config.my.home.firefox; +in { + options.my.home.firefox = with lib; { + enable = mkEnableOption "firefox configuration"; + }; + + config.programs.firefox = lib.mkIf cfg.enable { + enable = true; + extensions = with pkgs.nur.repos.rycee.firefox-addons; [ + https-everywhere + pkgs.nur.repos.rycee.firefox-addons."1password-x-password-manager" + consent-o-matic + refined-github + sponsorblock + ublock-origin + ]; + profiles = { + default = { + settings = { + ## nix handle updates + "app.update.auto" = false; + "browser.bookmarks.showMobileBookmarks" = false; + "browser.compactmode.show" = true; + "browser.contentblocking.category" = "strict"; + "browser.search.countryCode" = "US"; + "browser.search.defaultenginename" = "DuckDuckGo"; + "browser.search.isUS" = true; + "browser.search.region" = "US"; + "browser.search.selectedEngine" = "DuckDuckGo"; + ## don't check if it's the default browser + "browser.shell.checkDefaultBrowser" = false; + "browser.startup.homepage" = "https://duckduckgo.com"; + "browser.urlbar.placeholderName" = "DuckDuckGo"; + ## keep this with ff 96 + "media.ffmpeg.vaapi.enabled" = true; + ## remove on ff 96 + "media.ffvpx.enabled" = false; + ## remove on ff 96 + "media.navigator.mediadatadecoder_vpx_enabled" = true; + "media.peerconnection.enabled" = true; + ## keep this with ff 96 + "media.rdd-ffmpeg.enabled" = true; + ## remove on ff 96 + "media.rdd-vpx.enabled" = false; + ## Block third-party cookies + "network.cookie.cookieBehavior" = 1; + "privacy.donottrackheader.enabled" = true; + "privacy.trackingprotection.enabled" = true; + "privacy.trackingprotection.socialtracking.enabled" = true; + }; + + userChrome = '' + #TabsToolbar { + visibility: collapse; + } + ''; + }; + }; + }; +} diff --git a/home/gpg/default.nix b/home/gpg/default.nix new file mode 100644 index 0000000..d96c3aa --- /dev/null +++ b/home/gpg/default.nix @@ -0,0 +1,33 @@ +{ config, lib, ... }: +let cfg = config.my.home.gpg; +in { + options.my.home.gpg = with lib; { + enable = mkEnableOption "gpg configuration"; + pinentry = mkOption { + type = types.str; + default = "tty"; + example = "gnome3"; + description = "Which pinentry interface to use"; + }; + defaultKey = mkOption { + type = types.str; + default = null; + description = "Default GPG key"; + }; + }; + + config = lib.mkIf cfg.enable { + programs.gpg = { + enable = true; + settings = { default-key = cfg.defaultKey; }; + }; + services.gpg-agent = { + enable = true; + enableSshSupport = true; # One agent to rule them all + pinentryFlavor = cfg.pinentry; + extraConfig = '' + allow-loopback-pinentry + ''; + }; + }; +} diff --git a/home/gtk/default.nix b/home/gtk/default.nix new file mode 100644 index 0000000..6e528b2 --- /dev/null +++ b/home/gtk/default.nix @@ -0,0 +1,47 @@ +{ config, lib, pkgs, ... }: +let cfg = config.my.home.gtk; +in { + options.my.home.gtk = with lib; { + enable = mkEnableOption "GTK configuration"; + }; + + config = lib.mkIf cfg.enable { + gtk = { + enable = true; + font = { + package = pkgs.source-sans-pro; + name = "Source Sans Pro"; + }; + iconTheme = { + package = pkgs.gnome3.adwaita-icon-theme; + name = "Adwaita"; + }; + theme = { + package = pkgs.gnome.gnome-themes-extra; + name = "Adwaita"; + }; + gtk2 = { + extraConfig = '' + gtk-xft-antialias = 1 + gtk-xft-hinting = 1 + gtk-xft-hintstyle = "hintslight" + gtk-cursor-theme-size = cursorSize + ''; + }; + + gtk3 = { + extraConfig = { + gtk-xft-antialias = 1; + gtk-xft-hinting = 1; + gtk-xft-hintstyle = "hintslight"; + }; + }; + }; + + # environment = { + # pathsToLink = [ "/libexec" ]; + # homeBinInPath = true; + # localBinInPath = true; + # }; + }; +} diff --git a/home/mail/accounts/default.nix b/home/mail/accounts/default.nix new file mode 100644 index 0000000..3a9a0e4 --- /dev/null +++ b/home/mail/accounts/default.nix @@ -0,0 +1,71 @@ +{ config, lib, pkgs, ... }: +let cfg = config.my.home.mail; +in { + config = lib.mkIf cfg.enable { + accounts.email = { + accounts = { + Fastmail = rec { + primary = true; + address = "franck@fcuny.net"; + userName = address; + realName = "Franck Cuny"; + aliases = [ "franck.cuny@gmail.com" ]; + passwordCommand = "pass email/imap.fastmail.com"; + imap.host = "imap.fastmail.com"; + mbsync = { + enable = true; + create = "maildir"; + expunge = "both"; + extraConfig.channel.CopyArrivalDate = "yes"; + }; + notmuch.enable = true; + }; + }; + }; + + programs.mbsync.enable = true; + + programs.afew = { + enable = true; + extraConfig = '' + [SpamFilter] + [KillThreadsFilter] + [ArchiveSentMailsFilter] + [InboxFilter] + ''; + }; + + programs.notmuch = { + enable = true; + maildir.synchronizeFlags = true; + new.tags = [ "unread" "inbox" ]; + new.ignore = [ "Trash" ]; + search.excludeTags = [ "spam" "deleted" ]; + hooks = { + postNew = "${config.home.profileDirectory}/bin/afew -v --tag --new"; + }; + }; + + systemd.user.services.mbsync = { + Unit = { Description = "mbsync synchronization"; }; + Service = { + Type = "oneshot"; + Environment = [ + "PASSWORD_STORE_DIR=${config.programs.password-store.settings.PASSWORD_STORE_DIR}" + "NOTMUCH_CONFIG=${config.xdg.configHome}/notmuch/notmuchrc" + ]; + ExecStart = "${pkgs.isync}/bin/mbsync -a"; + ExecStartPost = "${pkgs.notmuch}/bin/notmuch new --quiet"; + }; + }; + + systemd.user.timers.mbsync = { + Unit = { Description = "mbsync synchronization"; }; + Timer = { + OnBootSec = "30"; + OnUnitActiveSec = "5m"; + }; + Install = { WantedBy = [ "timers.target" ]; }; + }; + }; +} diff --git a/home/mail/default.nix b/home/mail/default.nix new file mode 100644 index 0000000..4f36e87 --- /dev/null +++ b/home/mail/default.nix @@ -0,0 +1,11 @@ +{ config, lib, ... }: +let + cfg = config.my.home.mail; + mkRelatedOption = desc: lib.mkEnableOption desc // { default = cfg.enable; }; +in { + imports = [ ./accounts ]; + options.my.home.mail = with lib; { + enable = mkEnableOption "email configuration"; + }; + config = { accounts.email = { maildirBasePath = ".mail"; }; }; +} diff --git a/home/pass/default.nix b/home/pass/default.nix new file mode 100644 index 0000000..3ea7892 --- /dev/null +++ b/home/pass/default.nix @@ -0,0 +1,40 @@ +{ config, lib, pkgs, ... }: +let cfg = config.my.home.pass; +in { + options.my.home.pass = with lib; { + enable = mkEnableOption "pass configuration"; + }; + config = lib.mkIf cfg.enable { + programs.password-store = { + enable = true; + settings = { + PASSWORD_STORE_DIR = "${config.xdg.dataHome}/password-store"; + PASSWORD_STORE_GENERATED_LENGTH = "30"; + PASSWORD_STORE_CHARACTER_SET = "a-zA-Z0-9~!@#$%^&*()-_=+[]{};:,.<>?"; + PASSWORD_STORE_KEY = config.programs.gpg.settings.default-key; + }; + }; + + programs.git = { + signing = { + key = config.programs.gpg.settings.default-key; + signByDefault = true; + }; + extraConfig = { + credential = { + helper = "${pkgs.gitAndTools.pass-git-helper}/bin/pass-git-helper"; + useHttpPath = true; + }; + }; + }; + + xdg.configFile."pass-git-helper/git-pass-mapping.ini" = { + source = ./git-pass-mapping.ini; + }; + + services.password-store-sync.enable = true; + + # Ensure the password store things are in the systemd session + systemd.user.sessionVariables = config.programs.password-store.settings; + }; +} diff --git a/home/pass/git-pass-mapping.ini b/home/pass/git-pass-mapping.ini new file mode 100644 index 0000000..5c5177b --- /dev/null +++ b/home/pass/git-pass-mapping.ini @@ -0,0 +1,9 @@ +[DEFAULT] +line_username=1 +skip_username=10 + +[github.com/*] +target=git/github.com + +[git.fcuny.net*] +target=git/git.fcuny.net diff --git a/home/scanner/default.nix b/home/scanner/default.nix new file mode 100644 index 0000000..aa3da7c --- /dev/null +++ b/home/scanner/default.nix @@ -0,0 +1,11 @@ +{ config, lib, pkgs, ... }: +let cfg = config.my.home.scanner; +in { + options.my.home.scanner = with lib; { + enable = mkEnableOption "scanner configuration"; + }; + config = lib.mkIf cfg.enable { + home.packages = with pkgs; [ tesseract imagemagick exiftool sane-airscan ]; + }; +} + diff --git a/home/terminal/alacritty/default.nix b/home/terminal/alacritty/default.nix new file mode 100644 index 0000000..72a6d33 --- /dev/null +++ b/home/terminal/alacritty/default.nix @@ -0,0 +1,21 @@ +{ config, lib, pkgs, ... }: +let cfg = config.my.home.terminal; +in { + config = lib.mkIf (cfg.program == "alacritty") { + programs.alacritty = { + enable = true; + + settings = { + env = { TERM = "xterm-256color"; }; + live_config_reload = true; + draw_bold_text_with_bright_colors = true; + selection = { save_to_clipboard = true; }; + font = { size = 12; }; + cursor = { + style.blinking = "Never"; + unfocused_hollow = true; + }; + }; + }; + }; +} diff --git a/home/terminal/default.nix b/home/terminal/default.nix new file mode 100644 index 0000000..e1ff0d7 --- /dev/null +++ b/home/terminal/default.nix @@ -0,0 +1,17 @@ +{ config, lib, ... }: +let cfg = config.my.home.terminal; +in { + imports = [ ./alacritty ]; + options.my.home = with lib; { + terminal = { + program = mkOption { + type = with types; nullOr (enum [ "alacritty" ]); + default = null; + example = "alacritty"; + description = "Which terminal to use for home session"; + }; + }; + }; + config.home.sessionVariables = + lib.mkIf (cfg.program != null) { TERMINAL = cfg.program; }; +} diff --git a/home/wm/default.nix b/home/wm/default.nix new file mode 100644 index 0000000..e862696 --- /dev/null +++ b/home/wm/default.nix @@ -0,0 +1,19 @@ +{ config, lib, pkgs, ... }: +let + mkRelatedOption = description: relatedWMs: + let isActivatedWm = wm: config.my.home.wm.windowManager == wm; + in (lib.mkEnableOption description) // { + default = builtins.any isActivatedWm relatedWMs; + }; +in { + imports = [ ./sway ./waybar ./mako ./swaylock ./wofi ./gammastep ./theme ]; + options.my.home.wm = with lib; { + windowManager = mkOption { + type = with types; nullOr (enum [ "sway" ]); + default = null; + example = "sway"; + description = "Which window manager to use for home session"; + }; + waybar = { enable = mkRelatedOption "waybar configuration" [ "sway" ]; }; + }; +} diff --git a/home/wm/gammastep/default.nix b/home/wm/gammastep/default.nix new file mode 100644 index 0000000..0a9c684 --- /dev/null +++ b/home/wm/gammastep/default.nix @@ -0,0 +1,16 @@ +{ config, lib, pkgs, ... }: +let isEnabled = config.my.home.wm.windowManager == "sway"; +in { + config = lib.mkIf isEnabled { + services.gammastep = { + enable = true; + #TODO: this needs to come from locale.nix + latitude = 37.8715; + longitude = -122.273; + temperature = { + day = 5000; + night = 3700; + }; + }; + }; +} diff --git a/home/wm/mako/default.nix b/home/wm/mako/default.nix new file mode 100644 index 0000000..3a13620 --- /dev/null +++ b/home/wm/mako/default.nix @@ -0,0 +1,28 @@ +{ config, lib, pkgs, ... }: +let isEnabled = config.my.home.wm.windowManager == "sway"; +in { + config = lib.mkIf isEnabled { + home.packages = [ + pkgs.libnotify # to send notifications + ]; + + systemd.user.services.mako = { + Service = { ExecStart = "${pkgs.mako}/bin/mako"; }; + Install = { WantedBy = [ "sway-session.target" ]; }; + }; + + # All the options are documented via `man 5 mako` + programs.mako = { + enable = true; + layer = "overlay"; + # The timeout value is in millisecond + defaultTimeout = 30000; + # The maximum number of notifications + maxVisible = 3; + maxIconSize = 24; + # Enable pango markup (see https://docs.gtk.org/Pango/pango_markup.html) + markup = true; + actions = true; + }; + }; +} diff --git a/home/wm/sway/default.nix b/home/wm/sway/default.nix new file mode 100644 index 0000000..5a69d75 --- /dev/null +++ b/home/wm/sway/default.nix @@ -0,0 +1,90 @@ +{ config, lib, pkgs, ... }: +let + isEnabled = config.my.home.wm.windowManager == "sway"; + terminal = config.my.home.terminal.program; + modifier = "Mod4"; # `Super` key +in { + config = lib.mkIf isEnabled { + home.packages = with pkgs; [ + wlogout + brightnessctl + pulseaudio + grim + slurp + polkit_gnome + xsettingsd + swaylock + swayidle + wl-clipboard + ]; + + home.sessionVariables = { + MOZ_ENABLE_WAYLAND = true; + XDG_CURRENT_DESKTOP = "sway"; + XDG_SESSION_TYPE = "wayland"; + }; + + wayland.windowManager.sway = { + enable = true; + config = { + # FIXME: this should be a variable + terminal = "alacritty"; + modifier = modifier; + menu = ''${pkgs.wofi}/bin/wofi -S drun -p "app:" -L 10''; + bars = [ ]; + fonts = { + names = [ "Source Code Pro" ]; + size = 10.0; + }; + keybindings = lib.mkOptionDefault { + "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"; + "XF86MonBrightnessDown" = + "exec ${pkgs.brightnessctl}/bin/brightnessctl set 5%-"; + "XF86MonBrightnessUp" = + "exec ${pkgs.brightnessctl}/bin/brightnessctl set +5%"; + "${modifier}+Escape" = "exec ${pkgs.wlogout}/bin/wlogout"; + "${modifier}+s" = + "exec ${pkgs.grim}/bin/grim $(xdg-user-dir DOCUMENTS)/screenshots/$(date +'%Y-%m-%d-%H%M%S_screenshot.png')"; + "${modifier}+Shift+s" = + "exec ${pkgs.slurp}/bin/slurp | ${pkgs.grim}/bin/grim -g - $(xdg-user-dir DOCUMENTS)/screenshots/$(date +'%Y-%m-%d-%H%M%S_screenshot.png')"; + }; + window.commands = [{ + command = "floating enable"; + criteria.app_id = "pavucontrol"; + }]; + input = { + "*" = { + "xkb_layout" = "us,fr"; + # map capslock to ctrl, and switch layout using shift+caps + "xkb_options" = "ctrl:nocaps,grp:shift_caps_toggle"; + }; + }; + assigns = { + "1" = [{ app_id = "emacs"; }]; + "2" = [{ app_id = "Alacritty"; }]; + "3" = [{ app_id = "firefox"; }]; + "4" = [{ class = "Element"; }]; + }; + output = { + "*" = { + scale = "1.5"; + bg = "#2E3440 solid_color"; + }; + # This is for aptos + "eDP-1" = { scale = "1.3"; }; + }; + startup = [{ + command = '' + exec "systemctl --user import-environment; systemctl --user start sway-session.target"''; + }]; + }; + }; + }; +} diff --git a/home/wm/swaylock/config b/home/wm/swaylock/config new file mode 100644 index 0000000..032695b --- /dev/null +++ b/home/wm/swaylock/config @@ -0,0 +1,4 @@ +color=FFFFEA +daemonize +indicator-caps-lock +hide-keyboard-layout diff --git a/home/wm/swaylock/default.nix b/home/wm/swaylock/default.nix new file mode 100644 index 0000000..3df802a --- /dev/null +++ b/home/wm/swaylock/default.nix @@ -0,0 +1,27 @@ +{ config, lib, pkgs, ... }: +let isEnabled = config.my.home.wm.windowManager == "sway"; +in { + config = lib.mkIf isEnabled { + xdg.configFile."swaylock/config" = { source = ./config; }; + + # https://github.com/nix-community/home-manager/pull/2610 + # won't be needed for ever + systemd.user.services.swayidle = { + Unit.PartOf = [ "sway-session.target" ]; + Install.WantedBy = [ "sway-session.target" ]; + + Service = { + Environment = + "PATH=${pkgs.bash}/bin:${config.wayland.windowManager.sway.package}/bin"; + ExecStart = '' + ${pkgs.swayidle}/bin/swayidle -w \ + timeout 300 "${pkgs.swaylock}/bin/swaylock" \ + timeout 300 'swaymsg "output * dpms off"' \ + resume 'swaymsg "output * dpms on"' \ + before-sleep "${pkgs.swaylock}/bin/swaylock" + ''; + Restart = "on-failure"; + }; + }; + }; +} diff --git a/home/wm/theme/default.nix b/home/wm/theme/default.nix new file mode 100644 index 0000000..e466d6c --- /dev/null +++ b/home/wm/theme/default.nix @@ -0,0 +1,63 @@ +{ config, lib, ... }: +let + isEnabled = config.my.home.wm.windowManager == "sway"; + cfg = config.base16-theme; + inherit (lib) mkOption mkMerge mkIf mkEnableOption types; + cnotation = builtins.replaceStrings [ "#" ] [ "0x" ]; + color = default: + mkOption { + inherit default; + type = types.str; + }; + alpha = clr: a: "${clr}${a}"; +in { + options.base16-theme = { + enable = mkEnableOption "Enable base16 theme systemwide"; + base00 = color "#2E3440"; # polar night + base01 = color "#3B4252"; # polar night + base02 = color "#434C5E"; # polar night + base03 = color "#4C566A"; # polar night + base04 = color "#D8DEE9"; # snow storm + base05 = color "#E5E9F0"; # snow storm + base06 = color "#ECEFF4"; # snow storm + base07 = color "#8FBCBB"; # frost + base08 = color "#88C0D0"; # frost + base09 = color "#81A1C1"; # frost + base0A = color "#5E81AC"; # frost + base0B = color "#BF616A"; # aurora + base0C = color "#D08770"; # aurora + base0D = color "#EBCB8B"; # aurora + base0E = color "#A3BE8C"; # aurora + base0F = color "#B48EAD"; # aurora + }; + + config = mkIf isEnabled (mkMerge [({ + wayland.windowManager.sway.config.colors = rec { + focused = { + border = cfg.base0A; + background = cfg.base0A; + text = cfg.base06; + indicator = cfg.base0A; + childBorder = cfg.base0A; + }; + + focusedInactive = { + border = cfg.base00; + background = cfg.base00; + text = cfg.base07; + indicator = cfg.base00; + childBorder = cfg.base00; + }; + + unfocused = focusedInactive; + + urgent = { + border = cfg.base0B; + background = cfg.base0B; + text = cfg.base05; + indicator = cfg.base0B; + childBorder = cfg.base0B; + }; + }; + })]); +} diff --git a/home/wm/waybar/default.nix b/home/wm/waybar/default.nix new file mode 100644 index 0000000..6bc385f --- /dev/null +++ b/home/wm/waybar/default.nix @@ -0,0 +1,138 @@ +{ config, lib, pkgs, ... }: +let isEnabled = config.my.home.wm.windowManager == "sway"; +in { + config = lib.mkIf isEnabled { + programs.waybar = { + enable = true; + systemd = { enable = true; }; + + settings = [{ + layer = "bottom"; + position = "top"; + margin-top = 0; + margin-left = 0; + margin-right = 0; + margin-bottom = 0; + modules-left = [ "sway/workspaces" "sway/mode" ]; + modules-right = [ "pulseaudio" "network" "battery" "clock" "tray" ]; + modules = { + "sway/workspaces" = { format = "{name}"; }; + "sway/mode" = { format = "{}"; }; + tray = { spacing = 10; }; + clock = { format = "{: %a %b %d %R}"; }; + battery = { + states = { + warning = 30; + critical = 15; + }; + format = "ac:{capacity}%"; + tooltip = true; + tooltip-format = "{timeTo} ({capacity}%)"; + }; + pulseaudio = { + format = "vol:{volume}%"; + format-bluetooth = "bt:{volume}% {icon} ({format_source})"; + format-bluetooth-muted = "bt:{volume}%"; + format-muted = "vol:{volume}%"; + on-click = "pavucontrol"; + }; + "network" = { + format-wifi = "{essid}:{signalStrength}%"; + format-ethernet = "{ipaddr}/{cidr}"; + format-linked = "{ifname} (No IP)"; + format-disconnected = "network unavailable"; + format-alt = "{ifname}: {ipaddr}/{cidr}"; + tooltip = false; + }; + }; + }]; + + style = '' + * { + border-radius: 0; + border: none; + margin: 0; + min-height: 0; + padding: 0; + } + #waybar { + font-family: Source Code Pro; + font-size: 15px; + } + window#waybar { + background-color: rgba(43, 48, 59, 0.5); + color: #ffffff; + transition-property: background-color; + transition-duration: .5s; + } + #workspaces button { + padding: 0 3px; + background-color: transparent; + color: #888888; + box-shadow: inset 0 -3px transparent; + font-weight: bold; + } + #workspaces button.focused { + background-color: #285577; + border: 1px solid #4c7899; + color: #ffffff; + } + #workspaces button.urgent { + background-color: #900000; + color: #ffffff; + border: 1px solid #2f343a; + } + #tray { + /* No styles */ + } + #clock, + #battery, + #network, + #pulseaudio, + #tray, + #mode { + padding-left: 10px; + padding-right: 10px; + } + #mode { + background: #64727D; + border-top: 2px solid white; + /* To compensate for the top border and still have vertical centering */ + padding-bottom: 2px; + } + #clock { + /* No styles */ + } + #battery { + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; + } + #battery.discharging { + color: #90a1ad; + } + #battery.charging { + color: #fffff8; + } + #battery.warning { + border-bottom: 2px solid #ff9e21; + } + #battery.critical { + border-bottom: 2px solid #ff3121; + } + #network { + /* No styles */ + } + #network.disconnected { + color: orange; + } + #pulseaudio { + /* No styles */ + } + #pulseaudio.muted { + color: #90a1ad; + } + ''; + }; + }; +} diff --git a/home/wm/wofi/default.nix b/home/wm/wofi/default.nix new file mode 100644 index 0000000..9ccb4be --- /dev/null +++ b/home/wm/wofi/default.nix @@ -0,0 +1,59 @@ +{ config, lib, pkgs, ... }: +let isEnabled = config.my.home.wm.windowManager == "sway"; +in { + config = lib.mkIf isEnabled { + home.packages = with pkgs; [ wofi ]; + xdg.configFile."wofi/config".text = '' + allow_images=true + image_size=20px + drun-display_generic=true + dynamic_lines=true + ''; + + xdg.configFile."wofi/style.css".text = '' + *{ + font-family: monospace; + } + + window { + color: #5E81AC; + background-color: rgba(27, 27, 28, 0.92); + border: 2px solid #75d5ff; + } + + #input { + margin: 10px 0px; + border-radius: 0px; + border: none; + background: transparent; + color: white; + } + + #inner-box { + background-color: transparent; + } + + #outer-box { + margin: 0px; + padding:5px; + background-color: transparent; + } + + #text { + padding: 5px; + color: white; + } + + #entry:selected { + color: #75d5ff; + background-color: transparent; + border: 0px; + } + + #text:selected { + color: #75d5ff; + background-color: transparent; + } + ''; + }; +} diff --git a/home/xdg/default.nix b/home/xdg/default.nix new file mode 100644 index 0000000..a4f0c53 --- /dev/null +++ b/home/xdg/default.nix @@ -0,0 +1,44 @@ +{ config, lib, pkgs, ... }: +let cfg = config.my.home.xdg; +in { + options.my.home.xdg = with lib; { + enable = mkEnableOption "XDG configuration"; + }; + + config = lib.mkIf cfg.enable { + xdg = { + enable = true; + # File types + mime.enable = true; + # File associatons + mimeApps = { enable = true; }; + # User directories + userDirs = { + enable = true; + createDirectories = true; + desktop = "${config.home.homeDirectory}/documents"; + documents = "${config.home.homeDirectory}/documents"; + download = "${config.home.homeDirectory}/downloads"; + music = "${config.home.homeDirectory}/media/music"; + pictures = "${config.home.homeDirectory}/media/pictures"; + publicShare = "${config.home.homeDirectory}/documents/public"; + templates = "${config.home.homeDirectory}/documents/templates"; + videos = "${config.home.homeDirectory}/media/videos"; + }; + }; + + # xdg.portal = { + # enable = true; + # gtkUsePortal = true; + # extraPortals = + # [ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-wlr ]; + # }; + + # I want a tidier home + home.sessionVariables = with config.xdg; { + DOCKER_CONFIG = "${configHome}/docker"; + LESSHISTFILE = "${dataHome}/less/history"; + LESSKEY = "${configHome}/less/lesskey"; + }; + }; +} |