From 7eb1366c3172e5955a395fdedf50bd725dca0531 Mon Sep 17 00:00:00 2001 From: kat witch Date: Mon, 30 Aug 2021 19:45:02 +0100 Subject: [PATCH] nixdirfmt + swaylock -> exprs + katexprs update --- config/modules/home/default.nix | 1 - config/modules/home/swaylock.nix | 44 --------- config/modules/home/theme.nix | 144 +++++++++++++++--------------- config/services/gitea/default.nix | 20 ++--- config/users/kat/dev/vim/init.vim | 2 +- config/users/kat/sway/sway.nix | 3 +- nix/sources.json | 6 +- overlays/exprs | 2 +- 8 files changed, 90 insertions(+), 132 deletions(-) delete mode 100644 config/modules/home/swaylock.nix diff --git a/config/modules/home/default.nix b/config/modules/home/default.nix index 300162f2..f3bcad66 100644 --- a/config/modules/home/default.nix +++ b/config/modules/home/default.nix @@ -8,7 +8,6 @@ (import sources.anicca).modules.home ./deploy.nix ./theme.nix - ./swaylock.nix ./secrets.nix (sources.tf-nix + "/modules/home/secrets.nix") ]; diff --git a/config/modules/home/swaylock.nix b/config/modules/home/swaylock.nix deleted file mode 100644 index b359cdd7..00000000 --- a/config/modules/home/swaylock.nix +++ /dev/null @@ -1,44 +0,0 @@ -{ config, lib, pkgs, ... }: with lib; - -let cfg = config.programs.swaylock; in -{ - options.programs.swaylock = { - enable = mkEnableOption "locker integration"; - package = mkOption { - type = types.package; - default = pkgs.swaylock-effects; - }; - wrapped = mkOption { - type = types.package; - }; - script = mkOption { - type = types.path; - default = "${cfg.wrapped}/bin/swaylock"; - }; - colors = mkOption { - type = types.attrsOf types.str; - default = { }; - }; - args = mkOption { - type = with types; attrsOf (oneOf [ str bool int float ]); - default = { }; - }; - }; - config = mkIf cfg.enable { - programs.swaylock = let - argList = concatLists (mapAttrsToList (arg: value: - if value == true then - singleton "--${toString arg}" - else [ - "--${arg}" - (toString value) - ]) cfg.args); - argStr = escapeShellArgs argList; - in { - args = mapAttrs' (arg: color: nameValuePair ("${arg}-color") (removePrefix "#" color)) cfg.colors; - wrapped = pkgs.writeShellScriptBin "swaylock" '' - ${cfg.package}/bin/swaylock ${argStr} $@ - ''; - }; - }; -} diff --git a/config/modules/home/theme.nix b/config/modules/home/theme.nix index 5d904647..4d2d9bc4 100644 --- a/config/modules/home/theme.nix +++ b/config/modules/home/theme.nix @@ -1,8 +1,8 @@ { config, pkgs, lib, ... }: /* -This module: -* provides a central way to change the font my system uses. + This module: + * provides a central way to change the font my system uses. */ with lib; @@ -57,99 +57,101 @@ let cfg = config.kw.theme; in config = mkIf (cfg.enable) { kw.theme = { base16 = lib.mapAttrs' (k: v: lib.nameValuePair k "#${v.hex.rgb}") - (lib.filterAttrs (n: _: lib.hasInfix "base" n) config.lib.arc.base16.schemeForAlias.default); + (lib.filterAttrs (n: _: lib.hasInfix "base" n) config.lib.arc.base16.schemeForAlias.default); base16t = lib.mapAttrs' (k: v: lib.nameValuePair "${k}t" "rgba(${toString v.rgb.r}, ${toString v.rgb.g}, ${toString v.rgb.b}, ${toString cfg.alpha})") - (lib.filterAttrs (n: _: lib.hasInfix "base" n) config.lib.arc.base16.schemeForAlias.default); + (lib.filterAttrs (n: _: lib.hasInfix "base" n) config.lib.arc.base16.schemeForAlias.default); alpha = 0.7; }; - programs.swaylock = mkIf (cfg.swaylock) { - enable = true; - args = { - screenshots = true; - daemonize = true; - show-failed-attempts = true; - indicator = true; - indicator-radius = 110; - indicator-thickness = 8; - font = cfg.font.name; - font-size = cfg.font.size_css; - clock = true; - datestr = "%F"; - timestr = "%T"; - effect-blur = "5x2"; - fade-in = 0.2; - }; - colors = with cfg.base16; { - key-hl = base0C; - separator = base01; - line = base01; - line-clear = base01; - line-caps-lock = base01; - line-ver = base01; - line-wrong = base01; - ring = base00; - ring-clear = base0B; - ring-caps-lock = base09; - ring-ver = base0D; - ring-wrong = base08; - inside = base00; - inside-clear = base00; - inside-caps-lock = base00; - inside-ver = base00; - inside-wrong = base00; - text = base05; - text-clear = base05; - text-caps-lock = base05; - text-ver = base05; - text-wrong = base05; - }; + programs.swaylock = mkIf (cfg.swaylock) { + enable = true; + args = { + screenshots = true; + daemonize = true; + show-failed-attempts = true; + indicator = true; + indicator-radius = 110; + indicator-thickness = 8; + font = cfg.font.name; + font-size = cfg.font.size_css; + clock = true; + datestr = "%F"; + timestr = "%T"; + effect-blur = "5x2"; + fade-in = 0.2; }; + colors = with cfg.base16; { + key-hl = base0C; + separator = base01; + line = base01; + line-clear = base01; + line-caps-lock = base01; + line-ver = base01; + line-wrong = base01; + ring = base00; + ring-clear = base0B; + ring-caps-lock = base09; + ring-ver = base0D; + ring-wrong = base08; + inside = base00; + inside-clear = base00; + inside-caps-lock = base00; + inside-ver = base00; + inside-wrong = base00; + text = base05; + text-clear = base05; + text-caps-lock = base05; + text-ver = base05; + text-wrong = base05; + }; + }; - systemd.user.services.swayidle = mkIf (cfg.swaylock) { - Unit = { - Description = "swayidle"; - Documentation = [ "man:swayidle(1)" ]; - PartOf = [ "graphical-session.target" ]; - }; - Service = { - Type = "simple"; - ExecStart = let + systemd.user.services.swayidle = mkIf (cfg.swaylock) { + Unit = { + Description = "swayidle"; + Documentation = [ "man:swayidle(1)" ]; + PartOf = [ "graphical-session.target" ]; + }; + Service = { + Type = "simple"; + ExecStart = + let lockCommand = config.programs.swaylock.script; - in '' + in + '' ${pkgs.swayidle}/bin/swayidle -w \ timeout 300 '${lockCommand}' \ timeout 600 'swaymsg "output * dpms off"' \ resume 'swaymsg "output * dpms on"' \ before-sleep '${lockCommand}' ''; - RestartSec = 3; - Restart = "always"; - }; - Install = { WantedBy = [ "sway-session.target" ]; }; + RestartSec = 3; + Restart = "always"; }; + Install = { WantedBy = [ "sway-session.target" ]; }; + }; - lib.kw.sassTemplate = { name, src }: + lib.kw.sassTemplate = { name, src }: let variables = pkgs.writeText "base-variables.sass" '' ${(concatStringsSep "\n" (mapAttrsToList(var: con: "\$${var}: ${con}") cfg.sass.variables))} ''; source = pkgs.callPackage - ({ sass, stdenv }: stdenv.mkDerivation { - inherit name src variables; - nativeBuildInputs = lib.singleton sass; - phases = [ "buildPhase" ]; - buildPhase = '' + ({ sass, stdenv }: stdenv.mkDerivation { + inherit name src variables; + nativeBuildInputs = lib.singleton sass; + phases = [ "buildPhase" ]; + buildPhase = '' cat $variables $src > src-mut.sass sass src-mut.sass $out --sourcemap=none --style=${cfg.sass.css_style} - ''; - }) - { }; + ''; + }) + { }; in { inherit source; text = builtins.readFile source; }; - _module.args = { inherit (config.lib) kw; }; - }; - } + _module.args = { inherit (config.lib) kw; }; + }; +} diff --git a/config/services/gitea/default.nix b/config/services/gitea/default.nix index dbd77be0..50f4dba2 100644 --- a/config/services/gitea/default.nix +++ b/config/services/gitea/default.nix @@ -70,16 +70,16 @@ sha256 = "1axqivwkmw6rq0ffwi1mm209bfkvv4lyld2hgyq2zmnl7mj3fifc"; }; binder = pkgs.writeText "styles.css" '' - @import url("/assets/css/gitea-base.css"); - @import url("/assets/css/overseerr.css"); - :root { - --color-code-bg: transparent; - } - .markup input[type="checkbox"] { - appearance: auto !important; - -moz-appearance: auto !important; - -webkit-appearance: auto !important; - } + @import url("/assets/css/gitea-base.css"); + @import url("/assets/css/overseerr.css"); + :root { + --color-code-bg: transparent; + } + .markup input[type="checkbox"] { + appearance: auto !important; + -moz-appearance: auto !important; + -webkit-appearance: auto !important; + } ''; in [ diff --git a/config/users/kat/dev/vim/init.vim b/config/users/kat/dev/vim/init.vim index 851afebe..4c70d86e 100644 --- a/config/users/kat/dev/vim/init.vim +++ b/config/users/kat/dev/vim/init.vim @@ -4,7 +4,7 @@ require'nvim-treesitter.configs'.setup { ignore_install = { }, -- List of parsers to ignore installing highlight = { enable = true, - additional_vim_regex_highlighting = false, + additional_vim_regex_highlighting = true, }, indent = { enable = true, diff --git a/config/users/kat/sway/sway.nix b/config/users/kat/sway/sway.nix index 2ebe3279..8d8301b7 100644 --- a/config/users/kat/sway/sway.nix +++ b/config/users/kat/sway/sway.nix @@ -1,6 +1,7 @@ { config, pkgs, lib, ... }: -let lockCommand = config.programs.swaylock.script; in { +let lockCommand = config.programs.swaylock.script; in +{ home.sessionVariables = { XDG_CURRENT_DESKTOP = "sway"; XDG_SESSION_TYPE = "wayland"; diff --git a/nix/sources.json b/nix/sources.json index c2cf875c..07448bad 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -89,10 +89,10 @@ "homepage": null, "owner": "kittywitch", "repo": "nixexprs", - "rev": "a1ef2f8f807205d39c113617670f843690253b43", - "sha256": "14pg1vl4ys7zbhmiy4l99fngmj1z9csrm2vap375vyjns837q9kg", + "rev": "cace9038678b16a73a41430ef6fd32b7a86c2ef6", + "sha256": "0sm1ak1av97s0wm3z47f2aknf5a943lr2cqsyhl4mp9vhvhy87fd", "type": "tarball", - "url": "https://github.com/kittywitch/nixexprs/archive/a1ef2f8f807205d39c113617670f843690253b43.tar.gz", + "url": "https://github.com/kittywitch/nixexprs/archive/cace9038678b16a73a41430ef6fd32b7a86c2ef6.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "niv": { diff --git a/overlays/exprs b/overlays/exprs index a1ef2f8f..3872f4f2 160000 --- a/overlays/exprs +++ b/overlays/exprs @@ -1 +1 @@ -Subproject commit a1ef2f8f807205d39c113617670f843690253b43 +Subproject commit 3872f4f23c60b2a398ed074d4db60c6344bdd500