diff --git a/.gitignore b/.gitignore index f35c3402..6263317b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /result /result* /.direnv/ +/wiki diff --git a/.gitmodules b/.gitmodules index d001e853..2da3f81a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,6 +2,3 @@ path = depot/trusted branch = main url = "https://git.kittywit.ch/kat/nixfiles-trusted.git" -[submodule "wiki"] - path = wiki - url = git@github.com:kittywitch/nixfiles.wiki.git diff --git a/default.nix b/default.nix index 74a488ff..92cf3748 100644 --- a/default.nix +++ b/default.nix @@ -2,11 +2,13 @@ let # Sources are from niv. sources = import ./nix/sources.nix; # We pass sources through to pkgs and get our nixpkgs + overlays. - pkgs = import ./pkgs { inherit sources; }; + pkgs = import ./pkgs.nix { inherit sources; }; # We want our overlaid lib. inherit (pkgs) lib; # This is used for caching niv sources in CI. sourceCache = import ./cache.nix { inherit sources lib; }; + # This is used for the base path for hostImport. + root = ./.; /* This is used to generate specialArgs + the like. It works as such: @@ -19,13 +21,16 @@ let lib.foldl' (a: b: a ++ b) [ ] (map (e: if (filter e set.${e}) then [ e ] else [ ]) (lib.attrNames set)); depotNames = lib.unique (lib.folderList ./depot ["trusted"] ++ lib.folderList ./depot/trusted ["pkgs"]); - depot = lib.mapListToAttrs (folder: lib.nameValuePair folder (lib.domainMerge { inherit folder; })) depotNames; + depot = lib.mapListToAttrs (folder: lib.nameValuePair folder (lib.domainMerge { + inherit folder; + folderPaths = [ (./depot + "/${folder}") (./depot/trusted + "/${folder}") ]; + })) depotNames; /* We use this to make the meta runner use this file and to use `--show-trace` on nix-builds. We also pass through pkgs to meta this way. */ - metaConfig = import ./meta-base.nix { + metaConfig = import ./meta.nix { inherit pkgs lib depot; }; @@ -38,7 +43,7 @@ let ++ lib.singleton ./depot/modules/meta/default.nix; specialArgs = { - inherit sources; + inherit sources root; meta = self; } // depot; }; diff --git a/depot/hosts/athame/meta.nix b/depot/hosts/athame/meta.nix index 7ab984b0..fc1838c8 100644 --- a/depot/hosts/athame/meta.nix +++ b/depot/hosts/athame/meta.nix @@ -1,4 +1,4 @@ -{ profiles, lib, config, ... }: with lib; { +{ profiles, lib, root, config, ... }: with lib; { config = { deploy.targets.infra = { tf = { @@ -15,7 +15,7 @@ config = { network.nodes.athame = { imports = lib.hostImport { hostName = "athame"; - inherit profiles; + inherit profiles root; }; networking = { hostName = "athame"; diff --git a/depot/hosts/beltane/meta.nix b/depot/hosts/beltane/meta.nix index b86dcb75..042dfffe 100644 --- a/depot/hosts/beltane/meta.nix +++ b/depot/hosts/beltane/meta.nix @@ -1,4 +1,4 @@ -{ profiles, config, lib, ... }: with lib; { +{ profiles, config, root, lib, ... }: with lib; { config = { deploy.targets.beltane = { tf = { @@ -15,7 +15,7 @@ network.nodes.beltane = { imports = lib.hostImport { hostName = "beltane"; - inherit profiles; + inherit profiles root; }; networking = { hostName = "beltane"; diff --git a/depot/hosts/beltane/nixos.nix b/depot/hosts/beltane/nixos.nix index 91c08e00..6618c78b 100644 --- a/depot/hosts/beltane/nixos.nix +++ b/depot/hosts/beltane/nixos.nix @@ -94,6 +94,9 @@ with lib; }; network = { + extraCerts = { + "private_root" = "altar.kittywit.ch"; + }; addresses = { private = { ipv4.address = "192.168.1.2"; diff --git a/depot/hosts/dummy/meta.nix b/depot/hosts/dummy/meta.nix index f8942ded..39cd6685 100644 --- a/depot/hosts/dummy/meta.nix +++ b/depot/hosts/dummy/meta.nix @@ -1,9 +1,9 @@ -{ lib, config, profiles, ... }: with lib; { +{ lib, config, root, profiles, ... }: with lib; { deploy.targets.dummy.enable = false; network.nodes.dummy = { imports = lib.hostImport { hostName = "dummy"; - inherit profiles; + inherit profiles root; }; networking = { hostName = "dummy"; diff --git a/depot/hosts/ostara/meta.nix b/depot/hosts/ostara/meta.nix index b81c3a31..9bb5aabe 100644 --- a/depot/hosts/ostara/meta.nix +++ b/depot/hosts/ostara/meta.nix @@ -1,4 +1,4 @@ -{ meta, profiles, config, lib, ... }: with lib; { +{ meta, profiles, root, config, lib, ... }: with lib; { config = { deploy.targets.ostara = { tf = { @@ -15,7 +15,7 @@ network.nodes.ostara = { imports = lib.hostImport { hostName = "ostara"; - inherit profiles; + inherit profiles root; }; networking = { hostName = "ostara"; diff --git a/depot/hosts/samhain/meta.nix b/depot/hosts/samhain/meta.nix index 22fdf83e..9731afeb 100644 --- a/depot/hosts/samhain/meta.nix +++ b/depot/hosts/samhain/meta.nix @@ -1,4 +1,4 @@ -{ lib, config, profiles, ... }: with lib; { +{ lib, config, root, profiles, ... }: with lib; { config = { deploy.targets.personal = { tf = { @@ -15,7 +15,7 @@ network.nodes.samhain = { imports = lib.hostImport { hostName = "samhain"; - inherit profiles; + inherit profiles root; }; networking = { hostName = "samhain"; diff --git a/depot/hosts/yule/meta.nix b/depot/hosts/yule/meta.nix index 761bec81..a1c3cb24 100644 --- a/depot/hosts/yule/meta.nix +++ b/depot/hosts/yule/meta.nix @@ -1,4 +1,4 @@ -{ meta, profiles, config, lib, ... }: with lib; { +{ meta, profiles, config, root, lib, ... }: with lib; { config = { deploy.targets.personal = { tf = { @@ -15,7 +15,7 @@ network.nodes.yule = { imports = lib.hostImport { hostName = "yule"; - inherit profiles; + inherit profiles root; }; networking = { hostName = "yule"; diff --git a/depot/modules/home/default.nix b/depot/modules/home/default.nix index 69a788b5..00564855 100644 --- a/depot/modules/home/default.nix +++ b/depot/modules/home/default.nix @@ -2,10 +2,11 @@ { disabledModules = [ "programs/vim.nix" ]; - imports = with (import (sources.nixexprs + "/modules")).home-manager; [ base16 syncplay konawall i3gopher weechat shell ] ++ [ + imports = with (import (sources.arcexprs + "/modules")).home-manager; [ base16 syncplay konawall i3gopher weechat shell ] + ++ [ + (import (sources.katexprs + "/modules")).home ./vim.nix ./fvwm.nix - ./network.nix ./deploy.nix ./theme.nix ./secrets.nix diff --git a/depot/modules/home/network.nix b/depot/modules/home/network.nix deleted file mode 100644 index fa291d9d..00000000 --- a/depot/modules/home/network.nix +++ /dev/null @@ -1,79 +0,0 @@ -{ config, superConfig, lib, ... }: - -with lib; - -{ - options.network = { - addresses = mkOption { - type = with types; attrsOf (submodule ({ name, ... }: { - options = { - enable = mkEnableOption "Is the system a part of the ${name} network?"; - ipv4 = { - enable = mkOption { - type = types.bool; - }; - address = mkOption { - type = types.str; - }; - }; - ipv6 = { - enable = mkOption { - type = types.bool; - }; - address = mkOption { - type = types.str; - }; - }; - prefix = mkOption { - type = types.nullOr types.str; - }; - domain = mkOption { - type = types.nullOr types.str; - }; - out = { - identifierList = mkOption { - type = types.listOf types.str; - default = if config.enable then singleton config.domain ++ config.out.addressList else [ ]; - }; - addressList = mkOption { - type = types.listOf types.str; - default = if config.enable then concatMap (i: optional i.enable i.address) [ config.ipv4 config.ipv6 ] else [ ]; - }; - }; - }; - })); - }; - privateGateway = mkOption { - type = types.str; - }; - tf = { - enable = mkEnableOption "Was the system provisioned by terraform?"; - ipv4_attr = mkOption { - type = types.str; - }; - ipv6_attr = mkOption { - type = types.str; - }; - }; - dns = { - isRoot = mkEnableOption "Is this system supposed to be the @ for the domain?"; - email = mkOption { - type = types.nullOr types.str; - }; - tld = mkOption { - type = types.nullOr types.str; - }; - domain = mkOption { - type = types.nullOr types.str; - }; - dynamic = mkEnableOption "Enable Glauca Dynamic DNS Updater"; - }; - }; - - config = { - network.addresses = superConfig.network.addresses; - network.privateGateway = superConfig.network.privateGateway; - network.tf = superConfig.network.tf; - network.dns = superConfig.network.dns; - }; -} diff --git a/depot/modules/nixos/default.nix b/depot/modules/nixos/default.nix index 5fd5222c..0e049f79 100644 --- a/depot/modules/nixos/default.nix +++ b/depot/modules/nixos/default.nix @@ -1,26 +1,25 @@ { meta, sources, lib, ... }: { - imports = with (import (sources.nixexprs + "/modules")).nixos; [ base16 base16-shared modprobe ] ++ [ - ./nftables.nix - ./firewall.nix - ./fusionpbx.nix - ./deploy.nix - ./dyndns.nix - ./network.nix - ./secrets.nix - (sources.tf-nix + "/modules/nixos/secrets.nix") - (sources.tf-nix + "/modules/nixos/secrets-users.nix") - (sources.hexchen + "/modules/network/yggdrasil") - ]; + imports = + with (import (sources.arcexprs + "/modules")).nixos; [ base16 base16-shared modprobe ] + ++ [ + (import (sources.katexprs + "/modules")).nixos + ./deploy.nix + ./dyndns.nix + ./secrets.nix + (sources.tf-nix + "/modules/nixos/secrets.nix") + (sources.tf-nix + "/modules/nixos/secrets-users.nix") + (sources.hexchen + "/modules/network/yggdrasil") + ]; - options.hexchen.dns = lib.mkOption { }; - options.hexchen.deploy = lib.mkOption { }; + options.hexchen.dns = lib.mkOption { }; + options.hexchen.deploy = lib.mkOption { }; - /* - This maps hosts to network.nodes from the meta config. This is required for hexchen's yggdrasil network module. - */ - config = { - _module.args.hosts = lib.mapAttrs (_: config: { inherit config; } ) meta.network.nodes; - }; -} + /* + This maps hosts to network.nodes from the meta config. This is required for hexchen's yggdrasil network module. + */ + config = { + _module.args.hosts = lib.mapAttrs (_: config: { inherit config; } ) meta.network.nodes; + }; + } diff --git a/depot/modules/nixos/firewall.nix b/depot/modules/nixos/firewall.nix deleted file mode 100644 index 8cc7a6a6..00000000 --- a/depot/modules/nixos/firewall.nix +++ /dev/null @@ -1,80 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; - -let cfg = config.network.firewall; -in -{ - options.network.firewall = { - public.tcp.ports = mkOption { - type = types.listOf types.port; - default = [ ]; - }; - public.udp.ports = mkOption { - type = types.listOf types.port; - default = [ ]; - }; - private.tcp.ports = mkOption { - type = types.listOf types.port; - default = [ ]; - }; - private.udp.ports = mkOption { - type = types.listOf types.port; - default = [ ]; - }; - - public.tcp.ranges = mkOption { - type = types.listOf (types.attrsOf types.port); - default = [ ]; - }; - public.udp.ranges = mkOption { - type = types.listOf (types.attrsOf types.port); - default = [ ]; - }; - private.tcp.ranges = mkOption { - type = types.listOf (types.attrsOf types.port); - default = [ ]; - }; - private.udp.ranges = mkOption { - type = types.listOf (types.attrsOf types.port); - default = [ ]; - }; - - public.interfaces = mkOption { - type = types.listOf types.str; - description = "Public firewall interfaces"; - default = [ ]; - }; - private.interfaces = mkOption { - type = types.listOf types.str; - description = "Private firewall interfaces"; - default = [ ]; - }; - }; - - config = { - networking.firewall.interfaces = - let - fwTypes = { - ports = "Ports"; - ranges = "PortRanges"; - }; - - interfaceDef = visibility: - listToAttrs (flatten (mapAttrsToList - (type: typeString: - map - (proto: { - name = "allowed${toUpper proto}${typeString}"; - value = cfg.${visibility}.${proto}.${type}; - }) [ "tcp" "udp" ]) - fwTypes)); - - interfaces = visibility: - listToAttrs - (map (interface: nameValuePair interface (interfaceDef visibility)) - cfg.${visibility}.interfaces); - in - mkMerge (map (visibility: interfaces visibility) [ "public" "private" ]); - }; -} diff --git a/depot/modules/nixos/fusionpbx.nix b/depot/modules/nixos/fusionpbx.nix deleted file mode 100644 index 2bb665c0..00000000 --- a/depot/modules/nixos/fusionpbx.nix +++ /dev/null @@ -1,415 +0,0 @@ -{ config, pkgs, lib, ... }: - -with lib; - -let - cfg = config.services.fusionpbx; - toKeyValue = generators.toKeyValue { - mkKeyValue = generators.mkKeyValueDefault {} " = "; - }; - php = "${pkgs.php74}/bin/php"; - psql_base = "${pkgs.postgresql_11}/bin/psql"; - psql = if ! cfg.useLocalPostgreSQL then - "${psql_base} --host=${cfg.postgres.host} --port=${cfg.postgres.port} --username=${cfg.postgres.db_username}" - else psql_base; - freeSwitchConfig = pkgs.writeShellScriptBin "copy_config" '' - set -exu - if [[ ! -f "${cfg.home}/state/installed" ]]; then - mkdir -p /etc/freeswitch - cp --no-preserve=mode,ownership -r ${cfg.package}/resources/templates/conf/* /etc/freeswitch - fi - ''; - installerReplacement = pkgs.writeShellScriptBin "installer_replacement" '' - set -exu - - if [[ ! -f "${cfg.home}/state/installed" ]]; then - mkdir -p /var/lib/fusionpbx - - ${if ! cfg.useLocalPostgreSQL then "PGPASSWORD=${cfg.postgres.db_password}" else ""} - ${php} ${cfg.package}/core/upgrade/upgrade_schema.php - - domain_uuid=$(${php} ${cfg.package}/resources/uuid.php); - domain_name=${cfg.domain} - ${psql} -c "insert into v_domains (domain_uuid, domain_name, domain_enabled) values('$domain_uuid', '$domain_name', 'true');" - cd "${cfg.package}" && ${php} ${cfg.package}/core/upgrade/upgrade_domains.php - - user_uuid=$(${php} ${cfg.package}/resources/uuid.php); - user_salt=$(${php} ${cfg.package}/resources/uuid.php); - - password_hash=$(${php} -r "echo md5('$user_salt$USER_PASSWORD');"); - ${psql} -t -c "insert into v_users (user_uuid, domain_uuid, username, password, salt, user_enabled) values('$user_uuid', '$domain_uuid', '$USER_NAME', '$password_hash', '$user_salt', 'true');" - - group_uuid=$(${psql} -qtAX -c "select group_uuid from v_groups where group_name = 'superadmin';"); - group_uuid=$(echo $group_uuid | sed 's/^[[:blank:]]*//;s/[[:blank:]]*$//') -user_group_uuid=$(${php} ${cfg.package}/resources/uuid.php); - group_name=superadmin - #echo "insert into v_user_groups (user_group_uuid, domain_uuid, group_name, group_uuid, user_uuid) values('$user_group_uuid', '$domain_uuid', '$group_name', '$group_uuid', '$user_uuid');" - ${psql} -c "insert into v_user_groups (user_group_uuid, domain_uuid, group_name, group_uuid, user_uuid) values('$user_group_uuid', '$domain_uuid', '$group_name', '$group_uuid', '$user_uuid');" - - xml_cdr_username=$(dd if=/dev/urandom bs=1 count=20 2>/dev/null | base64 | sed 's/[=\+//]//g') - xml_cdr_password=$(dd if=/dev/urandom bs=1 count=20 2>/dev/null | base64 | sed 's/[=\+//]//g') - sed -i /etc/freeswitch/autoload_configs/xml_cdr.conf.xml -e s:"{v_http_protocol}:http:" - sed -i /etc/freeswitch/autoload_configs/xml_cdr.conf.xml -e s:"{v_project_path}::" - sed -i /etc/freeswitch/autoload_configs/xml_cdr.conf.xml -e s:"http:\/\/127.0.0.1:https:\/\/${cfg.domain}" - sed -i /etc/freeswitch/autoload_configs/xml_cdr.conf.xml -e s:"{v_user}:$xml_cdr_username:" - sed -i /etc/freeswitch/autoload_configs/xml_cdr.conf.xml -e s:"{v_pass}:$xml_cdr_password:" - - cd "${cfg.package}" && ${php} ${cfg.package}/core/upgrade/upgrade_domains.php - - mkdir -p ${cfg.home}/state - touch ${cfg.home}/state/installed - fi - ''; -in { - options.services.fusionpbx = { - enable = mkEnableOption "Enable FusionPBX"; - openFirewall = mkEnableOption "Open the firewall for FusionPBX" // { default = true; }; - useLocalPostgreSQL = mkEnableOption "Use Local PostgreSQL for FusionPBX" // { default = true; }; - postgres = { - host = mkOption { - type = types.nullOr types.str; - default = null; - }; - port = mkOption { - type = types.nullOr types.port; - default = null; - }; - db_name = mkOption { - type = types.nullOr types.str; - default = null; - }; - db_username = mkOption { - type = types.nullOr types.str; - default = null; - }; - db_password = mkOption { - type = types.nullOr types.str; - default = null; - }; - }; - - environmentFile = mkOption { - type = types.str; - example = '' - USER_NAME="meow" - USER_PASSWORD="nya" - ''; - }; - - hardphones = mkEnableOption "Are you going to use hardphones with FusionPBX?"; - useWebrootACME = mkEnableOption "Do you want webroot-style ACME cert generation?"; - useACMEHost = mkOption { - type = types.nullOr types.str; - default = null; - }; - - domain = mkOption { - type = types.str; - }; - - package = mkOption { - type = types.package; - description = "What package to use for FusionPBX?"; - default = pkgs.fusionpbx; - relatedPackages = [ - "fusionpbx" - ]; - }; - - freeSwitchPackage = mkOption { - type = types.package; - description = "What package to use for FreeSWITCH?"; - default = pkgs.freeswitch; - relatedPackages = [ - "freeswitch" - ]; - }; - - home = mkOption { - type = types.str; - default = "/var/lib/fusionpbx"; - description = "Storage path for FusionPBX"; - }; - }; - - config = mkIf cfg.enable { - # User & Group Definition - users.users.fusionpbx = { - home = cfg.home; - group = "fusionpbx"; - createHome = true; - isSystemUser = true; - }; - users.groups.fusionpbx.members = [ - "fusionpbx" - config.services.nginx.user - ]; - - # PostgreSQL - services.postgresql = mkIf cfg.useLocalPostgreSQL { - ensureUsers = [ - { - name = "fusionpbx"; - ensurePermissions = { - "DATABASE fusionpbx" = "ALL PRIVILEGES"; - "DATABASE freeswitch" = "ALL PRIVILEGES"; - }; - } - ]; - ensureDatabases = [ "fusionpbx" "freeswitch" ]; - }; - - # ACME - security.acme.certs = mkMerge [ - (mkIf cfg.useWebrootACME { - ${cfg.domain} = { - group = "fusionpbx"; - }; - }) - (mkIf (cfg.useACMEHost != null) { - ${cfg.useACMEHost} = { - postRun = '' - cat {cert,key,chain}.pem >> all.pem - ln -s all.pem agent.pem - ln -s all.pem dlts-srtp.pem - ln -s all.pem tls.pem - ln -s all.pem wss.pem - ''; - }; - }) - ]; - - # NGINX - services.nginx = { - enable = mkDefault true; - virtualHosts.${cfg.domain} = { - enableACME = cfg.useWebrootACME; - useACMEHost = cfg.useACMEHost; - forceSSL = true; - # forceSSL = true; # This might not make sense due to SSL-incapable hardphones? - root = cfg.package; - locations = { - "/" = { - index = "index.php"; - }; - "~ .htaccess".extraConfig = "deny all;"; - "~ .htpassword".extraConfig = "deny all;"; - "~^.+.(db)$".extraConfig = "deny all;"; - "~ \\.php$" = { - extraConfig = '' - include ${pkgs.nginx}/conf/fastcgi_params; - fastcgi_pass unix:${config.services.phpfpm.pools.fusionpbx.socket}; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME ${cfg.package}$fastcgi_script_name; - ''; - }; - " = /core/upgrade/index.php".extraConfig = '' - include ${pkgs.nginx}/conf/fastcgi_params; - fastcgi_pass unix:${config.services.phpfpm.pools.fusionpbx.socket}; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME ${cfg.package}$fastcgi_script_name; - fastcgi_read_timeout 15m; - ''; - }; - /* - if ($uri !~* ^.*(provision|xml_cdr).*$) { - rewrite ^(.*) https://$host$1 permanent; - break; - } - */ - extraConfig = '' - client_max_body_size 80M; - client_body_buffer_size 128k; - - - #REST api - if ($uri ~* ^.*/api/.*$) { - rewrite ^(.*)/api/(.*)$ $1/api/index.php?rewrite_uri=$2 last; - break; - } - '' + optionalString cfg.hardphones '' - #algo - rewrite "^.*/provision/algom([A-Fa-f0-9]{12})(\.(conf))?$" /app/provision/?mac=$1; - - #mitel - rewrite "^.*/provision/MN_([A-Fa-f0-9]{12})\.cfg" /app/provision/index.php?mac=$1&file=MN_%7b%24mac%7d.cfg last; - rewrite "^.*/provision/MN_Generic.cfg" /app/provision/index.php?mac=08000f000000&file=MN_Generic.cfg last; - - #grandstream - rewrite "^.*/provision/cfg([A-Fa-f0-9]{12})(\.(xml|cfg))?$" /app/provision/?mac=$1; - rewrite "^.*/provision/pb([A-Fa-f0-9-]{12,17})/phonebook\.xml$" /app/provision/?mac=$1&file=phonebook.xml; - #grandstream-wave softphone by ext because Android doesn't pass MAC. - rewrite "^.*/provision/([0-9]{5})/cfg([A-Fa-f0-9]{12}).xml$" /app/provision/?ext=$1; - - #aastra - rewrite "^.*/provision/aastra.cfg$" /app/provision/?mac=$1&file=aastra.cfg; - #rewrite "^.*/provision/([A-Fa-f0-9]{12})(\.(cfg))?$" /app/provision/?mac=$1 last; - - #yealink common - rewrite "^.*/provision/(y[0-9]{12})(\.cfg)?$" /app/provision/index.php?file=$1.cfg; - - #yealink mac - rewrite "^.*/provision/([A-Fa-f0-9]{12})(\.(xml|cfg))?$" /app/provision/index.php?mac=$1 last; - - #polycom - rewrite "^.*/provision/000000000000.cfg$" "/app/provision/?mac=$1&file={%24mac}.cfg"; - #rewrite "^.*/provision/sip_330(\.(ld))$" /includes/firmware/sip_330.$2; - rewrite "^.*/provision/features.cfg$" /app/provision/?mac=$1&file=features.cfg; - rewrite "^.*/provision/([A-Fa-f0-9]{12})-sip.cfg$" /app/provision/?mac=$1&file=sip.cfg; - rewrite "^.*/provision/([A-Fa-f0-9]{12})-phone.cfg$" /app/provision/?mac=$1; - rewrite "^.*/provision/([A-Fa-f0-9]{12})-registration.cfg$" "/app/provision/?mac=$1&file={%24mac}-registration.cfg"; - rewrite "^.*/provision/([A-Fa-f0-9]{12})-directory.xml$" "/app/provision/?mac=$1&file={%24mac}-directory.xml"; - - #cisco - rewrite "^.*/provision/file/(.*\.(xml|cfg))" /app/provision/?file=$1 last; - - #Escene - rewrite "^.*/provision/([0-9]{1,11})_Extern.xml$" "/app/provision/?ext=$1&file={%24mac}_extern.xml" last; - rewrite "^.*/provision/([0-9]{1,11})_Phonebook.xml$" "/app/provision/?ext=$1&file={%24mac}_phonebook.xml" last; - - #Vtech - rewrite "^.*/provision/VCS754_([A-Fa-f0-9]{12})\.cfg$" /app/provision/?mac=$1; - rewrite "^.*/provision/pb([A-Fa-f0-9-]{12,17})/directory\.xml$" /app/provision/?mac=$1&file=directory.xml; - - #Digium - rewrite "^.*/provision/([A-Fa-f0-9]{12})-contacts\.cfg$" "/app/provision/?mac=$1&file={%24mac}-contacts.cfg"; - rewrite "^.*/provision/([A-Fa-f0-9]{12})-smartblf\.cfg$" "/app/provision/?mac=$1&file={%24mac}-smartblf.cfg"; - ''; - }; - }; - - # PHP 7.4 - services.phpfpm = { - pools.fusionpbx = { - user = "fusionpbx"; - group = "fusionpbx"; - phpEnv = { - PATH = "/run/wrappers/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:/usr/bin:/bin"; - }; - settings = { - "pm" = "dynamic"; - "pm.max_children" = "32"; - "pm.start_servers" = "2"; - "pm.min_spare_servers" = "2"; - "pm.max_spare_servers" = "4"; - "pm.max_requests" = "500"; - "listen.owner" = "fusionpbx"; - "listen.group" = config.services.nginx.group; - }; - phpPackage = pkgs.php74.buildEnv { - extensions = { enabled, all }: ( - with all; - enabled ++ [ - imap - pgsql - curl - opcache - pdo - pdo_pgsql - soap - xmlrpc - gd - ] - ); - extraConfig = toKeyValue { - }; - }; - }; - }; - - # FreeSWITCH - systemd.tmpfiles.rules = [ - "v /etc/freeswitch 5777 fusionpbx fusionpbx" - "v /etc/fusionpbx 5777 fusionpbx fusionpbx" - "v /var/cache/fusionpbx 5777 fusionpbx fusionpbx" - ]; - - systemd.services.freeswitch = let - pkg = cfg.freeSwitchPackage; - configPath = "/etc/freeswitch"; - in { - description = "Free and open-source application server for real-time communication"; - after = [ "network.target" ]; - wantedBy = [ "multi-user.target" ]; - serviceConfig = { - User = "fusionpbx"; - Group = "fusionpbx"; - StateDirectory = "freeswitch"; - ExecStartPre = "${freeSwitchConfig}/bin/copy_config"; - ExecStart = "${pkg}/bin/freeswitch -nf \\ - -mod ${pkg}/lib/freeswitch/mod \\ - -conf ${configPath} \\ - -base /var/lib/freeswitch"; - ExecReload = "${pkg}/bin/fs_cli -x reloadxml"; - Restart = "on-failure"; - RestartSec = "5s"; - CPUSchedulingPolicy = "fifo"; - }; - }; - - systemd.services.fusionpbx = { - after = [ "network.target" ]; - wantedBy = [ "freeswitch.service" ]; - script = "${installerReplacement}/bin/installer_replacement"; - serviceConfig = { - EnvironmentFile = cfg.environmentFile; - User = "fusionpbx"; - Group = "fusionpbx"; - Type = "oneshot"; - StateDirectory = "fusionpbx"; - }; - }; - - # FusionPBX Config - environment.etc."fusionpbx/config.php" = { - user = "nginx"; - group = "fusionpbx"; - text = let - hostConfig = if cfg.useLocalPostgreSQL then '' - $db_type = 'pgsql'; - $db_host = '''; - $db_port = '''; - $db_name = 'fusionpbx'; - $db_username = 'fusionpbx'; - $db_password = '''; - '' else '' - $db_type = 'pgsql'; - $db_host = '${cfg.postgres.host}'; - $db_port = '${toString cfg.postgres.port}'; - $db_name = '${cfg.postgres.db_name}'; - $db_username = '${cfg.postgres.db_username}'; - $db_password = '${cfg.postgres.db_password}'; - ''; in '' - - ''; - }; - - # Firewall - network.firewall = mkIf cfg.openFirewall { - public = { - tcp = { - ports = [ 5060 5061 5080 5081 ]; - ranges = [ - { - from = 10000; - to = 20000; - } - ]; - }; - udp = { - ports = [ 5060 5061 5080 5081 ]; - ranges = [ - { - from = 10000; - to = 20000; - } - ]; - }; - }; - }; - }; -} diff --git a/depot/modules/nixos/network.nix b/depot/modules/nixos/network.nix deleted file mode 100644 index 63c3cb5b..00000000 --- a/depot/modules/nixos/network.nix +++ /dev/null @@ -1,174 +0,0 @@ -{ config, lib, tf, ... }: - -with lib; - -let - cfg = config.network; -in { - options.network = { - addresses = mkOption { - type = with types; attrsOf (submodule ({ name, options, config, ... }: { - options = { - enable = mkEnableOption "Is the system a part of the ${name} network?" // { - default = config.ipv4.enable || config.ipv6.enable; - }; - ipv4 = { - enable = mkOption { - type = types.bool; - default = options.ipv4.address.isDefined; - }; - address = mkOption { - type = types.str; - }; - }; - ipv6 = { - enable = mkOption { - type = types.bool; - default = options.ipv6.address.isDefined; - }; - address = mkOption { - type = types.str; - }; - }; - prefix = mkOption { - type = types.nullOr types.str; - }; - subdomain = mkOption { - type = types.nullOr types.str; - }; - domain = mkOption { - type = types.nullOr types.str; - default = "${config.subdomain}.${cfg.dns.domain}"; - }; - out = { - identifierList = mkOption { - type = types.listOf types.str; - default = if config.enable then singleton config.domain ++ config.out.addressList else [ ]; - }; - addressList = mkOption { - type = types.listOf types.str; - default = if config.enable then concatMap (i: optional i.enable i.address) [ config.ipv4 config.ipv6 ] else [ ]; - }; - }; - }; - })); - }; - privateGateway = mkOption { - type = types.str; - default = "192.168.1.254"; - }; - tf = { - enable = mkEnableOption "Was the system provisioned by terraform?"; - ipv4_attr = mkOption { - type = types.str; - default = "ipv4_address"; - }; - ipv6_attr = mkOption { - type = types.str; - default = "ipv6_address"; - }; - }; - dns = { - isRoot = mkEnableOption "Is this system supposed to be the @ for the domain?"; # TODO - email = mkOption { - type = types.nullOr types.str; - }; - tld = mkOption { - type = types.nullOr types.str; - }; - domain = mkOption { - type = types.nullOr types.str; - }; - }; - }; - - config = let - networks = cfg.addresses; - networksWithDomains = filterAttrs (_: v: v.subdomain != null && v.enable) networks; - in { - lib.kw.virtualHostGen = args: virtualHostGen ({ inherit config; } // args); - - network = { - dns = { - email = "kat@kittywit.ch"; - tld = "kittywit.ch."; - domain = builtins.substring 0 ((builtins.stringLength cfg.dns.tld) - 1) cfg.dns.tld; - }; - addresses = { - private = { - prefix = "int"; - subdomain = "${config.networking.hostName}.${cfg.addresses.private.prefix}"; - }; - public = mkMerge [ - (mkIf cfg.tf.enable { - ipv4.address = mkIf (cfg.tf.ipv4_attr != null) (tf.resources."${config.networking.hostName}".refAttr config.network.tf.ipv4_attr); - ipv6.address = mkIf (cfg.tf.ipv6_attr != null) (tf.resources."${config.networking.hostName}".refAttr config.network.tf.ipv6_attr); - }) - ({ - subdomain = "${config.networking.hostName}"; - }) - ]; - yggdrasil = mkIf cfg.yggdrasil.enable { - ipv6.address = cfg.yggdrasil.address; - prefix = "ygg"; - subdomain = "${config.networking.hostName}.${cfg.addresses.yggdrasil.prefix}"; - }; - }; - }; - - networking = mkIf cfg.addresses.private.enable { - inherit (config.network.dns) domain; - defaultGateway = cfg.privateGateway; - }; - - deploy.tf.dns.records = let - recordsV4 = mapAttrs' (n: v: - nameValuePair "node_${n}_${config.networking.hostName}_v4" { - enable = v.ipv4.enable; - tld = cfg.dns.tld; - domain = v.subdomain; - a.address = v.ipv4.address; - }) networksWithDomains; - recordsV6 = mapAttrs' (n: v: - nameValuePair "node_${n}_${config.networking.hostName}_v6" { - enable = v.ipv6.enable; - tld = cfg.dns.tld; - domain = v.subdomain; - aaaa.address = v.ipv6.address; - }) networksWithDomains; - in mkMerge [ - recordsV4 - recordsV6 - (mkIf cfg.dns.isRoot { - "node_root_${config.networking.hostName}_v4" = { - enable = cfg.addresses.public.enable; - tld = cfg.dns.tld; - domain = "@"; - a.address = cfg.addresses.public.ipv4.address; - }; - "node_root_${config.networking.hostName}_v6" = { - enable = cfg.addresses.public.enable; - tld = cfg.dns.tld; - domain = "@"; - aaaa.address = cfg.addresses.public.ipv6.address; - }; - }) - ]; - - security.acme.certs = mkIf config.services.nginx.enable (mapAttrs' (n: v: - nameValuePair "cert_${n}_${config.networking.hostName}" { - inherit (v) domain; - dnsProvider = "rfc2136"; - credentialsFile = config.secrets.files.dns_creds.path; - group = "nginx"; - }) networksWithDomains); - - services.nginx.virtualHosts = mkIf config.services.nginx.enable (mapAttrs' (n: v: - nameValuePair v.domain { - useACMEHost = "cert_${n}_${config.networking.hostName}"; - forceSSL = true; - }) networksWithDomains); - - _module.args = { inherit (config.lib) kw; }; - }; -} diff --git a/depot/modules/nixos/nftables.nix b/depot/modules/nixos/nftables.nix deleted file mode 100644 index 035d248d..00000000 --- a/depot/modules/nixos/nftables.nix +++ /dev/null @@ -1,134 +0,0 @@ -{ pkgs, lib, config, modulesPath, ... }: - -let - fwcfg = config.networking.firewall; - cfg = config.network.nftables; - - doDocker = config.virtualisation.docker.enable && cfg.generateDockerRules; - - mkPorts = cond: ports: ranges: action: let - portStrings = (map (range: "${toString range.from}-${toString range.to}") ranges) - ++ (map toString ports); - in lib.optionalString (portStrings != []) '' - ${cond} dport { ${lib.concatStringsSep ", " portStrings} } ${action} - ''; - - ruleset = '' - table inet filter { - chain input { - type filter hook input priority filter - policy ${cfg.inputPolicy} - - icmpv6 type { echo-request, echo-reply, mld-listener-query, mld-listener-report, mld-listener-done, nd-router-advert, nd-neighbor-solicit, nd-neighbor-advert, packet-too-big } accept - icmp type echo-request accept - - ct state invalid drop - ct state established,related accept - - iifname { ${ - lib.concatStringsSep "," (["lo"] ++ fwcfg.trustedInterfaces) - } } accept - - ${mkPorts "tcp" fwcfg.allowedTCPPorts fwcfg.allowedTCPPortRanges "accept"} - ${mkPorts "udp" fwcfg.allowedUDPPorts fwcfg.allowedUDPPortRanges "accept"} - - ${ - lib.concatStringsSep "\n" (lib.mapAttrsToList (name: ifcfg: - mkPorts "iifname ${name} tcp" ifcfg.allowedTCPPorts ifcfg.allowedTCPPortRanges "accept" - + mkPorts "iifname ${name} udp" ifcfg.allowedUDPPorts ifcfg.allowedUDPPortRanges "accept" - ) fwcfg.interfaces) - } - - # DHCPv6 - ip6 daddr fe80::/64 udp dport 546 accept - - ${cfg.extraInput} - - counter - } - chain output { - type filter hook output priority filter - policy ${cfg.outputPolicy} - - ${cfg.extraOutput} - - counter - } - chain forward { - type filter hook forward priority filter - policy ${cfg.forwardPolicy} - - ${lib.optionalString doDocker '' - oifname docker0 ct state invalid drop - oifname docker0 ct state established,related accept - iifname docker0 accept - ''} - - ${cfg.extraForward} - - counter - } - } - ${lib.optionalString doDocker '' - table ip nat { - chain docker-postrouting { - type nat hook postrouting priority 10 - iifname docker0 masquerade - } - } - ''} - ${cfg.extraConfig} - ''; - -in { - options = with lib; { - network.nftables = { - enable = mkEnableOption "nftables firewall"; - - extraConfig = mkOption { - type = types.lines; - default = ""; - }; - extraInput = mkOption { - type = types.lines; - default = ""; - }; - extraOutput = mkOption { - type = types.lines; - default = ""; - }; - extraForward = mkOption { - type = types.lines; - default = ""; - }; - inputPolicy = mkOption { - type = types.str; - default = "drop"; - }; - outputPolicy = mkOption { - type = types.str; - default = "accept"; - }; - forwardPolicy = mkOption { - type = types.str; - default = "accept"; - }; - generateDockerRules = mkOption { - type = types.bool; - default = true; - }; - }; - }; - - config = lib.mkIf cfg.enable { - networking.firewall.enable = false; - networking.nftables = { - enable = true; - inherit ruleset; - }; - - virtualisation.docker = lib.mkIf doDocker { - extraOptions = "--iptables=false"; - }; - }; -} diff --git a/depot/profiles/base/default.nix b/depot/profiles/base/default.nix index 4175fc65..25d1463b 100644 --- a/depot/profiles/base/default.nix +++ b/depot/profiles/base/default.nix @@ -7,6 +7,7 @@ users.arc users.hexchen ./system.nix + ./dns.nix ./home.nix ./profiles.nix ./shell.nix diff --git a/depot/profiles/base/dns.nix b/depot/profiles/base/dns.nix new file mode 100644 index 00000000..b66cbe58 --- /dev/null +++ b/depot/profiles/base/dns.nix @@ -0,0 +1,8 @@ +{ config, ... }: + +{ + network.dns = { + email = "kat@kittywit.ch"; + tld = "kittywit.ch."; + }; +} diff --git a/depot/profiles/base/nix.nix b/depot/profiles/base/nix.nix index 54d00262..6d522bb7 100644 --- a/depot/profiles/base/nix.nix +++ b/depot/profiles/base/nix.nix @@ -4,11 +4,17 @@ boot.loader.grub.configurationLimit = 8; boot.loader.systemd-boot.configurationLimit = 8; + environment.systemPackages = [ + (pkgs.writeShellScriptBin "nixFlakes" '' + exec ${pkgs.nixUnstable}/bin/nix --experimental-features "nix-command flakes" "$@" + '') + ]; + nix = { nixPath = [ "nixpkgs=${sources.nixpkgs}" "nur=${sources.nur}" - "arc=${sources.nixexprs}" + "arc=${sources.arcexprs}" "ci=${sources.ci}" ]; sandboxPaths = [ diff --git a/depot/profiles/vfio/default.nix b/depot/profiles/vfio/default.nix index a9a1215b..731fe385 100644 --- a/depot/profiles/vfio/default.nix +++ b/depot/profiles/vfio/default.nix @@ -2,12 +2,16 @@ with lib; -{ +let + win10-screenstub = pkgs.writeShellScriptBin "win10-screenstub" '' + ${pkgs.screenstub-kat}/bin/screenstub -c "${./screenstub.yml}" x + ''; +in { deploy.profile.vfio = true; environment.systemPackages = with pkgs; [ - screenstub - kat-vm + screenstub-kat + win10-vm ddcutil ]; diff --git a/depot/services/fusionpbx/default.nix b/depot/services/fusionpbx/default.nix index 5b50fe8f..66801be5 100644 --- a/depot/services/fusionpbx/default.nix +++ b/depot/services/fusionpbx/default.nix @@ -40,4 +40,12 @@ package = with pkgs; fusionpbxWithApps [ fusionpbx-apps.sms ]; freeSwitchPackage = with pkgs; freeswitch; }; + + services.nginx.virtualHosts."altar.kittywit.ch" = { + locations = { + "app/sms/hook/" = { + proxyPass = "http://pbx.kittywit.ch/app/sms/hook"; + }; + }; + }; } diff --git a/depot/services/katsplash/default.nix b/depot/services/katsplash/default.nix index 530f92a7..9e5395fc 100644 --- a/depot/services/katsplash/default.nix +++ b/depot/services/katsplash/default.nix @@ -1,6 +1,6 @@ { config, pkgs, kw, ... }: -let splashy = pkgs.kat-splash config.networking.hostName; in { +let splashy = pkgs.host-splash-site config.networking.hostName; in { services.nginx.virtualHosts = kw.virtualHostGen { networkFilter = ["private"]; block.locations."/" = { root = splashy; }; diff --git a/depot/services/website/default.nix b/depot/services/website/default.nix index 4a70ec97..a6f8b048 100644 --- a/depot/services/website/default.nix +++ b/depot/services/website/default.nix @@ -5,7 +5,7 @@ services.nginx.virtualHosts = { "${config.network.dns.domain}" = { - root = pkgs.kat-website; + root = pkgs.kittywitch-site; enableACME = true; forceSSL = true; }; diff --git a/depot/users/kairi/base.nix b/depot/users/kairi/base.nix deleted file mode 100644 index 409cb9c8..00000000 --- a/depot/users/kairi/base.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ config, pkgs, lib, ... }: - -{ - home-manager.users.kairi = { - imports = [ ./base ]; - home.stateVersion = "20.09"; - }; - - users.users.kairi = { - uid = 1003; - isNormalUser = true; - openssh.authorizedKeys.keys = [ - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCocjQqiDIvzq+Qu3jkf7FXw5piwtvZ1Mihw9cVjdVcsra3U2c9WYtYrA3rS50N3p00oUqQm9z1KUrvHzdE+03ZCrvaGdrtYVsaeoCuuvw7qxTQRbItTAEsfRcZLQ5c1v/57HNYNEsjVrt8VukMPRXWgl+lmzh37dd9w45cCY1QPi+JXQQ/4i9Vc3aWSe4X6PHOEMSBHxepnxm5VNHm4PObGcVbjBf0OkunMeztd1YYA9sEPyEK3b8IHxDl34e5t6NDLCIDz0N/UgzCxSxoz+YJ0feQuZtud/YLkuQcMxW2dSGvnJ0nYy7SA5DkW1oqcy6CGDndHl5StOlJ1IF9aGh0gGkx5SRrV7HOGvapR60RphKrR5zQbFFka99kvSQgOZqSB3CGDEQGHv8dXKXIFlzX78jjWDOBT67vA/M9BK9FS2iNnBF5x6shJ9SU5IK4ySxq8qvN7Us8emkN3pyO8yqgsSOzzJT1JmWUAx0tZWG/BwKcFBHfceAPQl6pwxx28TM3BTBRYdzPJLTkAy48y6iXW6UYdfAPlShy79IYjQtEThTuIiEzdzgYdros0x3PDniuAP0KOKMgbikr0gRa6zahPjf0qqBnHeLB6nHAfaVzI0aNbhOg2bdOueE1FX0x48sjKqjOpjlIfq4WeZp9REr2YHEsoLFOBfgId5P3BPtpBQ== cardno:000612078454" - ]; - shell = pkgs.zsh; - extraGroups = [ "wheel" "video" "systemd-journal" ]; - hashedPassword = - "$6$i28yOXoo$/WokLdKds5ZHtJHcuyGrH2WaDQQk/2Pj0xRGLgS8UcmY2oMv3fw2j/85PRpsJJwCB2GBRYRK5LlvdTleHd3mB."; - }; -} diff --git a/depot/users/kairi/base/base16.nix b/depot/users/kairi/base/base16.nix deleted file mode 100644 index 1f77b680..00000000 --- a/depot/users/kairi/base/base16.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ config, ... }: - -{ - base16 = { - shell.enable = true; - schemes = [ "rebecca.rebecca" ]; - }; - # home.base16-shell = { - # enable = true; - # defaultTheme = "rebecca.rebecca"; - # }; -} diff --git a/depot/users/kairi/base/default.nix b/depot/users/kairi/base/default.nix deleted file mode 100644 index da44b006..00000000 --- a/depot/users/kairi/base/default.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ ... }: - -{ - imports = [ - ./vim - ./zsh.nix - ./git.nix - ./kitty.nix - ./tmux.nix - ./base16.nix - ./xdg.nix - ./ssh.nix - ./packages.nix - ./weechat.nix - ./inputrc.nix - ./rink.nix - ./secrets.nix - ]; -} diff --git a/depot/users/kairi/base/git.nix b/depot/users/kairi/base/git.nix deleted file mode 100644 index 99387e52..00000000 --- a/depot/users/kairi/base/git.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ config, pkgs, lib, ... }: - -{ - home.packages = with pkgs; [ - git-crypt - gitAndTools.gitRemoteGcrypt - gitAndTools.gitAnnex - git-revise - gitAndTools.git-annex-remote-b2 - ]; - - programs.git = { - enable = true; - package = pkgs.gitAndTools.gitFull; - userName = "kat witch"; - userEmail = "kat@kittywit.ch"; - extraConfig = { - init = { defaultBranch = "main"; }; - protocol.gcrypt.allow = "always"; - annex = { - autocommit = false; - backend = "BLAKE2B512"; - synccontent = true; - }; - }; - signing = { - key = "01F50A29D4AA91175A11BDB17248991EFA8EFBEE"; - signByDefault = true; - }; - }; -} diff --git a/depot/users/kairi/base/inputrc.nix b/depot/users/kairi/base/inputrc.nix deleted file mode 100644 index 8950b4b1..00000000 --- a/depot/users/kairi/base/inputrc.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ config, ... }: - -{ - xdg.configFile."inputrc".text = '' - set editing-mode vi - set keyseq-timeout 1 - set mark-symlinked-directories on - set completion-prefix-display-length 8 - set show-all-if-ambiguous on - set show-all-if-unmodified on - set visible-stats on - set colored-stats on - set bell-style audible - set meta-flag on - set input-meta on - set convert-meta off - set output-meta on - ''; - - home.sessionVariables.INPUTRC = "${config.xdg.configHome}/inputrc"; -} diff --git a/depot/users/kairi/base/kitty.nix b/depot/users/kairi/base/kitty.nix deleted file mode 100644 index bcea5f5a..00000000 --- a/depot/users/kairi/base/kitty.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ config, pkgs, ... }: - -{ -# home.sessionVariables.TERMINFO_DIRS = -# "${pkgs.kitty.terminfo.outPath}/share/terminfo"; -} diff --git a/depot/users/kairi/base/nano.png b/depot/users/kairi/base/nano.png deleted file mode 100644 index 073e24c2..00000000 Binary files a/depot/users/kairi/base/nano.png and /dev/null differ diff --git a/depot/users/kairi/base/packages.nix b/depot/users/kairi/base/packages.nix deleted file mode 100644 index e1930303..00000000 --- a/depot/users/kairi/base/packages.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - home.packages = with pkgs; [ - tmate - htop - fd - sd - duc - bat - exa - socat - rsync - wget - ripgrep - nixpkgs-fmt - pv - progress - zstd - file - whois - niv - dnsutils - borgbackup - neofetch - ]; -} diff --git a/depot/users/kairi/base/rink.nix b/depot/users/kairi/base/rink.nix deleted file mode 100644 index 984e72ae..00000000 --- a/depot/users/kairi/base/rink.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - home.packages = with pkgs; [ - rink-readline - ]; - - xdg.configFile."rink/config.toml".text = lib.toTOML { - colors = { - enabled = true; - theme = "my_theme"; - }; - currency = { - cache_duration = "1h"; - enabled = true; - endpoint = "https://rinkcalc.app/data/currency.json"; - timeout = "2s"; - }; - rink = { - long_output = true; - prompt = "> "; - }; - themes = { - my_theme = { - date_time = "default"; - doc_string = "italic"; - error = "red"; - number = "default"; - plain = "default"; - pow = "default"; - prop_name = "cyan"; - quantity = "dimmed cyan"; - unit = "cyan"; - user_input = "bold"; - }; - }; - }; -} diff --git a/depot/users/kairi/base/secrets.nix b/depot/users/kairi/base/secrets.nix deleted file mode 100644 index f4cd72b2..00000000 --- a/depot/users/kairi/base/secrets.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ config, lib, ... }: - -{ - secrets = { - persistentRoot = config.xdg.cacheHome + "/kat/secrets"; - external = true; - }; -} - diff --git a/depot/users/kairi/base/ssh.nix b/depot/users/kairi/base/ssh.nix deleted file mode 100644 index 8627dff5..00000000 --- a/depot/users/kairi/base/ssh.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ config, pkgs, lib, ... }: - -{ - programs.ssh = { - enable = true; - controlMaster = "auto"; - controlPersist = "10m"; - hashKnownHosts = true; - matchBlocks = - let - common = { - forwardAgent = true; - extraOptions = { - RemoteForward = - "/run/user/1000/gnupg/S.gpg-agent /run/user/1000/gnupg/S.gpg-agent.extra"; - }; - port = 62954; - }; - in - { - "athame" = { hostname = "athame.kittywit.ch"; } // common; - "samhain" = { hostname = "192.168.1.135"; } // common; - "yule" = { hostname = "192.168.1.92"; } // common; - "ostara" = { hostname = "192.168.1.245"; } // common; - }; - }; -} diff --git a/depot/users/kairi/base/tmux.nix b/depot/users/kairi/base/tmux.nix deleted file mode 100644 index 2c2ab5e0..00000000 --- a/depot/users/kairi/base/tmux.nix +++ /dev/null @@ -1,53 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - programs.zsh.shellAliases = { - tt = "tmux new -AD -s"; - }; - programs.tmux = { - enable = true; - extraConfig = '' - # start from 1 - set -g base-index 1 - setw -g pane-base-index 1 - - # proper title handling - set -g set-titles on - set -g set-titles-string "#T" - - # 256 color - set -g default-terminal "screen-256color" - - # modes - setw -g clock-mode-colour colour5 - setw -g mode-style 'fg=colour1 bg=colour18 bold' - - # panes - set -g pane-border-style 'fg=colour19 bg=colour0' - set -g pane-active-border-style 'bg=colour0 fg=colour9' - - # statusbar - set -g status-position bottom - set -g status-justify left - set -g status-style 'bg=colour18 fg=colour137 dim' - set -g status-left ''' - set -g status-right '#[fg=colour233,bg=colour19] %F #[fg=colour233,bg=colour8] %H:%M:%S %Z' - set -g status-right-length 50 - set -g status-left-length 20 - - setw -g window-status-current-style 'fg=colour1 bg=colour19 bold' - setw -g window-status-current-format ' #I#[fg=colour249]:#[fg=colour255]#W#[fg=colour249]#F ' - - setw -g window-status-style 'fg=colour9 bg=colour18' - setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F ' - - setw -g window-status-bell-style 'fg=colour255 bg=colour1 bold' - - # messages - set -g message-style 'fg=colour232 bg=colour16 bold' - - # mouse - set -g mouse on - ''; - }; -} diff --git a/depot/users/kairi/base/vim/default.nix b/depot/users/kairi/base/vim/default.nix deleted file mode 100644 index 23a9c6fa..00000000 --- a/depot/users/kairi/base/vim/default.nix +++ /dev/null @@ -1,59 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - home.sessionVariables.EDITOR = "vim"; - programs.vim = { - enable = true; - settings = {}; - package = pkgs.vim_configurable-pynvim; - #withPython3 = true; - plugins = with pkgs.vimPlugins; [ - nerdtree - vim-nix - rust-vim - coc-nvim - coc-rust-analyzer - coc-yank - coc-python - coc-json - coc-yaml - coc-git - coc-css - coc-html - vim-fugitive - vim-startify - vim-airline - vim-airline-themes - vim-lastplace - base16-vim - ]; - #extraPackages = with pkgs; - # [ (python3.withPackages (ps: with ps; [ black flake8 ])) ]; - #extraPython3Packages = (ps: with ps; [ jedi pylint ]); - extraConfig = import ./vimrc.nix { inherit pkgs config; }; - }; - xdg.dataFile = { - "vim/undo/.keep".text = ""; - "vim/swap/.keep".text = ""; - "vim/backup/.keep".text = ""; - }; - xdg.configFile = { - "vim/coc/coc-settings.json".text = builtins.toJSON { - "rust.rustfmt_path" = "${pkgs.rustfmt}/bin/rustfmt"; - "rust-analyzer.serverPath" = "rust-analyzer"; - "rust-analyzer.updates.prompt" = false; - "rust-analyzer.notifications.cargoTomlNotFound" = false; - "rust-analyzer.notifications.workspaceLoaded" = false; - "rust-analyzer.procMacro.enable" = true; - "rust-analyzer.cargo.loadOutDirsFromCheck" = true; - "rust-analyzer.cargo-watch.enable" = - true; # TODO: want some way to toggle this on-demand? - "rust-analyzer.completion.addCallParenthesis" = - false; # consider using this? - "rust-analyzer.hoverActions.linksInHover" = true; - "rust-analyzer.diagnostics.disabled" = [ - "inactive-code" # it has strange cfg support..? - ]; - }; - }; -} diff --git a/depot/users/kairi/base/vim/vimrc.nix b/depot/users/kairi/base/vim/vimrc.nix deleted file mode 100644 index 8577b013..00000000 --- a/depot/users/kairi/base/vim/vimrc.nix +++ /dev/null @@ -1,200 +0,0 @@ -{ config, pkgs }: - -'' - source ${pkgs.writeText "vimrc" '' - set encoding=utf-8 - scriptencoding utf-8 - set list listchars=tab:»\ ,extends:›,precedes:‹,nbsp:·,trail:✖ - ''}"; - " Enable mouse - set mouse=a - set ttymouse=sgr - - set viminfo='100000,<100000,s1000,h,n$XDG_DATA_HOME/vim/viminfo - - " colors - let base16colorspace=256 - colorscheme base16-default-dark - - " tabline - let g:airline#extensions#tabline#enabled = 1 - - " notmuch! - let g:notmuch_config_file='${config.xdg.configHome}/notmuch/notmuchrc' - let g:notmuch_folders_count_threads=0 - let g:notmuch_date_format='%y-%m-%d %H:%M' - let g:notmuch_datetime_format='%y-%m-%d %H:%M' - let g:notmuch_show_date_format='%Y/%m/%d %H:%M' - let g:notmuch_search_date_format='%Y/%m/%d %H:%M' - let g:notmuch_html_converter='${pkgs.elinks}/bin/elinks --dump' - - " lastplace - let g:lastplace_ignore = "gitcommit,gitrebase,svn,hgcommit" - - autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | - \ quit | endif - autocmd BufEnter * if bufname('#') =~ 'NERD_tree_\d\+' && bufname('%') !~ 'NERD_tree_\d\+' && winnr('$') > 1 | - \ let buf=bufnr() | buffer# | execute "normal! \w" | execute 'buffer'.buf | endif - nnoremap n :NERDTreeFocus - nnoremap :NERDTree - nnoremap :NERDTreeToggle - nnoremap :NERDTreeFind - - let g:coc_node_path='${pkgs.nodejs}/bin/node' - let g:coc_config_home=$XDG_CONFIG_HOME . '/vim/coc' - - set undodir=$XDG_DATA_HOME/vim/undo - set directory=$XDG_DATA_HOME/vim/swap// - set backupdir=$XDG_DATA_HOME/vim/backup - - set ttimeoutlen=100 - set number - set hidden - set nobackup - set nowritebackup - set cmdheight=2 - set updatetime=300 - set cursorline - set colorcolumn=100 - set linebreak showbreak=↪ " ↳ - set hlsearch - set relativenumber - set completeopt=longest,menuone - - command Spaces set expandtab - command Tabs set noexpandtab - - inoremap - \ pumvisible() ? "\" : - \ check_back_space() ? "\" : - \ coc#refresh() - inoremap pumvisible() ? "\" : "\" - - function! s:check_back_space() abort - let col = col('.') - 1 - return !col || getline('.')[col - 1] =~# '\s' - endfunction - - " Use to trigger completion. - if has('nvim') - inoremap coc#refresh() - else - inoremap coc#refresh() - endif - - " Make auto-select the first completion item and notify coc.nvim to - " format on enter, could be remapped by other vim plugin - noremap pumvisible() ? coc#_select_confirm() - \: "\u\\=coc#on_enter()\" - - " Use `[g` and `]g` to navigate diagnostics - " Use `:CocDiagnostics` to get all diagnostics of current buffer in location list. - nmap [g (coc-diagnostic-prev) - nmap ]g (coc-diagnostic-next) - - " GoTo code navigation. - nmap gd (coc-definition) - nmap gy (coc-type-definition) - nmap gi (coc-implementation) - nmap gr (coc-references) - - " Use K to show documentation in preview window. - nnoremap K :call show_documentation() - - function! s:show_documentation() - if (index(['vim','help'], &filetype) >= 0) - execute 'h '.expand('') - elseif (coc#rpc#ready()) - call CocActionAsync('doHover') - else - execute '!' . &keywordprg . " " . expand('') - endif - endfunction - - " Highlight the symbol and its references when holding the cursor. - autocmd CursorHold * silent call CocActionAsync('highlight') - - " Symbol renaming. - nmap rn (coc-rename) - - " Formatting selected code. - xmap f (coc-format-selected) - nmap f (coc-format-selected) - - augroup mygroup - autocmd! - " Setup formatexpr specified filetype(s). - autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected') - " Update signature help on jump placeholder. - autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp') - augroup end - - " Applying codeAction to the selected region. - " Example: `aap` for current paragraph - xmap a (coc-codeaction-selected) - nmap a (coc-codeaction-selected) - - " Remap keys for applying codeAction to the current buffer. - nmap ac (coc-codeaction) - " Apply AutoFix to problem on the current line. - nmap qf (coc-fix-current) - - " Map function and class text objects - " NOTE: Requires 'textDocument.documentSymbol' support from the language server. - xmap if (coc-funcobj-i) - omap if (coc-funcobj-i) - xmap af (coc-funcobj-a) - omap af (coc-funcobj-a) - xmap ic (coc-classobj-i) - omap ic (coc-classobj-i) - xmap ac (coc-classobj-a) - omap ac (coc-classobj-a) - - " Remap and for scroll float windows/popups. - if has('nvim-0.4.0') || has('patch-8.2.0750') - nnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" - nnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" - inoremap coc#float#has_scroll() ? "\=coc#float#scroll(1)\" : "\" - inoremap coc#float#has_scroll() ? "\=coc#float#scroll(0)\" : "\" - vnoremap coc#float#has_scroll() ? coc#float#scroll(1) : "\" - vnoremap coc#float#has_scroll() ? coc#float#scroll(0) : "\" - endif - - " Use CTRL-S for selections ranges. - " Requires 'textDocument/selectionRange' support of language server. - nmap (coc-range-select) - xmap (coc-range-select) - - " Add `:Format` command to format current buffer. - command! -nargs=0 Format :call CocAction('format') - - " Add `:Fold` command to fold current buffer. - command! -nargs=? Fold :call CocAction('fold', ) - - " Add `:OR` command for organize imports of the current buffer. - command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport') - - " Add (Neo)Vim's native statusline support. - " NOTE: Please see `:h coc-status` for integrations with external plugins that - " provide custom statusline: lightline.vim, vim-airline. - set statusline^=%{coc#status()}%{get(b:,'coc_current_function',''')} - - " Mappings for CoCList - " Show all diagnostics. - nnoremap a :CocList diagnostics - " Manage extensions. - nnoremap e :CocList extensions - " Show commands. - nnoremap c :CocList commands - " Find symbol of current document. - nnoremap o :CocList outline - " Search workspace symbols. - nnoremap s :CocList -I symbols - " Do default action for next item. - nnoremap j :CocNext - " Do default action for previous item. - nnoremap k :CocPrev - " Resume latest coc list. - nnoremap p :CocListResume - -'' diff --git a/depot/users/kairi/base/weechat.nix b/depot/users/kairi/base/weechat.nix deleted file mode 100644 index 1d9754f8..00000000 --- a/depot/users/kairi/base/weechat.nix +++ /dev/null @@ -1,182 +0,0 @@ -{ config, pkgs, lib, ... }: - -with lib; - -{ - programs.weechat = { - init = lib.mkMerge [ - (lib.mkBefore '' - /server add espernet athame.kittywit.ch/5001 -ssl -autoconnect - /matrix server add kittywitch kittywit.ch - /key bind meta-g /go - /key bind meta-v /input jump_last_buffer_displayed - /key bind meta-c /buffer close - /key bind meta-n /bar toggle nicklist - /key bind meta-b /bar toggle buflist - /relay add weechat 9000 - '') - (lib.mkAfter '' - /matrix connect kittywitch - /window splith +10 - /window 2 - /buffer highmon - /window 1 - '') - ]; - homeDirectory = "${config.xdg.dataHome}/weechat"; - plugins.python = { - enable = true; - packages = [ "weechat-matrix" ]; - }; - plugins.perl = { - enable = true; - }; - scripts = with pkgs.weechatScripts; [ - go - auto_away - autosort - colorize_nicks - unread_buffer - urlgrab - vimode-git - weechat-matrix - title - highmon - ]; - config = with mapAttrs (_: toString) pkgs.base16.shell.shell256; { - logger.level.irc = 0; - logger.level.python.matrix = 0; - logger.level.core.weechat = 0; - buflist = { - format = { - indent = "\${if:\${merged}?\${if:\${buffer.prev_buffer.number}!=\${buffer.number}?│┌:\${if:\${buffer.next_buffer.number}==\${buffer.number}?│├:\${if:\${buffer.next_buffer.name}=~^server||\${buffer.next_buffer.number}<0?└┴:├┴}}}:\${if:\${buffer.active}>0?\${if:\${buffer.next_buffer.name}=~^server?└:\${if:\${buffer.next_buffer.number}>0?├:└}}:\${if:\${buffer.next_buffer.name}=~^server? :│}}}─"; - buffer_current = "\${color:,${base01}}\${format_buffer}"; - hotlist = " \${color:${base0B}}(\${hotlist}\${color:${base0B}})"; - hotlist_highlight = "\${color:${base0F}}"; - hotlist_low = "\${color:${base06}}"; - hotlist_message = "\${color:${base0E}}"; - hotlist_none = "\${color:${base05}}"; - hotlist_private = "\${color:${base0A}}"; - hotlist_separator = "\${color:${base04}},"; - number = "\${color:${base0A}}\${number}\${if:\${number_displayed}?.: }"; - }; - }; - weechat = { - look = { - mouse = true; - separator_horizontal = ""; - read_marker_string = "─"; - prefix_same_nick = "↳"; - }; - color = { - chat_nick_self = base0F; - separator = base0A; - chat_read_marker = base0D; - chat_read_marker_bg = base03; - }; - bar = { - buflist = { - size_max = 24; - color_delim = base0A; - }; - input = { - items = "[input_prompt]+(away),[input_search],[input_paste],input_text,[vi_buffer]"; - color_delim = base0A; - conditions = "\${window.buffer.full_name} != perl.highmon"; - }; - nicklist = { - size_max = 18; - color_delim = base0A; - }; - status = { - color_bg = base01; - color_fg = base05; - color_delim = base0A; - items = "[time],mode_indicator,[buffer_last_number],[buffer_plugin],buffer_number+:+buffer_name+(buffer_modes)+{buffer_nicklist_count}+matrix_typing_notice+buffer_zoom+buffer_filter,scroll,[lag],[hotlist],completion,cmd_completion"; - conditions = "\${window.buffer.full_name} != perl.highmon"; - }; - title = { - color_bg = base01; - color_fg = base05; - color_delim = base0A; - conditions = "\${window.buffer.full_name} != perl.highmon"; - }; - }; - }; - urlgrab.default.copycmd = "${pkgs.wl-clipboard}/bin/wl-copy"; - plugins.var = { - python = { - title = { - title_prefix = "weechat - "; - show_hotlist = true; - current_buffer_suffix = " ["; - title_suffix = " ]"; - }; - - - vimode = { - copy_clipboard_cmd = "wl-copy"; - paste_clipboard_cmd = "wl-paste --no-newline"; - imap_esc_timeout = "100"; - search_vim = true; - user_mappings = builtins.toJSON { - "," = "/buffer #{1}"; - "``" = "/input jump_last_buffer_displayed"; - "`n" = "/input jump_smart"; - "k" = "/input history_previous"; - "j" = "/input history_next"; - "p" = "a/input clipboard_paste"; - "P" = "/input clipboard_paste"; - #"u" = "/input undo"; - #"\\x01R" = "/input redo"; - "\\x01K" = "/buffer move -1"; - "\\x01J" = "/buffer move +1"; - }; - user_mappings_noremap = builtins.toJSON { - "\\x01P" = "p"; - "/" = "i/"; - }; - user_search_mapping = "?"; - mode_indicator_cmd_color_bg = base01; - mode_indicator_cmd_color = base04; - mode_indicator_insert_color_bg = base01; - mode_indicator_insert_color = base04; - mode_indicator_normal_color_bg = base01; - mode_indicator_normal_color = base04; - mode_indicator_replace_color_bg = base01; - mode_indicator_replace_color = base0E; - mode_indicator_search_color_bg = base0A; - mode_indicator_search_color = base04; - no_warn = true; - }; - notify_send.icon = ""; - go.short_name = true; - }; - perl.highmon = { - short_names = "on"; - output = "buffer"; - merge_private = "on"; - alignment = "nchannel,nick"; - }; - }; - irc = { - look = { - server_buffer = "independent"; - color_nicks_in_nicklist = true; - }; - }; - matrix = { - network = { - max_backlog_sync_events = 30; - lazy_load_room_users = true; - autoreconnect_delay_max = 5; - lag_min-show = 1000; - }; - look = { - server_buffer = "independent"; - redactions = "notice"; - }; - }; - }; - }; -} diff --git a/depot/users/kairi/base/xdg.nix b/depot/users/kairi/base/xdg.nix deleted file mode 100644 index 690c0b15..00000000 --- a/depot/users/kairi/base/xdg.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ config, lib, ... }: - -{ - xdg = { - enable = true; - userDirs = { - enable = true; - pictures = "$HOME/media"; - videos = "$HOME/media/videos"; - documents = "$HOME/docs"; - download = "$HOME/downloads"; - desktop = "$HOME/tmp"; - templates = "$HOME/tmp"; - publicShare = "$HOME/shared"; - music = "$HOME/media-share/music"; - }; - }; -} diff --git a/depot/users/kairi/base/zsh.nix b/depot/users/kairi/base/zsh.nix deleted file mode 100644 index fc29bdc1..00000000 --- a/depot/users/kairi/base/zsh.nix +++ /dev/null @@ -1,87 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; - -let - shellFunAlias = command: replacement: '' - if [[ ! -t 0 ]]; then - command ${command} $@ - else - echo 'use ${replacement}!' - fi - ''; - shellFunAliases = mapAttrs shellFunAlias; -in { - home.shell.functions = { - genmac = '' - nix run nixpkgs.openssl -c openssl rand -hex 6 | sed 's/\(..\)\(..\)\(..\)\(..\)\(..\)\(..\)/\1:\2:\3:\4:\5:\6/' - ''; - nano = '' - ${pkgs.wezterm}/bin/wezterm imgcat ${./nano.png} - ''; - } // shellFunAliases { - sed = "sd"; - find = "fd"; - grep = "rg"; - }; - xdg.dataFile = { "z/.keep".text = ""; }; - home.packages = with pkgs; [ fzf fd ]; - programs.zsh = { - enable = true; - enableAutosuggestions = true; - shellAliases = { - nixdirfmt = "fd --color=never .nix | xargs nixpkgs-fmt"; - exa = "exa --time-style long-iso"; - ls = "exa -G"; - la = "exa -Ga"; - ll = "exa -l"; - lla = "exa -lga"; - sys = "systemctl"; - log = "journalctl"; - dmesg = "dmesg -HP"; - lg = "log --no-pager | grep"; - }; - localVariables = { - _Z_DATA = "${config.xdg.dataHome}/z/data"; - ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=3,bold"; - ZSH_AUTOSUGGEST_USE_ASYNC = 1; - }; - plugins = [ - (with pkgs.zsh-syntax-highlighting; { - name = "zsh-syntax-highlighting"; - inherit src; - }) - { - name = "z"; - file = "z.sh"; - src = pkgs.fetchFromGitHub { - owner = "rupa"; - repo = "z"; - rev = "9d5a3fe0407101e2443499e4b95bca33f7a9a9ca"; - sha256 = "0aghw6zmd3851xpzgy0jkh25wzs9a255gxlbdr3zw81948qd9wb1"; - }; - } - { - name = "fzf-z"; - src = pkgs.fetchFromGitHub { - owner = "andrewferrier"; - repo = "fzf-z"; - rev = "089ba6cacd3876c349cfb6b65dc2c3e68b478fd0"; - sha256 = "1lvvkz0v4xibq6z3y8lgfkl9ibcx0spr4qzni0n925ar38s20q81"; - }; - } - ]; - oh-my-zsh = { - enable = true; - plugins = [ "git" "sudo" "adb" "cargo" "emoji" ]; - }; - }; - programs.starship = { - enable = true; - enableZshIntegration = true; - }; - programs.direnv = { - enable = true; - enableZshIntegration = true; - }; -} diff --git a/depot/users/kairi/default.nix b/depot/users/kairi/default.nix deleted file mode 100644 index 5da73ea2..00000000 --- a/depot/users/kairi/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -rec { - base = ./base.nix; - gui = ./gui.nix; - fvwm = ./fvwm.nix; - sway = ./sway.nix; - dev = ./dev.nix; - media = ./media.nix; - personal = ./personal.nix; - - server = { imports = [ personal ]; }; - guiFull = { imports = [ gui fvwm dev media personal ]; }; -} diff --git a/depot/users/kairi/dev.nix b/depot/users/kairi/dev.nix deleted file mode 100644 index 5c44e68e..00000000 --- a/depot/users/kairi/dev.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ ... }: - -{ - home-manager.users.kairi = { imports = [ ./dev ]; }; -} diff --git a/depot/users/kairi/dev/cookiecutter.nix b/depot/users/kairi/dev/cookiecutter.nix deleted file mode 100644 index da4dc718..00000000 --- a/depot/users/kairi/dev/cookiecutter.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ config, pkgs, ... }: - -{ - home.packages = with pkgs; [ cookiecutter ]; - - home.shell.functions.katenv = '' - cookiecutter cookiecutters --directory $1 - ''; -} diff --git a/depot/users/kairi/dev/default.nix b/depot/users/kairi/dev/default.nix deleted file mode 100644 index 708b355c..00000000 --- a/depot/users/kairi/dev/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - imports = [ ./packages.nix ./cookiecutter.nix ]; -} diff --git a/depot/users/kairi/dev/packages.nix b/depot/users/kairi/dev/packages.nix deleted file mode 100644 index ce72a4a8..00000000 --- a/depot/users/kairi/dev/packages.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ config, pkgs, ... }: - -{ - home.packages = with pkgs; [ hyperfine hexyl tokei horizon-eda ]; -} diff --git a/depot/users/kairi/fvwm.nix b/depot/users/kairi/fvwm.nix deleted file mode 100644 index a50adf9d..00000000 --- a/depot/users/kairi/fvwm.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ ... }: - -{ - home-manager.users.kairi = { imports = [ ./fvwm ]; }; -} diff --git a/depot/users/kairi/fvwm/default.nix b/depot/users/kairi/fvwm/default.nix deleted file mode 100644 index c2f8704a..00000000 --- a/depot/users/kairi/fvwm/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ config, pkgs, ... }: - -{ - home.file = { - ".xinitrc" = { - executable = true; - text = '' - #!${pkgs.bash}/bin/bash - exec fvwm - ''; - }; - }; -} diff --git a/depot/users/kairi/gui.nix b/depot/users/kairi/gui.nix deleted file mode 100644 index 4448b550..00000000 --- a/depot/users/kairi/gui.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ ... }: - -{ - home-manager.users.kairi = { imports = [ ./gui ]; }; -} diff --git a/depot/users/kairi/gui/default.nix b/depot/users/kairi/gui/default.nix deleted file mode 100644 index 3a4cd3aa..00000000 --- a/depot/users/kairi/gui/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ config, ... }: - -{ - deploy.profile.gui = true; - - imports = [ ./firefox ./kitty.nix ./packages.nix ./gtk.nix ./wezterm.nix ./foot.nix ./xdg.nix ./ranger.nix ]; - - fonts.fontconfig.enable = true; -} diff --git a/depot/users/kairi/gui/firefox/default.nix b/depot/users/kairi/gui/firefox/default.nix deleted file mode 100644 index 3f755681..00000000 --- a/depot/users/kairi/gui/firefox/default.nix +++ /dev/null @@ -1,57 +0,0 @@ -{ config, lib, pkgs, superConfig, ... }: - -let - commonSettings = { - "app.update.auto" = false; - "identity.fxaccounts.account.device.name" = superConfig.networking.hostName; - "signon.rememberSignons" = false; - "browser.download.lastDir" = "/home/kairi/downloads"; - "browser.urlbar.placeholderName" = "DuckDuckGo"; - "toolkit.legacyUserProfileCustomizations.stylesheets" = true; - }; -in -{ - programs.zsh.shellAliases = { - ff-pm = "firefox --ProfileManager"; - ff-main = "firefox -P main"; - }; - - home.sessionVariables = { - XDG_CURRENT_DESKTOP = "sway"; - }; - - programs.firefox = { - enable = true; - package = pkgs.firefox-wayland; - extensions = with pkgs.nur.repos.rycee.firefox-addons; [ - sponsorblock - auto-tab-discard - bitwarden - darkreader - decentraleyes - foxyproxy-standard - clearurls - df-youtube - https-everywhere - old-reddit-redirect - privacy-badger - reddit-enhancement-suite - refined-github - stylus - terms-of-service-didnt-read - #tree-style-tab - sidebery - multi-account-containers - ublock-origin - violentmonkey - ]; - profiles = { - main = { - id = 0; - isDefault = true; - settings = commonSettings // { }; - userChrome = import ./userChrome.css.nix { profile = "main"; }; - }; - }; - }; -} diff --git a/depot/users/kairi/gui/firefox/userChrome.css.nix b/depot/users/kairi/gui/firefox/userChrome.css.nix deleted file mode 100644 index 12d10908..00000000 --- a/depot/users/kairi/gui/firefox/userChrome.css.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ profile }: - -'' - #main-window[tabsintitlebar="true"]:not([extradragspace="true"]) #TabsToolbar > .toolbar-items { - opacity: 0; - pointer-events: none; - } - #main-window:not([tabsintitlebar="true"]) #TabsToolbar { - visibility: collapse !important; - } - - #sidebar-header { - display: none; - } -'' diff --git a/depot/users/kairi/gui/foot.nix b/depot/users/kairi/gui/foot.nix deleted file mode 100644 index 2b31bac9..00000000 --- a/depot/users/kairi/gui/foot.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; - -let - witch.style.base16 = lib.mapAttrs' (k: v: lib.nameValuePair k "#${v.hex.rgb}") - config.lib.arc.base16.schemeForAlias.default; - colors.ansi = builtins.concatStringsSep ", " (map (c: ''"#${c.hex.rgb}"'') (sublist 0 8 config.lib.arc.base16.schemeForAlias.default.shell.colours)); - colors.brights = builtins.concatStringsSep ", " (map (c: ''"#${c.hex.rgb}"'') (sublist 8 8 config.lib.arc.base16.schemeForAlias.default.shell.colours)); -in { - programs.foot = { - enable = true; - settings = { - main = { - term = "xterm-256color"; - font = "FantasqueSansMono Nerd Font:size=10"; - dpi-aware = "yes"; - }; - }; - }; -} diff --git a/depot/users/kairi/gui/gtk.nix b/depot/users/kairi/gui/gtk.nix deleted file mode 100644 index a986fe6d..00000000 --- a/depot/users/kairi/gui/gtk.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - gtk = { - enable = true; - iconTheme = { - name = "Numix-Square"; - package = pkgs.numix-icon-theme-square; - }; - theme = { - name = "Adementary-dark"; - package = pkgs.adementary-theme; - }; - }; -} diff --git a/depot/users/kairi/gui/kitty.nix b/depot/users/kairi/gui/kitty.nix deleted file mode 100644 index db87ef99..00000000 --- a/depot/users/kairi/gui/kitty.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ config, lib, pkgs, witch, ... }: - -let - witch.style.base16 = lib.mapAttrs' (k: v: lib.nameValuePair k "#${v.hex.rgb}") - config.lib.arc.base16.schemeForAlias.default; - witch.style.font = { - name = "Iosevka Nerd Font"; - size = "10"; - size_css = "14px"; - }; -in - { - wayland.windowManager.sway.extraSessionCommands = '' - export KITTY_CACHE_DIRECTORY="/tmp/kitty"; - ''; - programs.kitty = { - enable = true; - font.name = witch.style.font.name; - settings = { - font_size = witch.style.font.size; - # background = witch.style.base16.color0; - background_opacity = "0.9"; - # foreground = witch.style.base16.color7; - # selection_background = witch.style.base16.color7; - # selection_foreground = witch.style.base16.color0; - # url_color = witch.style.base16.color3; - # cursor = witch.style.base16.color7; - # active_border_color = "#75715e"; - # active_tab_background = "#9900ff"; - # active_tab_foreground = witch.style.base16.color7; - # inactive_tab_background = "#3a3a3a"; - # inactive_tab_foreground = "#665577"; - }; # // witch.style.base16; - }; -} diff --git a/depot/users/kairi/gui/packages.nix b/depot/users/kairi/gui/packages.nix deleted file mode 100644 index 40e30d5e..00000000 --- a/depot/users/kairi/gui/packages.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - home.packages = with pkgs; [ - _1password - bitwarden - wire-desktop - element-desktop - exiftool - thunderbird - mumble-develop - dino - transmission-remote-gtk - scrcpy - lm_sensors - p7zip - zip - unzip - nyxt - baresip - discord - tdesktop - yubikey-manager - vegur - gparted - cryptsetup - ]; -} diff --git a/depot/users/kairi/gui/ranger.nix b/depot/users/kairi/gui/ranger.nix deleted file mode 100644 index 0e294078..00000000 --- a/depot/users/kairi/gui/ranger.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ config, pkgs, ... }: - -{ - home.packages = with pkgs; [ - ranger - ]; - - xdg.configFile."ranger/rc.conf".text = '' - set preview_images true - set preview_images_method iterm2 - ''; -} diff --git a/depot/users/kairi/gui/wezterm.nix b/depot/users/kairi/gui/wezterm.nix deleted file mode 100644 index a9a8bfca..00000000 --- a/depot/users/kairi/gui/wezterm.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; - -let - witch.style.base16 = lib.mapAttrs' (k: v: lib.nameValuePair k "#${v.hex.rgb}") - config.lib.arc.base16.schemeForAlias.default; - colors.ansi = builtins.concatStringsSep ", " (map (c: ''"#${c.hex.rgb}"'') (sublist 0 8 config.lib.arc.base16.schemeForAlias.default.shell.colours)); - colors.brights = builtins.concatStringsSep ", " (map (c: ''"#${c.hex.rgb}"'') (sublist 8 8 config.lib.arc.base16.schemeForAlias.default.shell.colours)); -in { - home.packages = [ - pkgs.wezterm - ]; - - xdg.configFile."wezterm/wezterm.lua".text = '' - local wezterm = require 'wezterm'; - - return { - term = "wezterm", - font = wezterm.font_with_fallback({"Iosevka Term","Twitter Color Emoji"}), - font_size = 9.0, - window_background_opacity = 0.9, - colors = { - ansi = {${colors.ansi}}, - brights = {${colors.brights}}, - background = "${witch.style.base16.base00}", - foreground = "${witch.style.base16.base05}", - tab_bar = { - background = "${witch.style.base16.base00}", - active_tab = { - bg_color = "${witch.style.base16.base0A}", - fg_color = "${witch.style.base16.base05}", - }, - inactive_tab = { - bg_color = "${witch.style.base16.base01}", - fg_color = "${witch.style.base16.base03}", - }, - }, - }, - } - ''; -} diff --git a/depot/users/kairi/gui/xdg.nix b/depot/users/kairi/gui/xdg.nix deleted file mode 100644 index abd6c3b9..00000000 --- a/depot/users/kairi/gui/xdg.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ config, pkgs, ... }: - -{ - home.packages = with pkgs; [ - xdg-utils - ]; -} diff --git a/depot/users/kairi/media.nix b/depot/users/kairi/media.nix deleted file mode 100644 index f7037a57..00000000 --- a/depot/users/kairi/media.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ ... }: - -{ - home-manager.users.kairi = { imports = [ ./media ]; }; -} diff --git a/depot/users/kairi/media/beets.nix b/depot/users/kairi/media/beets.nix deleted file mode 100644 index 13203be3..00000000 --- a/depot/users/kairi/media/beets.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ config, pkgs, lib, ... }: - -{ - programs.beets = { - enable = true; - package = pkgs.beets; - settings = { - directory = "~/media-share/music"; - library = "~/.local/share/beets.db"; - plugins = lib.concatStringsSep " " [ - "mpdstats" - "mpdupdate" - "duplicates" - "chroma" - ]; - }; - }; -} diff --git a/depot/users/kairi/media/default.nix b/depot/users/kairi/media/default.nix deleted file mode 100644 index 9bf2a65f..00000000 --- a/depot/users/kairi/media/default.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ ... }: - -{ - imports = [ - ./mpv.nix - ./obs.nix - ./syncplay.nix - ./beets.nix - ./mpd.nix - ./ncmpcpp.nix - ./packages.nix - ]; -} diff --git a/depot/users/kairi/media/mpd.nix b/depot/users/kairi/media/mpd.nix deleted file mode 100644 index fe03204c..00000000 --- a/depot/users/kairi/media/mpd.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ config, pkgs, ... }: - -{ - services.mpd = { - enable = true; - package = pkgs.mpd-youtube-dl; - network = { - startWhenNeeded = true; - listenAddress = "[::]"; - }; - musicDirectory = "/home/kairi/music"; - extraConfig = '' - max_output_buffer_size "32768" - - audio_output { - type "fifo" - name "my_fifo" - path "/tmp/mpd.fifo" - format "44100:16:2" - } - - audio_output { - type "pulse" - name "speaker" - } - - audio_output { - bind_to_address "[::]" - type "httpd" - name "httpd-high" - encoder "opus" - bitrate "96000" - port "32101" - max_clients "4" - format "48000:16:2" - always_on "yes" - tags "yes" - } - ''; - }; -} diff --git a/depot/users/kairi/media/mpv.nix b/depot/users/kairi/media/mpv.nix deleted file mode 100644 index a71665e5..00000000 --- a/depot/users/kairi/media/mpv.nix +++ /dev/null @@ -1,111 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - programs.mpv = { - enable = true; - scripts = [ pkgs.mpvScripts.sponsorblock pkgs.mpvScripts.paused ]; - bindings = - let - vim = { - "l" = "seek 5"; - "h" = "seek -5"; - "k" = "seek 60"; - "j" = "seek -60"; - "Ctrl+l" = "seek 1 exact"; - "Ctrl+h" = "seek -1 exact"; - "Ctrl+L" = "sub-seek 1"; - "Ctrl+H" = "sub-seek -1"; - "Ctrl+k" = "add chapter 1"; - "Ctrl+j" = "add chapter -1"; - "Ctrl+K" = "playlist-next"; - "Ctrl+J" = "playlist-prev"; - "Alt+h" = "frame-back-step"; - "Alt+l" = "frame-step"; - "`" = "cycle mute"; - "MBTN_RIGHT" = "cycle pause"; - "w" = "screenshot"; - "W" = "screenshot video"; - "Ctrl+w" = "screenshot window"; - "Ctrl+W" = "screenshot each-frame"; - "o" = "show-progress"; - "O" = "script-message show_osc_dur 5"; - "F1" = "cycle sub"; - "F2" = "cycle audio"; - "Ctrl+p" = "cycle video"; - "L" = "add volume 2"; - "H" = "add volume -2"; - "Alt+H" = "add audio-delay -0.100"; - "Alt+L" = "add audio-delay 0.100"; - "1" = "set volume 10"; - "2" = "set volume 20"; - "3" = "set volume 30"; - "4" = "set volume 40"; - "5" = "set volume 50"; - "6" = "set volume 60"; - "7" = "set volume 70"; - "8" = "set volume 80"; - "9" = "set volume 90"; - ")" = "set volume 150"; - "0" = "set volume 100"; - "m" = "cycle mute"; - "Ctrl+r" = "loadfile \${path}"; - "Ctrl+R" = "video-reload"; - "d" = "drop-buffers"; - "Ctrl+d" = "quit"; - }; - other = { - "RIGHT" = vim."l"; - "LEFT" = vim."h"; - "UP" = vim."k"; - "DOWN" = vim."j"; - "Ctrl+0" = "set speed 1.0"; - "Ctrl+=" = "multiply speed 1.1"; - "Ctrl+-" = "multiply speed 1/1.1"; - "Shift+LEFT" = vim."H"; - "Shift+RIGHT" = vim."L"; - "Ctrl+RIGHT" = vim."Ctrl+l"; - "Ctrl+LEFT" = vim."Ctrl+h"; - "Ctrl+Shift+LEFT" = vim."Ctrl+H"; - "Ctrl+Shift+RIGHT" = vim."Ctrl+L"; - "Ctrl+UP" = vim."Ctrl+k"; - "Ctrl+DOWN" = vim."Ctrl+j"; - "Ctrl+Shift+UP" = vim."Ctrl+K"; - "Ctrl+Shift+DOWN" = vim."Ctrl+J"; - "Alt+LEFT" = vim."Alt+h"; - "Alt+RIGHT" = vim."Alt+l"; - "SPACE" = vim."MBTN_RIGHT"; - "m" = vim."`"; - "WHEEL_UP" = vim."L"; - "WHEEL_DOWN" = vim."H"; - }; in vim // other; - config = { - no-input-default-bindings = ""; - profile = "gpu-hq"; - gpu-context = "wayland"; - vo = "gpu"; - volume-max = 200; - keep-open = true; - opengl-waitvsync = true; - hwdec = "auto"; - demuxer-max-bytes = "2000MiB"; - demuxer-max-back-bytes = "250MiB"; - osd-scale-by-window = false; - osd-bar-h = 2.5; # 3.125 default - osd-border-size = 2; # font border pixels, default 3 - term-osd-bar = true; - script-opts = lib.concatStringsSep "," - (lib.mapAttrsToList (k: v: "${k}=${toString v}") { - osc-layout = "slimbox"; - osc-vidscale = "no"; - osc-deadzonesize = 0.75; - osc-minmousemove = 4; - osc-hidetimeout = 2000; - osc-valign = 0.9; - osc-timems = "yes"; - osc-seekbarstyle = "knob"; - osc-seekbarkeyframes = "no"; - osc-seekrangestyle = "slider"; - }); - }; - }; - } diff --git a/depot/users/kairi/media/ncmpcpp.nix b/depot/users/kairi/media/ncmpcpp.nix deleted file mode 100644 index d2322adf..00000000 --- a/depot/users/kairi/media/ncmpcpp.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ config, ... }: - -{ - programs.ncmpcpp = { - enable = true; - mpdMusicDir = "/home/kairi/music"; - settings = { - visualizer_data_source = "/tmp/mpd.fifo"; - visualizer_output_name = "my_fifo"; - visualizer_in_stereo = "yes"; - visualizer_type = "spectrum"; - visualizer_look = "+|"; - user_interface = "alternative"; - colors_enabled = "yes"; - discard_colors_if_item_is_selected = "no"; - header_window_color = "250"; - volume_color = "250"; - state_line_color = "cyan"; - state_flags_color = "cyan"; - alternative_ui_separator_color = "yellow"; - statusbar_color = "yellow"; - progressbar_color = "black"; - progressbar_elapsed_color = "blue"; - window_border_color = "yellow"; - playlist_display_mode = "classic"; - song_columns_list_format = - "(3f)[cyan]{n} (40)[default]{t|f} (25)[red]{a} (30)[blue]{b} (4f)[cyan]{l}"; - now_playing_prefix = "$b"; - song_list_format = - " $7%n$9 $8-$9 $6%a$9 $8-$9 $5%b$9 $R $8%t$9 ($4%l$9) "; - song_library_format = "{%n > }{%t}|{%f}"; - song_status_format = "{%a - }{%t - }{%b}"; - titles_visibility = "no"; - header_visibility = "no"; - statusbar_visibility = "no"; - now_playing_suffix = "$/b"; - progressbar_look = "▄▄ "; - media_library_primary_tag = "album_artist"; - search_engine_display_mode = "columns"; - }; - bindings = [ - { - key = "+"; - command = "add"; - } - { - key = "-"; - command = "load"; - } - ]; - }; -} diff --git a/depot/users/kairi/media/obs.nix b/depot/users/kairi/media/obs.nix deleted file mode 100644 index c41cb434..00000000 --- a/depot/users/kairi/media/obs.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ config, pkgs, ... }: - -{ - programs.obs-studio = { - enable = true; - plugins = [ pkgs.obs-studio-plugins.wlrobs ]; - }; - - programs.zsh.shellAliases = { obs = "env QT_QPA_PLATFORM=xcb obs"; }; -} diff --git a/depot/users/kairi/media/packages.nix b/depot/users/kairi/media/packages.nix deleted file mode 100644 index 7f0abfc1..00000000 --- a/depot/users/kairi/media/packages.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ config, pkgs, ... }: - -{ - home.packages = with pkgs; [ - audacity - avidemux - gst_all_1.gstreamer.dev - gst_all_1.gstreamer - gst_all_1.gst-plugins-base - gst_all_1.gst-plugins-good - gst_all_1.gst-plugins-bad - gst_all_1.gst-plugins-ugly - vlc - imv - ffmpeg-full - youtube-dl - mkchromecast - v4l-utils - gimp-with-plugins - wf-recorder - ]; -} diff --git a/depot/users/kairi/media/syncplay.nix b/depot/users/kairi/media/syncplay.nix deleted file mode 100644 index f6406bca..00000000 --- a/depot/users/kairi/media/syncplay.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ config, ... }: - -{ - - programs.syncplay = { - enable = true; - username = "kat"; - defaultRoom = "lounge"; - server = { host = "sync.kittywit.ch"; }; - playerArgs = [ - "--ytdl-format=bestvideo[height<=1080]+bestaudio/best[height<=1080]/bestvideo+bestaudio/best" - ]; - # gui = false; - config = { - client_settings = { - onlyswitchtotrusteddomains = false; - autoplayrequiresamefiles = false; - readyatstart = true; - pauseonleave = false; - rewindondesync = false; - rewindthreshold = 6.0; - fastforwardthreshold = 6.0; - unpauseaction = "Always"; - }; - gui = { - #autosavejoinstolist = false; - showdurationnotification = false; - }; - }; - }; -} diff --git a/depot/users/kairi/personal.nix b/depot/users/kairi/personal.nix deleted file mode 100644 index 5503a0b7..00000000 --- a/depot/users/kairi/personal.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ ... }: - -{ - home-manager.users.kairi = { imports = [ ./personal ]; }; -} diff --git a/depot/users/kairi/personal/default.nix b/depot/users/kairi/personal/default.nix deleted file mode 100644 index f49a43e9..00000000 --- a/depot/users/kairi/personal/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ ... }: - -{ - imports = [ ./gpg.nix ./packages.nix ]; -} diff --git a/depot/users/kairi/personal/gpg.nix b/depot/users/kairi/personal/gpg.nix deleted file mode 100644 index 466b9708..00000000 --- a/depot/users/kairi/personal/gpg.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ config, lib, pkgs, ... }: - -{ - home.sessionVariables = { - SSH_AUTH_SOCK = - "\${SSH_AUTH_SOCK:-$(${pkgs.gnupg}/bin/gpgconf --list-dirs agent-ssh-socket)}"; - }; - services.gpg-agent = { - enable = true; - enableExtraSocket = true; - enableSshSupport = false; - pinentryFlavor = "gtk2"; - extraConfig = lib.mkMerge [ - "auto-expand-secmem 0x30000" # otherwise "gpg: public key decryption failed: Cannot allocate memory" - "pinentry-timeout 30" - "allow-loopback-pinentry" - "enable-ssh-support" - "no-allow-external-cache" - ]; - }; -} diff --git a/depot/users/kairi/personal/packages.nix b/depot/users/kairi/personal/packages.nix deleted file mode 100644 index c3b8edec..00000000 --- a/depot/users/kairi/personal/packages.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ config, pkgs, ... }: - -{ - home.packages = with pkgs; [ pinentry.gtk2 ]; -} diff --git a/depot/users/kairi/sway.nix b/depot/users/kairi/sway.nix deleted file mode 100644 index b0e6b9c5..00000000 --- a/depot/users/kairi/sway.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ ... }: - -{ - home-manager.users.kairi = { imports = [ ./sway ]; }; -} diff --git a/depot/users/kairi/sway/default.nix b/depot/users/kairi/sway/default.nix deleted file mode 100644 index b64c5064..00000000 --- a/depot/users/kairi/sway/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ config, pkgs, ... }: - -{ - deploy.profile.sway = true; - - imports = [ - ./waybar - ./mako.nix - ./sway.nix - ./gammastep.nix - ./konawall.nix - ./packages.nix - ]; -} diff --git a/depot/users/kairi/sway/gammastep.nix b/depot/users/kairi/sway/gammastep.nix deleted file mode 100644 index ce3ba1c1..00000000 --- a/depot/users/kairi/sway/gammastep.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ config, lib, ... }: - -{ - services.gammastep = { - enable = true; - latitude = "51.5074"; - longitude = "0.1278"; - }; -} diff --git a/depot/users/kairi/sway/konawall.nix b/depot/users/kairi/sway/konawall.nix deleted file mode 100644 index 49434241..00000000 --- a/depot/users/kairi/sway/konawall.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ config, ... }: - -{ - services.konawall = { enable = true; }; -} diff --git a/depot/users/kairi/sway/mako.nix b/depot/users/kairi/sway/mako.nix deleted file mode 100644 index 2b3a6204..00000000 --- a/depot/users/kairi/sway/mako.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ config, pkgs, lib, witch, ... }: - -let - base16 = lib.mapAttrs' (k: v: lib.nameValuePair k "#${v.hex.rgb}") - config.lib.arc.base16.schemeForAlias.default; - font = { - name = "Iosevka Nerd Font"; - size = "10"; - size_css = "14px"; - }; -in -{ - systemd.user.services = { - mako = { - Unit = { - Description = "mako"; - X-Restart-Triggers = - [ (toString config.xdg.configFile."mako/config".source) ]; - }; - Service = { - ExecStart = "${pkgs.mako}/bin/mako"; - Restart = "always"; - }; - Install = { WantedBy = [ "graphical-session.target" ]; }; - }; - }; - - programs.mako = { - enable = true; - defaultTimeout = 3000; - borderColor = base16.base0A; - backgroundColor = "${base16.base00}70"; - textColor = base16.base05; - }; -} diff --git a/depot/users/kairi/sway/packages.nix b/depot/users/kairi/sway/packages.nix deleted file mode 100644 index a4fabfaf..00000000 --- a/depot/users/kairi/sway/packages.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ config, pkgs, ... }: - -{ - home.packages = with pkgs; [ kat-scrot ]; -} diff --git a/depot/users/kairi/sway/sway.nix b/depot/users/kairi/sway/sway.nix deleted file mode 100644 index 06d69f94..00000000 --- a/depot/users/kairi/sway/sway.nix +++ /dev/null @@ -1,232 +0,0 @@ -{ config, pkgs, lib, witch, ... }: - -let - base16 = lib.mapAttrs' (k: v: lib.nameValuePair k "#${v.hex.rgb}") - config.lib.arc.base16.schemeForAlias.default; - font = { - name = "Iosevka"; - size = 9.0; - size_css = "14px"; - }; -in -{ - home.sessionVariables = { - XDG_CURRENT_DESKTOP = "sway"; - XDG_SESSION_TYPE = "wayland"; - }; - - home.packages = with pkgs; [ grim slurp wl-clipboard jq ]; - - services.i3gopher = { enable = true; }; - - programs.zsh.profileExtra = '' - # If running from tty1 start sway - if [ "$(tty)" = "/dev/tty1" ]; then - systemctl --user unset-environment \ - SWAYSOCK \ - I3SOCK \ - WAYLAND_DISPLAY \ - DISPLAY \ - IN_NIX_SHELL \ - __HM_SESS_VARS_SOURCED \ - GPG_TTY \ - NIX_PATH \ - SHLVL - exec env --unset=SHLVL systemd-cat -t sway -- sway - fi - ''; - - wayland.windowManager.sway = - let - cfg = config.wayland.windowManager.sway.config; - bindsym = k: v: "bindsym ${k} ${v}"; - bindWorkspace = key: workspace: { - "${cfg.modifier}+${key}" = "workspace number ${workspace}"; - "${cfg.modifier}+shift+${key}" = - "move container to workspace number ${workspace}"; - }; - workspaceBindings = map (v: bindWorkspace v "${v}:${v}") [ - "1" - "2" - "3" - "4" - "5" - "6" - "7" - "8" - "9" - ] ++ [ (bindWorkspace "0" "10:10") ] - ++ lib.imap1 (i: v: bindWorkspace v "${toString (10 + i)}:${v}") [ - "F1" - "F2" - "F3" - "F4" - "F5" - "F6" - "F7" - "F8" - "F9" - "F10" - "F11" - "F12" - ]; - workspaceBindings' = map (lib.mapAttrsToList bindsym) workspaceBindings; - workspaceBindingsStr = - lib.concatStringsSep "\n" (lib.flatten workspaceBindings'); - in - { - enable = true; - config = - let - dmenu = - "${pkgs.bemenu}/bin/bemenu --fn '${font.name} ${toString font.size}' --nb '${base16.base00}' --nf '${base16.base07}' --sb '${base16.base01}' --sf '${base16.base07}' -l 5 -m -1 -i"; - in - { - bars = [{ command = "${pkgs.waybar}/bin/waybar"; }]; - - input = { - "*" = { - xkb_layout = "gb"; - # xkb_variant = "nodeadkeys"; - # xkb_options = "ctrl:nocaps"; - }; - }; - - fonts = { - names = [ font.name ]; - style = "Medium"; - size = font.size; - }; - terminal = "${pkgs.wezterm}/bin/wezterm"; - # TODO: replace with wofi - menu = - "${pkgs.j4-dmenu-desktop}/bin/j4-dmenu-desktop --dmenu=\"${dmenu}\" --term='${cfg.terminal}'"; - modifier = "Mod4"; - - assigns = { "12:F2" = [{ class = "screenstub"; }]; }; - startup = [ - { - command = "systemctl --user restart mako"; - always = true; - } - { command = "mkchromecast -t"; } - { - command = "systemctl --user restart konawall.service"; - always = true; - } - ]; - - window = { - border = 1; - titlebar = true; - }; - - keybindings = { - "${cfg.modifier}+Return" = "exec ${cfg.terminal}"; - - "${cfg.modifier}+Left" = "focus left"; - "${cfg.modifier}+Down" = "focus down"; - "${cfg.modifier}+Up" = "focus up"; - "${cfg.modifier}+Right" = "focus right"; - - "${cfg.modifier}+Shift+Left" = "move left"; - "${cfg.modifier}+Shift+Down" = "move down"; - "${cfg.modifier}+Shift+Up" = "move up"; - "${cfg.modifier}+Shift+Right" = "move right"; - - "${cfg.modifier}+Shift+space" = "floating toggle"; - "${cfg.modifier}+space" = "focus mode_toggle"; - - "${cfg.modifier}+Tab" = "workspace back_and_forth"; - "${cfg.modifier}+Shift+Tab" = - "exec ${config.services.i3gopher.focus-last}"; - "${cfg.modifier}+Ctrl+Left" = "workspace prev_on_output"; - "${cfg.modifier}+Ctrl+Right" = "workspace next_on_output"; - - "XF86AudioRaiseVolume" = - "exec pactl set-sink-volume $(pacmd list-sinks |awk '/* index:/{print $3}') +5%"; - "XF86AudioLowerVolume" = - "exec pactl set-sink-volume $(pacmd list-sinks |awk '/* index:/{print $3}') -5%"; - "XF86AudioMute" = - "exec pactl set-sink-mute $(pacmd list-sinks |awk '/* index:/{print $3}') toggle"; - "XF86AudioMicMute" = - "exec pactl set-source-mute $(pacmd list-sources |awk '/* index:/{print $3}') toggle"; - "XF86MonBrightnessDown" = "exec ${pkgs.light}/bin/light -U 5"; - "XF86MonBrightnessUp" = "exec ${pkgs.light}/bin/light -A 5"; - - "${cfg.modifier}+d" = "exec ${cfg.menu}"; - - "${cfg.modifier}+Print" = - "exec ${pkgs.kat-scrot}/bin/kat-scrot --notify upload screen"; - "${cfg.modifier}+Shift+Print" = - "exec ${pkgs.kat-scrot}/bin/kat-scrot --notify upload area"; - "${cfg.modifier}+Mod1+Print" = - "exec ${pkgs.kat-scrot}/bin/kat-scrot --notify upload window"; - "${cfg.modifier}+Control+Print" = - "exec ${pkgs.kat-scrot}/bin/kat-scrot --notify upload output"; - - "Print" = "exec ${pkgs.kat-scrot}/bin/kat-scrot --notify copys screen"; - "Shift+Print" = - "exec ${pkgs.kat-scrot}/bin/kat-scrot --notify copys area"; - "Mod1+Print" = - "exec ${pkgs.kat-scrot}/bin/kat-scrot --notify copys window"; - "Control+Print" = - "exec ${pkgs.kat-scrot}/bin/kat-scrot --notify copys output"; - - "${cfg.modifier}+i" = "move workspace to output left"; - "${cfg.modifier}+o" = "move workspace to output right"; - "${cfg.modifier}+b" = "splith"; - "${cfg.modifier}+v" = "splitv"; - "${cfg.modifier}+s" = "layout stacking"; - "${cfg.modifier}+w" = "layout tabbed"; - "${cfg.modifier}+e" = "layout toggle split"; - "${cfg.modifier}+f" = "fullscreen"; - - "${cfg.modifier}+Shift+q" = "kill"; - "${cfg.modifier}+Shift+c" = "reload"; - - "${cfg.modifier}+r" = "mode resize"; - "${cfg.modifier}+Delete" = '' - mode "System (l) lock, (e) logout, (s) suspend, (h) hibernate, (r) reboot, (Shift+s) shutdown"''; - }; - - colors = { - focused = { - border = base16.base08; - background = base16.base0A; - text = base16.base00; - indicator = base16.base0B; - childBorder = base16.base08; - }; - focusedInactive = { - border = base16.base00; - background = base16.base07; - text = base16.base0A; - indicator = base16.base0B; - childBorder = base16.base03; - }; - unfocused = { - border = base16.base00; - background = base16.base01; - text = base16.base04; - indicator = base16.base08; - childBorder = base16.base08; - }; - urgent = { - border = base16.base00; - background = base16.base09; - text = base16.base00; - indicator = base16.base01; - childBorder = base16.base08; - }; - }; - }; - wrapperFeatures.gtk = true; - extraConfig = '' - seat seat0 xcursor_theme breeze_cursors 20 - workspace_auto_back_and_forth yes - ${workspaceBindingsStr} - ''; - }; - -} diff --git a/depot/users/kairi/sway/wallpapers/left.jpg b/depot/users/kairi/sway/wallpapers/left.jpg deleted file mode 100644 index f519c4d4..00000000 Binary files a/depot/users/kairi/sway/wallpapers/left.jpg and /dev/null differ diff --git a/depot/users/kairi/sway/wallpapers/main.png b/depot/users/kairi/sway/wallpapers/main.png deleted file mode 100644 index 67649a5f..00000000 Binary files a/depot/users/kairi/sway/wallpapers/main.png and /dev/null differ diff --git a/depot/users/kairi/sway/wallpapers/right.jpg b/depot/users/kairi/sway/wallpapers/right.jpg deleted file mode 100644 index 9ab53754..00000000 Binary files a/depot/users/kairi/sway/wallpapers/right.jpg and /dev/null differ diff --git a/depot/users/kairi/sway/waybar/default.nix b/depot/users/kairi/sway/waybar/default.nix deleted file mode 100644 index 57adeba4..00000000 --- a/depot/users/kairi/sway/waybar/default.nix +++ /dev/null @@ -1,116 +0,0 @@ -{ config, lib, pkgs, witch, ... }: - -let - base16 = lib.mapAttrs' (k: v: lib.nameValuePair k "#${v.hex.rgb}") - config.lib.arc.base16.schemeForAlias.default; - font = { - name = "Iosevka Nerd Font"; - size = "10"; - size_css = "12px"; - }; -in -{ - config = lib.mkIf config.deploy.profile.sway { - programs.waybar = { - enable = true; - style = import ./waybar.css.nix { - inherit font base16; - inherit (pkgs) hextorgba; - }; - settings = [{ - modules-left = [ "sway/workspaces" "sway/mode" "sway/window" ]; - modules-center = [ ]; # "clock" "custom/weather" - modules-right = [ - "pulseaudio" - "cpu" - "memory" - "temperature" - "backlight" - "battery" - #"mpd" - "network" - "custom/gpg-status" - #"custom/weather" - "clock" - "idle_inhibitor" - "tray" - ]; - - modules = { - "sway/workspaces" = { format = "{name}"; }; - #"custom/weather" = { - # format = "{}"; - # interval = 3600; - # on-click = "xdg-open 'https://google.com/search?q=weather'"; - # exec = - # "${pkgs.kat-weather}/bin/kat-weather ${witch.secrets.profiles.sway.city} ${witch.secrets.profiles.sway.api_key}"; - #}; - "custom/gpg-status" = { - format = "{}"; - interval = 300; - exec = "${pkgs.kat-gpg-status}/bin/kat-gpg-status"; - }; - cpu = { format = " {usage}%"; }; - #mpd = { - # format = " {albumArtist} - {title}"; - # format-stopped = "ﱙ"; - # format-paused = " Paused"; - # title-len = 16; - #}; - memory = { format = " {percentage}%"; }; - temperature = { format = "﨎{temperatureC}°C"; }; - idle_inhibitor = { - format = "{icon}"; - format-icons = { - activated = ""; - deactivated = ""; - }; - }; - backlight = { - format = "{icon} {percent}%"; - format-icons = [ "" "" ]; - on-scroll-up = "${pkgs.light}/bin/light -A 1"; - on-scroll-down = "${pkgs.light}/bin/light -U 1"; - }; - battery = { - states = { - good = 90; - warning = 30; - critical = 15; - }; - format = "{icon} {capacity}%"; - format-charging = " {capacity}%"; - format-plugged = " {capacity}%"; - format-alt = "{icon} {time}"; - format-icons = [ "" "" "" "" "" ]; - }; - pulseaudio = { - format = " {volume}%"; - on-click = "pavucontrol"; - }; - network = { - format-wifi = ""; - format-ethernet = ""; - format-linked = " {ifname} (No IP)"; - format-disconnected = " Disconnected "; - format-alt = " {ifname}: {ipaddr}/{cidr}"; - tooltip-format-wifi = "{essid} ({signalStrength}%)"; - }; - clock = { - format = " {:%T %z}"; - tooltip = true; - tooltip-format = "{:%A, %F %T %z (%Z)}"; - timezones = [ - "Europe/London" - "America/Vancouver" - "America/Chicago" - "Europe/Berlin" - "Pacific/Auckland" - ]; - interval = 1; - }; - }; - }]; - }; - }; -} diff --git a/depot/users/kairi/sway/waybar/waybar.css.nix b/depot/users/kairi/sway/waybar/waybar.css.nix deleted file mode 100644 index 8a5be1ce..00000000 --- a/depot/users/kairi/sway/waybar/waybar.css.nix +++ /dev/null @@ -1,73 +0,0 @@ -{ hextorgba, base16, font }: - -'' - * { - border: none; - border-radius: 0; - font-family: "${font.name}"; - font-size: ${font.size_css}; - min-height: 14px - } - - #clock, #memory, #cpu, #temperature, #pulseaudio, #network, #mpd, #backlight, #battery, #custom-weather, #custom-gpg-status, #idle_inhibitor { - margin-left: 8px; - margin-right: 8px; - padding-left: 8px; - padding-right: 8px; - transition: none; - border-bottom: 2px solid ${base16.base00}; - color: ${base16.base05} - } - - window#waybar { background: ${hextorgba base16.base00} } - - #tray { - margin-left: 8px; - } - - #window { - color: ${base16.base06}; - padding-left: 16px; - padding-right: 16px - } - - #workspaces { padding: 0px 4px 0px 4px } - - #workspaces button { - color: ${base16.base04}; - background: ${hextorgba base16.base02}; - font-size: 16px; - margin: 0px 4px 0px 4px; - border-bottom: 2px solid transparent; - border-left: 1px solid ${base16.base07}; - border-right: 1px solid ${base16.base07} - } - - #workspaces button:last-child { margin-right: 0px } - - #workspaces button.focused { - color: ${base16.base0A}; - border-bottom-color: ${base16.base0A} - } - - #workspaces button:hover { - transition: none; - box-shadow: inherit; - text-shadow: inherit; - color: ${base16.base0F}; - border-bottom-color: ${base16.base0F} - } - - #mpd, #idle_inhibitor { border-color: #5af78e } - #mpd.disconnected, #mpd.stopped { border-color: #282a36 } - #network { border-color: ${base16.base08} } - #custom-weather { border-color: ${base16.base00} } - #custom-gpg-status { border-color: ${base16.base09} } - #pulseaudio { border-color: ${base16.base0A} } - #temperature { border-color: ${base16.base0B} } - #battery { border-color: ${base16.base0C} } - #backlight { border-color: ${base16.base0D} } - #cpu { border-color: ${base16.base0E} } - #memory { border-color: ${base16.base0F} } - #clock { border-color: ${base16.base06} } -'' diff --git a/depot/users/kat/gui/packages.nix b/depot/users/kat/gui/packages.nix index 09a5aa65..eb0c7cb2 100644 --- a/depot/users/kat/gui/packages.nix +++ b/depot/users/kat/gui/packages.nix @@ -9,7 +9,7 @@ exiftool thunderbird mumble-develop - dino + dino-omemo transmission-remote-gtk scrcpy lm_sensors @@ -18,7 +18,7 @@ unzip nyxt baresip - discord + discord-nssfix tdesktop yubikey-manager cryptsetup diff --git a/depot/users/kat/media/ncmpcpp.nix b/depot/users/kat/media/ncmpcpp.nix index 33b61603..580d8e16 100644 --- a/depot/users/kat/media/ncmpcpp.nix +++ b/depot/users/kat/media/ncmpcpp.nix @@ -1,9 +1,10 @@ -{ config, ... }: +{ config, pkgs, ... }: { programs.ncmpcpp = { enable = true; mpdMusicDir = "/home/kat/media-share/music"; + package = pkgs.ncmpcpp-kat; settings = { visualizer_data_source = "/tmp/mpd.fifo"; visualizer_output_name = "my_fifo"; diff --git a/depot/users/kat/media/obs.nix b/depot/users/kat/media/obs.nix index c41cb434..32c04e24 100644 --- a/depot/users/kat/media/obs.nix +++ b/depot/users/kat/media/obs.nix @@ -3,6 +3,7 @@ { programs.obs-studio = { enable = true; + package = pkgs.obs-studio-pipewire; plugins = [ pkgs.obs-studio-plugins.wlrobs ]; }; diff --git a/depot/users/kat/sway/konawall.nix b/depot/users/kat/sway/konawall.nix index 49434241..2176aeff 100644 --- a/depot/users/kat/sway/konawall.nix +++ b/depot/users/kat/sway/konawall.nix @@ -1,5 +1,8 @@ -{ config, ... }: +{ config, pkgs, ... }: { - services.konawall = { enable = true; }; + services.konawall = { + enable = true; + package = pkgs.konawall-sway; + }; } diff --git a/depot/users/kat/sway/packages.nix b/depot/users/kat/sway/packages.nix index a4fabfaf..fd5f0a12 100644 --- a/depot/users/kat/sway/packages.nix +++ b/depot/users/kat/sway/packages.nix @@ -1,5 +1,5 @@ { config, pkgs, ... }: { - home.packages = with pkgs; [ kat-scrot ]; + home.packages = with pkgs; [ sway-scrot ]; } diff --git a/depot/users/kat/sway/sway.nix b/depot/users/kat/sway/sway.nix index 71ba5ee8..0c53f9b3 100644 --- a/depot/users/kat/sway/sway.nix +++ b/depot/users/kat/sway/sway.nix @@ -279,22 +279,22 @@ in # screenshots - upload "${cfg.modifier}+Print" = - "exec ${pkgs.kat-scrot}/bin/kat-scrot --notify upload screen"; + "exec ${pkgs.sway-scrot}/bin/sway-scrot --notify upload screen"; "${cfg.modifier}+Shift+Print" = - "exec ${pkgs.kat-scrot}/bin/kat-scrot --notify upload area"; + "exec ${pkgs.sway-scrot}/bin/sway-scrot --notify upload area"; "${cfg.modifier}+Mod1+Print" = - "exec ${pkgs.kat-scrot}/bin/kat-scrot --notify upload window"; + "exec ${pkgs.sway-scrot}/bin/sway-scrot --notify upload window"; "${cfg.modifier}+Control+Print" = - "exec ${pkgs.kat-scrot}/bin/kat-scrot --notify upload output"; + "exec ${pkgs.sway-scrot}/bin/sway-scrot --notify upload output"; # screenshots - clipboard - "Print" = "exec ${pkgs.kat-scrot}/bin/kat-scrot --notify copys screen"; + "Print" = "exec ${pkgs.sway-scrot}/bin/sway-scrot --notify copys screen"; "Shift+Print" = - "exec ${pkgs.kat-scrot}/bin/kat-scrot --notify copys area"; + "exec ${pkgs.sway-scrot}/bin/sway-scrot --notify copys area"; "Mod1+Print" = - "exec ${pkgs.kat-scrot}/bin/kat-scrot --notify copys window"; + "exec ${pkgs.sway-scrot}/bin/sway-scrot --notify copys window"; "Control+Print" = - "exec ${pkgs.kat-scrot}/bin/kat-scrot --notify copys output"; + "exec ${pkgs.sway-scrot}/bin/sway-scrot --notify copys output"; # layout handling "${cfg.modifier}+b" = "splith"; diff --git a/depot/users/kat/sway/waybar/default.nix b/depot/users/kat/sway/waybar/default.nix index 651df79a..ba84f720 100644 --- a/depot/users/kat/sway/waybar/default.nix +++ b/depot/users/kat/sway/waybar/default.nix @@ -52,15 +52,15 @@ in format = "{}"; interval = 300; return-type = "json"; - exec = "${pkgs.kat-gpg-status}/bin/kat-gpg-status"; + exec = "${pkgs.waybar-gpg}/bin/kat-gpg-status"; }; "custom/konawall" = { format = "{}"; interval = "once"; return-type = "json"; - exec = "${pkgs.konawall-toggle}/bin/konawall-status"; + exec = "${pkgs.waybar-konawall}/bin/konawall-status"; exec-on-event = true; - on-click = "${pkgs.konawall-toggle}/bin/konawall-toggle"; + on-click = "${pkgs.waybar-konawall}/bin/konawall-toggle"; on-click-right = "systemctl --user restart konawall"; }; cpu = { format = " {usage}%"; }; diff --git a/lib/color-helpers.nix b/lib/color-helpers.nix deleted file mode 100644 index 76ee77a7..00000000 --- a/lib/color-helpers.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ lib }: rec { - hexChars = - [ "0" "1" "2" "3" "4" "5" "6" "7" "8" "9" "a" "b" "c" "d" "e" "f" ]; - hexCharToInt = char: - let - pairs = lib.imap0 (lib.flip lib.nameValuePair) hexChars; - idx = builtins.listToAttrs pairs; - in - idx.${lib.toLower char}; - hexToInt = str: - lib.foldl (value: chr: value * 16 + hexCharToInt chr) 0 - (lib.stringToCharacters str); - hextorgba = hex: alpha: - ( - let - r_hex = lib.substring 1 2 hex; - g_hex = lib.substring 3 2 hex; - b_hex = lib.substring 5 2 hex; - r_dec = hexToInt r_hex; - g_dec = hexToInt g_hex; - b_dec = hexToInt b_hex; - in - "rgba(${toString r_dec}, ${toString g_dec}, ${toString b_dec}, ${toString alpha})" - ); -} diff --git a/lib/default.nix b/lib/default.nix deleted file mode 100644 index b8b3c589..00000000 --- a/lib/default.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ pkgs ? import { } -, lib ? pkgs.lib -# for internal use... -, super ? if !isOverlayLib then lib else { } -, self ? if isOverlayLib then lib else { } -, before ? if !isOverlayLib then lib else { } -, isOverlayLib ? false -}@args: let - colorHelpers = import ./color-helpers.nix { inherit lib; }; - lib = before // katlib // self; - katlib = with before; with katlib; with self; -{ - inherit (colorHelpers) hextorgba; - hostImport = import ./host-import.nix { inherit lib; }; - virtualHostGen = import ./virtual-host-gen.nix { inherit lib; }; - domainMerge = import ./domain-merge.nix { inherit lib; }; - modListMerge = import ./intersect-merge.nix { inherit lib; }; - modList = import ./module-list.nix { inherit lib; }; - folderList = import ./folder-list.nix { inherit lib; }; -}; in katlib diff --git a/lib/domain-merge.nix b/lib/domain-merge.nix deleted file mode 100644 index f3bed75c..00000000 --- a/lib/domain-merge.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ lib }: { folder, defaultFile ? "default.nix", folderPaths ? [ (../depot + "/${folder}") (../depot/trusted + "/${folder}") ] }: with lib; let - defaultFileFinal = if (defaultFile == "default.nix" && folder == "hosts") then - "meta.nix" - else defaultFile; - folderModLists = map (folderPath: modList { - modulesDir = folderPath; - defaultFile = defaultFileFinal; - }) (filter builtins.pathExists folderPaths); -in foldl modListMerge { } folderModLists diff --git a/lib/folder-list.nix b/lib/folder-list.nix deleted file mode 100644 index 2c50ed6e..00000000 --- a/lib/folder-list.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ lib }: path: excludes: let -filterAttrNamesToList = filter: set: - lib.foldl' (a: b: a ++ b) [ ] - (map (e: if (filter e set.${e}) then [ e ] else [ ]) (lib.attrNames set)); -in (filterAttrNamesToList (name: type: ! (builtins.elem name excludes) && type == "directory") (builtins.readDir path)) diff --git a/lib/host-import.nix b/lib/host-import.nix deleted file mode 100644 index 7f095424..00000000 --- a/lib/host-import.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ lib }: { hostName, profiles }: with lib; filter builtins.pathExists [ - (../depot/hosts + "/${hostName}/nixos.nix") - (../depot/trusted/hosts + "/${hostName}/nixos.nix") -] ++ (if builtins.isAttrs profiles.base then profiles.base.imports -else singleton profiles.base) ++ singleton { - home-manager.users.kat = { - imports = filter builtins.pathExists [ - (../depot/hosts + "/${hostName}/home.nix") - (../depot/trusted/hosts + "/${hostName}/home.nix") - ]; - }; -} diff --git a/lib/intersect-merge.nix b/lib/intersect-merge.nix deleted file mode 100644 index 15a385bd..00000000 --- a/lib/intersect-merge.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ lib }: pathsA: pathsB: with lib; let - pathIntersection = intersectLists (attrNames pathsA) (attrNames pathsB); - pathMerger = pathA: pathB: { imports = [ pathA pathB ]; }; -in pathsA // pathsB // genAttrs pathIntersection (key: (pathMerger pathsA.${key} pathsB.${key})) diff --git a/lib/module-list.nix b/lib/module-list.nix deleted file mode 100644 index ccb2ce9c..00000000 --- a/lib/module-list.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ lib }: { modulesDir, defaultFile ? "default.nix", importAll ? false }: - -with builtins; - -let - isModule = m: lib.isFunction m && (m.isModule or true); - filterAttrNamesToList = filter: set: - foldl' (a: b: a ++ b) [ ] - (map (e: if (filter e set.${e}) then [ e ] else [ ]) (attrNames set)); - nameValuePair = name: value: { inherit name value; }; - listToAttrs = foldl' (acc: val: acc // { ${val.name} = val.value; }) { }; - directories = - filterAttrNamesToList (_: type: type == "directory") (readDir modulesDir); - files = map (dir: nameValuePair dir (modulesDir + "/${dir}/${defaultFile}")) - (filter (f: builtins.pathExists (modulesDir + "/${f}/${defaultFile}")) directories); - modules = map - ({ name, value }: - # if the file contains a function, assume it to be a module and pass the path - # (for dedup and such). if it contains anything else, pass that. - let m = import value; - in - { - inherit name; - value = if lib.isFunction m && ! isModule m then m { inherit lib; } else if isModule m && !importAll then value else m; - }) - files; -in -(listToAttrs modules) diff --git a/lib/virtual-host-gen.nix b/lib/virtual-host-gen.nix deleted file mode 100644 index a3066c6a..00000000 --- a/lib/virtual-host-gen.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ lib }: { config, networkFilter ? [ ], addresses ? [ ], block }: with lib; - -let - networks = config.network.addresses; - filteredNetworks = filterAttrs (n: v: elem n networkFilter && v.enable) networks; - networkValues = attrValues filteredNetworks; - addressList = concatMap (n: n.out.identifierList) networkValues; - hostBlocks = map (host: nameValuePair host block) addressList; -in listToAttrs hostBlocks diff --git a/meta-base.nix b/meta.nix similarity index 100% rename from meta-base.nix rename to meta.nix diff --git a/pkgs.nix b/pkgs.nix new file mode 100644 index 00000000..cd93f9a6 --- /dev/null +++ b/pkgs.nix @@ -0,0 +1,26 @@ +{ sources, system ? builtins.currentSystem, ... }@args: + +let + overlay = self: super: { + nur = import sources.nur { + nurpkgs = self; + pkgs = self; + }; + linuxPackagesFor = kernel: (super.linuxPackagesFor kernel).extend (_: ksuper: { + zfsUnstable = ksuper.zfsUnstable.overrideAttrs (old: { meta = old.meta // { broken = false; }; }); + }); + }; + pkgs = import sources.nixpkgs { + overlays = [ + (import (sources.arcexprs + "/overlay.nix")) + (import (sources.katexprs + "/overlay.nix")) + overlay + ]; + config = { + allowUnfree = true; + permittedInsecurePackages = [ + "ffmpeg-3.4.8" + ]; + }; + }; +in pkgs diff --git a/pkgs/akiflags/default.nix b/pkgs/akiflags/default.nix deleted file mode 100644 index 65bf6bb1..00000000 --- a/pkgs/akiflags/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ lib, stdenv, fetchurl, python36, pythonPackages, installShellFiles }: - -stdenv.mkDerivation { - name = "akiflags"; - buildInputs = [ - (python36.withPackages (pythonPackages: with pythonPackages; [ ])) - ]; - unpackPhase = "true"; - installPhase = '' - mkdir -p $out/bin - cp ${./flags.py} $out/bin/akiflags - chmod +x $out/bin/akiflags - ''; -} diff --git a/pkgs/akiflags/flags.py b/pkgs/akiflags/flags.py deleted file mode 100644 index 7e657cd0..00000000 --- a/pkgs/akiflags/flags.py +++ /dev/null @@ -1,139 +0,0 @@ -#!/usr/bin/env python3 -# SPDX-License-Identifier: BSD-3-Clause - -flags = { - 'trans': [ - ('091', '206', '250'), - ('254', '169', '184'), - ('255', '255', '255'), - ('254', '169', '184'), - ('091', '206', '250'), - ], - 'lesbian': [ - ('213', '045', '000'), - ('255', '154', '086'), - ('255', '255', '255'), - ('211', '098', '164'), - ('163', '002', '098'), - ], - 'bi': [ - ('214', '002', '112'), - ('214', '002', '112'), - ('155', '079', '150'), - ('000', '056', '168'), - ('000', '056', '168'), - ], - 'enby': [ - ('252', '244', '052'), - ('252', '252', '252'), - ('156', '089', '209'), - ('044', '044', '044'), - ], - 'rainbow': [ - ('228', '003', '003'), - ('255', '140', '000'), - ('255', '237', '000'), - ('000', '128', '038'), - ('000', '077', '255'), - ('117', '007', '135'), - ], - 'ace': [ - ('044', '044', '044'), - ('163', '163', '163'), - ('255', '255', '255'), - ('128', '000', '128'), - ], - 'pan': [ - ('255', '033', '140'), - ('255', '033', '140'), - ('255', '216', '000'), - ('255', '216', '000'), - ('033', '177', '255'), - ('033', '177', '255'), - ] -} - - - - -def print_flag(flag, width = 18): - bar = '█' * width - flag_data = flags[flag] - flg_str = '' - - for c in flag_data: - flg_str += f'\x1b[38;2;{c[0]};{c[1]};{c[2]}m\x1b[48;2;{c[0]};{c[1]};{c[2]}m{bar}\x1b[0m\n' - - print(flg_str, end = '') - - - -if __name__ == '__main__': - import sys - from os import get_terminal_size - from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter - - parser = ArgumentParser( - formatter_class = ArgumentDefaultsHelpFormatter, - description = '24-bit color terminal pride flags' - ) - - display = parser.add_argument_group('Display Options') - - display.add_argument( - '--banner', '-b', - default = False, - action = 'store_true', - help = 'Print the flag the whole width of the terminal' - ) - - display.add_argument( - '--width', '-w', - default = 18, - type = int, - help = 'Width of the flag' - ) - - display.add_argument( - '--insert-break', '-B', - default = False, - action = 'store_true', - help = 'Insert a line break between flags' - ) - - parser.add_argument( - '--random', '-r', - default = False, - action = 'store_true', - help = 'Show a random pride flag' - ) - - parser.add_argument( - '--flags', '-f', - default = [], - choices = list(flags.keys()), - nargs = '+', - help = 'The flags which to display' - ) - - args = parser.parse_args() - - width = args.width - - if args.banner: - width = get_terminal_size().columns - - if not args.random: - if len(args.flags) == 0: - print('you must specify at least one flag or --random') - sys.exit(1) - - for flag in args.flags: - print_flag(flag, width = width) - if args.insert_break: - print('') - else: - import random - print_flag(random.choice(list(flags.keys())), width = width) - - sys.exit(0) diff --git a/pkgs/default.nix b/pkgs/default.nix deleted file mode 100644 index 3c228f79..00000000 --- a/pkgs/default.nix +++ /dev/null @@ -1,117 +0,0 @@ -{ sources, system ? builtins.currentSystem, ... }@args: - -let - liboverlay = self: super: { - lib = super.lib.extend (self: super: import ../lib - { - inherit super; - lib = self; - isOverlayLib = true; - } - ); - }; - overlay = self: super: rec { - dino = super.dino.overrideAttrs ( - { patches ? [], ... }: { - patches = patches ++ [ - ./dino/0001-add-an-option-to-enable-omemo-by-default-in-new-conv.patch - ]; - } - ); - - discord = super.discord.override { nss = self.nss; }; - - ncmpcpp = super.ncmpcpp.override { - visualizerSupport = true; - clockSupport = true; - }; - - waybar = super.waybar.override { pulseSupport = true; }; - - nur = import sources.nur { - nurpkgs = self; - pkgs = self; - }; - - screenstub = super.callPackage ./screenstub { }; - - buildFirefoxXpiAddon = - { pname, version, addonId, url, sha256, meta, ... }: - pkgs.stdenv.mkDerivation { - name = "${pname}-${version}"; - - inherit meta; - - src = builtins.fetchurl { inherit url sha256; }; - - preferLocalBuild = true; - allowSubstitutes = false; - - buildCommand = '' - dst="$out/share/mozilla/extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}" - mkdir -p "$dst" - install -v -m644 "$src" "$dst/${addonId}.xpi" - ''; - }; - - linuxPackagesFor = kernel: (super.linuxPackagesFor kernel).extend (_: ksuper: { - zfsUnstable = ksuper.zfsUnstable.overrideAttrs (old: { meta = old.meta // { broken = false; }; }); - }); - - akiflags = self.callPackage ./akiflags { }; - - konawall-toggle = self.callPackage ./konawall-toggle { }; - - yggdrasil = self.callPackage ./yggdrasil { }; - - obs-studio = super.obs-studio.override { pipewireSupport = true; }; - - libreelec-dvb-firmware = self.callPackage ./libreelec-dvb-firmware { }; - - nerdfonts = super.nerdfonts.override { fonts = [ "Iosevka" ]; }; - - konawall = super.konawall.overide { swaySupport = true; }; - - wezterm-terminfo = self.callPackage ./wezterm-terminfo { inherit (self) ncurses; }; - - imv = super.imv.override { - withBackends = [ "freeimage" "libjpeg" "libpng" "librsvg" "libnsgif" "libheif" "libtiff" ]; - }; - - kat-splash = self.callPackage ./kat-splash { }; - - kat-website = self.callPackage ./kat-website { }; - - kat-gpg-status = self.callPackage ./kat-gpg-status { }; - - kat-tw-export = self.callPackage ./kat-tw-export { }; - - kat-vm = self.callPackage ./kat-vm { } ; - - kat-scrot = self.callPackage ./kat-scrot { }; - - fusionpbx = self.callPackage ./fusionpbx { }; - - fusionpbx-apps = self.callPackage ./fusionpbx-apps { }; - - fusionpbxWithApps = apps: self.symlinkJoin { - inherit (self.fusionpbx) version name; - paths = [ self.fusionpbx ] ++ apps; - }; - - } // super.lib.optionalAttrs (builtins.pathExists ../config/trusted/pkgs) - (import ../config/trusted/pkgs { inherit super self; }); - pkgs = import sources.nixpkgs { - overlays = [ - (import (sources.nixexprs + "/overlay.nix")) - overlay - liboverlay - ]; - config = { - allowUnfree = true; - permittedInsecurePackages = [ - "ffmpeg-3.4.8" - ]; - }; - }; -in pkgs diff --git a/pkgs/dino/0001-add-an-option-to-enable-omemo-by-default-in-new-conv.patch b/pkgs/dino/0001-add-an-option-to-enable-omemo-by-default-in-new-conv.patch deleted file mode 100644 index 030c165d..00000000 --- a/pkgs/dino/0001-add-an-option-to-enable-omemo-by-default-in-new-conv.patch +++ /dev/null @@ -1,115 +0,0 @@ -From cee5e27b157081a3ce55869bd5f649560a6127ea Mon Sep 17 00:00:00 2001 -From: lumi -Date: Thu, 17 Oct 2019 16:43:40 +0200 -Subject: [PATCH] add an option to enable omemo by default in new conversations - ---- - libdino/src/entity/settings.vala | 10 ++++++++++ - libdino/src/service/conversation_manager.vala | 5 +++++ - main/data/settings_dialog.ui | 12 ++++++++++++ - main/src/ui/settings_dialog.vala | 3 +++ - 4 files changed, 30 insertions(+) - -diff --git a/libdino/src/entity/settings.vala b/libdino/src/entity/settings.vala -index bf1ebed..f9cd734 100644 ---- a/libdino/src/entity/settings.vala -+++ b/libdino/src/entity/settings.vala -@@ -11,6 +11,7 @@ public class Settings : Object { - send_marker_ = col_to_bool_or_default("send_marker", true); - notifications_ = col_to_bool_or_default("notifications", true); - convert_utf8_smileys_ = col_to_bool_or_default("convert_utf8_smileys", true); -+ omemo_default_ = col_to_bool_or_default("omemo_default", false); - } - - private bool col_to_bool_or_default(string key, bool def) { -@@ -53,6 +54,15 @@ public class Settings : Object { - convert_utf8_smileys_ = value; - } - } -+ -+ private bool omemo_default_; -+ public bool omemo_default { -+ get { return omemo_default_; } -+ set { -+ db.settings.insert().or("REPLACE").value(db.settings.key, "omemo_default").value(db.settings.value, value.to_string()).perform(); -+ omemo_default_ = value; -+ } -+ } - } - - } -diff --git a/libdino/src/service/conversation_manager.vala b/libdino/src/service/conversation_manager.vala -index c473ea7..e980e08 100644 ---- a/libdino/src/service/conversation_manager.vala -+++ b/libdino/src/service/conversation_manager.vala -@@ -8,6 +8,8 @@ public class ConversationManager : StreamInteractionModule, Object { - public static ModuleIdentity IDENTITY = new ModuleIdentity("conversation_manager"); - public string id { get { return IDENTITY.id; } } - -+ private Dino.Entities.Settings settings = Dino.Application.get_default().settings; -+ - public signal void conversation_activated(Conversation conversation); - public signal void conversation_deactivated(Conversation conversation); - -@@ -46,6 +48,9 @@ public class ConversationManager : StreamInteractionModule, Object { - - // Create a new converation - Conversation conversation = new Conversation(jid, account, type); -+ if (settings.omemo_default) { -+ conversation.encryption = Encryption.OMEMO; -+ } - add_conversation(conversation); - conversation.persist(db); - return conversation; -diff --git a/main/data/settings_dialog.ui b/main/data/settings_dialog.ui -index c76f347..23ee7b8 100644 ---- a/main/data/settings_dialog.ui -+++ b/main/data/settings_dialog.ui -@@ -65,6 +65,18 @@ - 1 - - -+ -+ -+ Enable OMEMO by default -+ True -+ -+ -+ 0 -+ 4 -+ 1 -+ 1 -+ -+ - - - -diff --git a/main/src/ui/settings_dialog.vala b/main/src/ui/settings_dialog.vala -index 68c711d..6401a2d 100644 ---- a/main/src/ui/settings_dialog.vala -+++ b/main/src/ui/settings_dialog.vala -@@ -9,6 +9,7 @@ class SettingsDialog : Dialog { - [GtkChild] private CheckButton marker_checkbutton; - [GtkChild] private CheckButton notification_checkbutton; - [GtkChild] private CheckButton emoji_checkbutton; -+ [GtkChild] private CheckButton omemo_default_checkbutton; - - Dino.Entities.Settings settings = Dino.Application.get_default().settings; - -@@ -19,11 +20,13 @@ class SettingsDialog : Dialog { - marker_checkbutton.active = settings.send_marker; - notification_checkbutton.active = settings.notifications; - emoji_checkbutton.active = settings.convert_utf8_smileys; -+ omemo_default_checkbutton.active = settings.omemo_default; - - typing_checkbutton.toggled.connect(() => { settings.send_typing = typing_checkbutton.active; } ); - marker_checkbutton.toggled.connect(() => { settings.send_marker = marker_checkbutton.active; } ); - notification_checkbutton.toggled.connect(() => { settings.notifications = notification_checkbutton.active; } ); - emoji_checkbutton.toggled.connect(() => { settings.convert_utf8_smileys = emoji_checkbutton.active; }); -+ omemo_default_checkbutton.toggled.connect(() => { settings.omemo_default = omemo_default_checkbutton.active; }); - } - } - --- -2.23.0 - diff --git a/pkgs/fusionpbx-apps/default.nix b/pkgs/fusionpbx-apps/default.nix deleted file mode 100644 index f6ee8736..00000000 --- a/pkgs/fusionpbx-apps/default.nix +++ /dev/null @@ -1,80 +0,0 @@ -{ - lib, - stdenv, - fetchFromGitHub -}: - -stdenv.mkDerivation rec { - pname = "fusionpbx-apps"; - version = "master"; - - src = fetchFromGitHub { - owner = "fusionpbx"; - repo = pname; - rev = "c0eb1c852332a8ba3010e54cd1ac634c47f832fb"; - sha256 = "0gqlzzd2m2g2njxqr1kd7bcy3wi4irv7i5njqa8d8iiwwmnvbb4r"; - }; - - apps = [ - "active_extensions" - "backup" - "bdr" - "bulk_account_settings" - "bulk_import_extensions" - "call_acl" - "cdr" - "content" - "domain_counts" - "fifo_agents" - "get_call_details" - "help" - "invoices" - "languages" - "mobile_twinning" - "php_service" - "profiles" - "roku" - "schemas" - "school_bells" - "servers" - "services" - "sessiontalk" - "sipjs" - "sipml5" - "sms" - "soft_phone" - "tickets" - "users_bulk_add" - "voicemail_msgs" - "voicemail_status" - "webrtc" - "xmpp" - "zoiper" - ]; - - outputs = lib.singleton "out" ++ apps; - - postPatch = '' - mv mobile-twinning mobile_twinning - ''; - - installPhase = '' - mkdir $out - for app in $apps; do - mkdir -p ''${!app}/app - mv $app ''${!app}/app/ - if [[ -d ''${app}/resources/install/scripts/app ]]; then - mkdir -p ''${!app}/app/scripts/resources/scripts/app - ln -s ''${!app}/resources/install/scripts/app/* ''${!app}/app/scripts/resources/scripts/app/ - fi - done - ''; - - meta = with lib; { - description = "Applications for FusionPBX."; - homepage = "https://www.fusionpbx.com/"; - license = with licenses; mpl11; - maintainers = with maintainers; [ kittywitch ]; - platforms = with platforms; unix; - }; -} diff --git a/pkgs/fusionpbx/default.nix b/pkgs/fusionpbx/default.nix deleted file mode 100644 index e4ee7052..00000000 --- a/pkgs/fusionpbx/default.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ - lib, - stdenv, - fetchFromGitHub -}: - -stdenv.mkDerivation rec { - pname = "fusionpbx"; - version = "master"; - - src = fetchFromGitHub { - owner = pname; - repo = pname; - rev = "2b8d011321ee5f2ffba967e38fcc8c542f378502"; - sha256 = "0fsmf67hrddz6aqjrjjqxa72iw108z2skwhn9jb3p465xfq7a9ij"; - }; - - installPhase = '' - mkdir -p $out - mv * $out - ''; - - meta = with lib; { - description = "A full-featured domain based multi-tenant PBX and voice switch for FreeSWITCH."; - homepage = "https://www.fusionpbx.com/"; - license = with licenses; mpl11; - maintainers = with maintainers; [ kittywitch ]; - platforms = with platforms; unix; - }; -} diff --git a/pkgs/kat-gpg-status/default.nix b/pkgs/kat-gpg-status/default.nix deleted file mode 100644 index 072e4293..00000000 --- a/pkgs/kat-gpg-status/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ wrapShellScriptBin, pkgs }: - -wrapShellScriptBin "kat-gpg-status" ./kat-gpg-status.sh { - depsRuntimePath = with pkgs; [ coreutils gnupg ]; -} diff --git a/pkgs/kat-gpg-status/kat-gpg-status.sh b/pkgs/kat-gpg-status/kat-gpg-status.sh deleted file mode 100644 index 0a8fceec..00000000 --- a/pkgs/kat-gpg-status/kat-gpg-status.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -set -eu -set -o pipefail - -if gpg --card-status &> /dev/null; then - user="$(gpg --card-status | grep 'Login data' | awk '{print $NF}')"; - status='{"text": "", "alt": "User: '"$user"'", "class": "enabled"}' -else - status='{"text": "", "alt": "No card is connected.", "class": "disabled"}' -fi - -echo $status diff --git a/pkgs/kat-scrot/default.nix b/pkgs/kat-scrot/default.nix deleted file mode 100644 index 9125d243..00000000 --- a/pkgs/kat-scrot/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ wrapShellScriptBin, pkgs }: - -wrapShellScriptBin "kat-scrot" ./kat-scrot.sh { - depsRuntimePath = with pkgs; [ coreutils wl-clipboard slurp grim sway jq ]; -} diff --git a/pkgs/kat-scrot/kat-scrot.sh b/pkgs/kat-scrot/kat-scrot.sh deleted file mode 100644 index a14eb995..00000000 --- a/pkgs/kat-scrot/kat-scrot.sh +++ /dev/null @@ -1,177 +0,0 @@ -#!/bin/sh - -## Requirements: -## - `grim`: screenshot utility for wayland -## - `slurp`: to select an area -## - `swaymsg`: to read properties of current window -## - `wl-copy`: clipboard utility -## - `jq`: json utility to parse swaymsg output -## - `notify-send`: to show notifications - -getTargetDirectory() { - echo "/home/kat/media/scrots" -} - -if [ "$1" = "--notify" ]; then - NOTIFY=yes - shift 1 -else - NOTIFY=no -fi - -ACTION=${1:-usage} -SUBJECT=${2:-screen} -FILENAME="$(date -Ins).png" -FILE=${3:-$(getTargetDirectory)/$FILENAME} - -REMOTE_USER="kat" -REMOTE_SERVER="kittywit.ch" -REMOTE_PORT="62954" -REMOTE_PATH="/var/www/files/" -REMOTE_URL="https://files.kittywit.ch/" - -if [ "$ACTION" != "save" ] && [ "$ACTION" != "copy" ] && [ "$ACTION" != "check" ] && [ "$ACTION" != "upload" ] && [ "$ACTION" != "copys" ]; then - echo "Usage:" - echo " kat-scrot [--notify] (copy|save|upload|copys) [active|screen|output|area|window] [FILE]" - echo " kat-scrot check" - echo " kat-scrot usage" - echo "" - echo "Commands:" - echo " copy: Copy the screenshot data into the clipboard." - echo " upload: Uses SCP to transfer the screenshot to a remote server." - echo " copys: Copy the screenshot data into the clipboard and save it to a regular file." - echo " save: Save the screenshot to a regular file." - echo " check: Verify if required tools are installed and exit." - echo " usage: Show this message and exit." - echo "" - echo "Targets:" - echo " active: Currently active window." - echo " screen: All visible outputs." - echo " output: Currently active output." - echo " area: Manually select a region." - echo " window: Manually select a window." - exit -fi - -notify() { - notify-send -t 3000 -a grimshot "$@" -} -notifyOk() { - [ "$NOTIFY" = "no" ] && return - - TITLE=${2:-"Screenshot"} - MESSAGE=${1:-"OK"} - notify "$TITLE" "$MESSAGE" -} -notifyError() { - if [ $NOTIFY = "yes" ]; then - TITLE=${2:-"Screenshot"} - MESSAGE=${1:-"Error taking screenshot with grim"} - notify -u critical "$TITLE" "$MESSAGE" - else - echo $1 - fi -} - -die() { - MSG=${1:-Bye} - notifyError "Error: $MSG" - exit 2 -} - -check() { - COMMAND=$1 - if command -v "$COMMAND" > /dev/null 2>&1; then - RESULT="OK" - else - RESULT="NOT FOUND" - fi - echo " $COMMAND: $RESULT" -} - -takeScreenshot() { - FILE=$1 - GEOM=$2 - OUTPUT=$3 - if [ ! -z "$OUTPUT" ]; then - grim -o "$OUTPUT" "$FILE" || die "Unable to invoke grim" - elif [ -z "$GEOM" ]; then - grim "$FILE" || die "Unable to invoke grim" - else - grim -g "$GEOM" "$FILE" || die "Unable to invoke grim" - fi -} - -if [ "$ACTION" = "check" ] ; then - echo "Checking if required tools are installed. If something is missing, install it to your system and make it available in PATH..." - check grim - check slurp - check swaymsg - check wl-copy - check jq - check notify-send - exit -elif [ "$SUBJECT" = "area" ] ; then - GEOM=$(slurp -d) - # Check if user exited slurp without selecting the area - if [ -z "$GEOM" ]; then - exit - fi - WHAT="Area" -elif [ "$SUBJECT" = "active" ] ; then - FOCUSED=$(swaymsg -t get_tree | jq -r 'recurse(.nodes[]?, .floating_nodes[]?) | select(.focused)') - GEOM=$(echo "$FOCUSED" | jq -r '.rect | "\(.x),\(.y) \(.width)x\(.height)"') - APP_ID=$(echo "$FOCUSED" | jq -r '.app_id') - WHAT="$APP_ID window" -elif [ "$SUBJECT" = "screen" ] ; then - GEOM="" - WHAT="Screen" -elif [ "$SUBJECT" = "output" ] ; then - GEOM="" - OUTPUT=$(swaymsg -t get_outputs | jq -r '.[] | select(.focused)' | jq -r '.name') - WHAT="$OUTPUT" -elif [ "$SUBJECT" = "window" ] ; then - GEOM=$(swaymsg -t get_tree | jq -r '.. | select(.pid? and .visible?) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' | slurp) - # Check if user exited slurp without selecting the area - if [ -z "$GEOM" ]; then - exit - fi - WHAT="Window" -else - die "Unknown subject to take a screen shot from" "$SUBJECT" -fi - -if [ "$ACTION" = "copy" ] ; then - takeScreenshot - "$GEOM" "$OUTPUT" | wl-copy --type image/png || die "Clipboard error" - notifyOk "$WHAT copied to buffer" -elif [ "$ACTION" = "copys" ]; then - if takeScreenshot "$FILE" "$GEOM" "$OUTPUT"; then - TITLE="Screenshot of $SUBJECT" - MESSAGE=$(basename "$FILE") - notifyOk "$MESSAGE" "$TITLE" - echo $FILE - cat "$FILE" | wl-copy --type image/png || die "Clipboard error" - else - notifyError "Error taking screenshot with grim" - fi -elif [ "$ACTION" = "upload" ]; then - if takeScreenshot "$FILE" "$GEOM" "$OUTPUT"; then - if scp -P $REMOTE_PORT $FILE $REMOTE_USER@$REMOTE_SERVER:$REMOTE_PATH$FILENAME; then - echo -n $REMOTE_URL$FILENAME | wl-copy - notifyOk "Uploaded: $REMOTE_URL$FILENAME" - else - notifyError "Error uploading screenshot" - fi - else - notifyError "Error taking screenshot with grim" - fi -else - if takeScreenshot "$FILE" "$GEOM" "$OUTPUT"; then - TITLE="Screenshot of $SUBJECT" - MESSAGE=$(basename "$FILE") - notifyOk "$MESSAGE" "$TITLE" - echo $FILE - else - notifyError "Error taking screenshot with grim" - fi -fi diff --git a/pkgs/kat-splash/default.nix b/pkgs/kat-splash/default.nix deleted file mode 100644 index a7bdc9f1..00000000 --- a/pkgs/kat-splash/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ writeTextFile, linkFarm }: hostname: - -let mewp = writeTextFile { - name = "index.html"; - text = '' - - - kat's ${hostname} - - -

mew! welcome to ${hostname} ><

- - - -

stop snooping, it's mean! o:

- - -''; }; mewy = "${./splash.jpg}"; -in linkFarm "index" [ - { name = "index.html"; path = mewp; } - { name = "splash.jpg"; path = mewy; } -] diff --git a/pkgs/kat-splash/splash.jpg b/pkgs/kat-splash/splash.jpg deleted file mode 100644 index 5f3231d6..00000000 Binary files a/pkgs/kat-splash/splash.jpg and /dev/null differ diff --git a/pkgs/kat-tw-export/default.nix b/pkgs/kat-tw-export/default.nix deleted file mode 100644 index e7375cb9..00000000 --- a/pkgs/kat-tw-export/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -{ stdenv, makeWrapper, perl, perlPackages }: - -stdenv.mkDerivation rec { - pname = "kat-tw-export"; - version = "0.0.1"; - src = ./tw.pl; - buildInputs = [ perl perlPackages.JSON ]; - nativeBuildInputs = [ makeWrapper ]; - unpackPhase = "true"; - installPhase = '' - install -Dm0755 $src $out/bin/kat-tw-export - wrapProgram $out/bin/kat-tw-export --set PERL5LIB $PERL5LIB - ''; -} diff --git a/pkgs/kat-tw-export/tw.pl b/pkgs/kat-tw-export/tw.pl deleted file mode 100644 index 853f24b5..00000000 --- a/pkgs/kat-tw-export/tw.pl +++ /dev/null @@ -1,90 +0,0 @@ -#!/usr/bin/env perl -################################################################################ -## -## Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez. -## -## Permission is hereby granted, free of charge, to any person obtaining a copy -## of this software and associated documentation files (the "Software"), to deal -## in the Software without restriction, including without limitation the rights -## to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -## copies of the Software, and to permit persons to whom the Software is -## furnished to do so, subject to the following conditions: -## -## The above copyright notice and this permission notice shall be included -## in all copies or substantial portions of the Software. -## -## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -## OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -## THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -## LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -## OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -## SOFTWARE. -## -## http://www.opensource.org/licenses/mit-license.php -## -################################################################################ - -use strict; -use warnings; - -# Give a nice error if the (non-standard) JSON module is not installed. -eval "use JSON"; -if ($@) -{ - print "Error: You need to install the JSON Perl module.\n"; - exit 1; -} - -# Use the taskwarrior 2.0+ export command to filter and return JSON -my $command = join (' ', ("env PATH='$ENV{PATH}' task rc.verbose=nothing rc.json.array=no export", @ARGV)); -if ($command =~ /No matches/) -{ - printf STDERR $command; - exit 1; -} - -# Generate output. -print "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n"; - -my $count = 0; -for my $task (split "\n", qx{$command}) -{ - ++$count; - my $data = from_json ($task); - - print " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n"; -} - -print " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
IDPriDescriptionProjectDue
", ($data->{'id'} || ''), "", ($data->{'priority'} || ''), "", ($data->{'description'} || ''), "", ($data->{'project'} || ''), "", ($data->{'due'} || ''), "
", $count, " matching tasks
\n", - " \n", - "\n"; - -exit 0; - -################################################################################ - diff --git a/pkgs/kat-vm/default.nix b/pkgs/kat-vm/default.nix deleted file mode 100644 index bc69e385..00000000 --- a/pkgs/kat-vm/default.nix +++ /dev/null @@ -1,88 +0,0 @@ -{ pkgs, writeShellScriptBin }: - -writeShellScriptBin "kat-vm" '' - cat ${pkgs.OVMF.fd}/FV/OVMF_VARS.fd > /tmp/OVMF_VARS.fd - ${pkgs.qemu-vfio}/bin/qemu-system-x86_64 -name guest=win10,debug-threads=on \ - -blockdev '{"driver":"file","filename":"${pkgs.OVMF.fd}/FV/OVMF_CODE.fd","node-name":"libvirt-pflash0-storage","auto-read-only":true,"discard":"unmap"}' \ - -blockdev '{"node-name":"libvirt-pflash0-format","read-only":true,"driver":"raw","file":"libvirt-pflash0-storage"}' \ - -blockdev '{"driver":"file","filename":"/tmp/OVMF_VARS.fd","node-name":"libvirt-pflash1-storage","auto-read-only":true,"discard":"unmap"}' \ - -blockdev '{"node-name":"libvirt-pflash1-format","read-only":false,"driver":"raw","file":"libvirt-pflash1-storage"}' \ - -machine pc-q35-5.1,accel=kvm,usb=off,vmport=off,dump-guest-core=off,pflash0=libvirt-pflash0-format,pflash1=libvirt-pflash1-format,memory-backend=pc.ram \ - -monitor stdio \ - -cpu host,migratable=on,topoext=on,hv-time,hv-relaxed,hv-vapic,hv-spinlocks=0x1fff,host-cache-info=on,l3-cache=off -m 12288 \ - -vcpu vcpunum=0,affinity=0 \ - -vcpu vcpunum=1,affinity=1 \ - -vcpu vcpunum=2,affinity=2 \ - -vcpu vcpunum=3,affinity=3 \ - -vcpu vcpunum=4,affinity=6 \ - -vcpu vcpunum=5,affinity=7 \ - -vcpu vcpunum=6,affinity=8 \ - -vcpu vcpunum=7,affinity=9 \ - -object memory-backend-ram,id=pc.ram,size=12884901888 -overcommit mem-lock=off \ - -smp 8,sockets=1,dies=1,cores=4,threads=2 \ - -object iothread,id=iothread1 -uuid 96052919-6a83-4e9f-8e9b-628de3e27cc1 \ - -display none \ - -no-user-config \ - -nodefaults \ - -rtc base=localtime,driftfix=slew -global kvm-pit.lost_tick_policy=delay \ - -no-hpet -no-shutdown \ - -global ICH9-LPC.disable_s3=1 \ - -global ICH9-LPC.disable_s4=1 \ - -boot strict=on \ - -device pcie-root-port,port=0x10,chassis=1,id=pci.1,bus=pcie.0,multifunction=on,addr=0x2 \ - -device pcie-root-port,port=0x11,chassis=2,id=pci.2,bus=pcie.0,addr=0x2.0x1 \ - -device pcie-root-port,port=0x12,chassis=3,id=pci.3,bus=pcie.0,addr=0x2.0x2 \ - -device pcie-root-port,port=0x13,chassis=4,id=pci.4,bus=pcie.0,addr=0x2.0x3 \ - -device pcie-root-port,port=0x14,chassis=5,id=pci.5,bus=pcie.0,addr=0x2.0x4 \ - -device pcie-root-port,port=0x15,chassis=6,id=pci.6,bus=pcie.0,addr=0x2.0x5 \ - -device pcie-root-port,port=0x16,chassis=7,id=pci.7,bus=pcie.0,addr=0x2.0x6 \ - -device pcie-pci-bridge,id=pci.8,bus=pci.4,addr=0x0 \ - -device pcie-root-port,port=0x17,chassis=9,id=pci.9,bus=pcie.0,addr=0x2.0x7 \ - -device pcie-root-port,port=0x8,chassis=10,id=pci.10,bus=pcie.0,multifunction=on,addr=0x1 \ - -device pcie-root-port,port=0xa,chassis=11,id=pci.11,bus=pcie.0,addr=0x1.0x1 \ - -device pcie-root-port,port=0xa,chassis=12,id=pci.12,bus=pcie.0,addr=0x1.0x2 \ - -device pcie-root-port,port=0xb,chassis=13,id=pci.13,bus=pcie.0,addr=0x1.0x3 \ - -device pcie-root-port,port=0xc,chassis=14,id=pci.14,bus=pcie.0,addr=0x1.0x4 \ - -device pcie-root-port,port=0xd,chassis=15,id=pci.15,bus=pcie.0,addr=0x1.0x5 \ - -device pcie-root-port,port=0xe,chassis=16,id=pci.16,bus=pcie.0,addr=0x1.0x6 \ - -device pcie-root-port,port=0xf,chassis=17,id=pci.17,bus=pcie.0,addr=0x1.0x7 \ - -device pcie-root-port,port=0x18,chassis=18,id=pci.18,bus=pcie.0,multifunction=on,addr=0x3 \ - -device pcie-root-port,port=0x19,chassis=19,id=pci.19,bus=pcie.0,addr=0x3.0x1 \ - -device pcie-root-port,port=0x1a,chassis=20,id=pci.20,bus=pcie.0,addr=0x3.0x2 \ - -device pcie-root-port,port=0x1b,chassis=21,id=pci.21,bus=pcie.0,addr=0x3.0x3 \ - -device pcie-root-port,port=0x1c,chassis=22,id=pci.22,bus=pcie.0,addr=0x3.0x4 \ - -device pcie-root-port,port=0x1d,chassis=23,id=pci.23,bus=pcie.0,multifunction=on,addr=0x3.0x5 \ - -device pcie-pci-bridge,id=pci.24,bus=pci.10,addr=0x0 \ - -device ich9-usb-ehci1,id=usb -device ich9-usb-uhci1,masterbus=usb.0,firstport=0,multifunction=on -device ich9-usb-uhci2,masterbus=usb.0,firstport=2 -device ich9-usb-uhci3,masterbus=usb.0,firstport=4 \ - -device qemu-xhci,id=usb3,p2=4,p3=8 \ - -device virtio-scsi-pci,id=scsi0,bus=pci.6,addr=0x0 \ - -device virtio-serial-pci,id=virtio-serial0,bus=pci.3,addr=0x0 \ - -device ich9-intel-hda,id=sound0 \ - -device hda-output,audiodev=pa1 \ - -device hda-micro,audiodev=pa1 \ - -audiodev pa,id=pa1,server=/run/user/1000/pulse/native,out.buffer-length=4000,timer-period=1000 \ - -blockdev '{"driver":"host_device","filename":"/dev/disk/by-id/ata-HFS256G32TNF-N3A0A_MJ8BN15091150BM1Z","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}' \ - -blockdev '{"node-name":"libvirt-2-format","read-only":false,"discard":"unmap","driver":"raw","file":"libvirt-2-storage"}' \ - -device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=0,device_id=drive-scsi0-0-0-0,drive=libvirt-2-format,id=scsi0-0-0-0,bootindex=2 \ - -device virtio-net-pci,netdev=hostnet0,id=net0,mac=5b:f2:eb:3c:0b:46 \ - -netdev bridge,id=hostnet0,br=br,helper=$(type -P qemu-bridge-helper) \ - -netdev user,id=smbnet0,restrict=yes,net=10.1.2.0/24,host=10.1.2.1,smb=/home/kat/shared/,smbserver=10.1.2.2 \ - -device virtio-net-pci,netdev=smbnet0,id=net1,mac=2b:c6:c4:ac:67:ba \ - -device vfio-pci,host=0000:29:00.0,id=hostdev0,bus=pci.7,addr=0x0 \ - -device vfio-pci,host=0000:29:00.1,id=hostdev1,bus=pci.9,addr=0x0 \ - -device vfio-pci,host=0000:28:00.0,id=hostdev3,bus=pci.11,addr=0x0 \ - -device vfio-pci,host=0000:2b:00.3,id=hostdev4,bus=pci.19,addr=0x0 \ - -device virtio-balloon-pci,id=balloon0,bus=pci.5,addr=0x0 \ - -chardev socket,path=/tmp/vfio-qmp,server,nowait,id=qmp0 \ - -mon chardev=qmp0,id=qmp,mode=control \ - -chardev socket,path=/tmp/vfio-qga,server,nowait,id=qga0 \ - -device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0 \ - -set device.scsi0-0-0-0.rotation_rate=1 \ - -cpu host,hv_time,kvm=off,hv_vendor_id=null,-hypervisor \ - -msg timestamp=on -'' - -# -blockdev '{"driver":"host_device","filename":"/dev/disk/by-id/ata-TOSHIBA_HDWD130_787VUS4AS-part2","aio":"native","node-name":"libvirt-1-storage","cache":{"direct":true,"no-flush":false},"auto-read-only":true,"discard":"unmap"}' \ -# -device scsi-hd,bus=scsi0.0,channel=0,scsi-id=0,lun=1,device_id=drive-scsi0-0-0-1,drive=libvirt-1-format,id=scsi0-0-0-1,bootindex=3 \ -# -blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"direct":true,"no-flush":false},"driver":"raw","file":"libvirt-1-storage"}' \ -# -device vfio-pci,host=0000:21:00.0,id=hostdev2,bus=pci.12,addr=0x0 \ diff --git a/pkgs/kat-website/default.nix b/pkgs/kat-website/default.nix deleted file mode 100644 index 96c81395..00000000 --- a/pkgs/kat-website/default.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ fetchgit, stdenv, lib, bundler, ruby, bundlerEnv }: - -stdenv.mkDerivation rec { - pname = "kat-website"; - version = "0.1"; - - src = fetchgit { - rev = "65b19be1a144c508f3aaaf72eef45e97c973d435"; - url = "https://github.com/kittywitch/website"; - sha256 = "0nmncgpqj6jswyj9wq4cy5jiliaycm0hx8icmycnqxblrkvkdfm6"; - }; - - jekyll_env = bundlerEnv rec { - name = "jekyll_env"; - inherit ruby; - gemfile = "${src}/Gemfile"; - lockfile = "${src}/Gemfile.lock"; - gemset = ./gemset.nix; - }; - - buildInputs = [ bundler ruby jekyll_env ]; - - installPhase = '' - mkdir $out - ${jekyll_env}/bin/jekyll build -d $out - ''; -} - diff --git a/pkgs/kat-website/gemset.nix b/pkgs/kat-website/gemset.nix deleted file mode 100644 index 6023ce80..00000000 --- a/pkgs/kat-website/gemset.nix +++ /dev/null @@ -1,311 +0,0 @@ -{ - addressable = { - dependencies = [ "public_suffix" ]; - groups = [ "default" ]; - platforms = [ ]; - source = { - remotes = [ "https://rubygems.org" ]; - sha256 = "1fvchp2rhp2rmigx7qglf69xvjqvzq7x0g49naliw29r2bz656sy"; - type = "gem"; - }; - version = "2.7.0"; - }; - colorator = { - groups = [ "default" ]; - platforms = [ ]; - source = { - remotes = [ "https://rubygems.org" ]; - sha256 = "0f7wvpam948cglrciyqd798gdc6z3cfijciavd0dfixgaypmvy72"; - type = "gem"; - }; - version = "1.1.0"; - }; - concurrent-ruby = { - groups = [ "default" ]; - platforms = [ ]; - source = { - remotes = [ "https://rubygems.org" ]; - sha256 = "0mr23wq0szj52xnj0zcn1k0c7j4v79wlwbijkpfcscqww3l6jlg3"; - type = "gem"; - }; - version = "1.1.8"; - }; - em-websocket = { - dependencies = [ "eventmachine" "http_parser.rb" ]; - groups = [ "default" ]; - platforms = [ ]; - source = { - remotes = [ "https://rubygems.org" ]; - sha256 = "1mg1mx735a0k1l8y14ps2mxdwhi5r01ikydf34b0sp60v66nvbkb"; - type = "gem"; - }; - version = "0.5.2"; - }; - eventmachine = { - groups = [ "default" ]; - platforms = [ ]; - source = { - remotes = [ "https://rubygems.org" ]; - sha256 = "0wh9aqb0skz80fhfn66lbpr4f86ya2z5rx6gm5xlfhd05bj1ch4r"; - type = "gem"; - }; - version = "1.2.7"; - }; - ffi = { - groups = [ "default" ]; - platforms = [ ]; - source = { - remotes = [ "https://rubygems.org" ]; - sha256 = "15hgiy09i8ywjihyzyvjvk42ivi3kmy6dm21s5sgg9j7y3h3zkkx"; - type = "gem"; - }; - version = "1.14.2"; - }; - forwardable-extended = { - groups = [ "default" ]; - platforms = [ ]; - source = { - remotes = [ "https://rubygems.org" ]; - sha256 = "15zcqfxfvsnprwm8agia85x64vjzr2w0xn9vxfnxzgcv8s699v0v"; - type = "gem"; - }; - version = "2.6.0"; - }; - "http_parser.rb" = { - groups = [ "default" ]; - platforms = [ ]; - source = { - remotes = [ "https://rubygems.org" ]; - sha256 = "15nidriy0v5yqfjsgsra51wmknxci2n2grliz78sf9pga3n0l7gi"; - type = "gem"; - }; - version = "0.6.0"; - }; - i18n = { - dependencies = [ "concurrent-ruby" ]; - groups = [ "default" ]; - platforms = [ ]; - source = { - remotes = [ "https://rubygems.org" ]; - sha256 = "08p6b13p99j1rrcrw1l3v0kb9mxbsvy6nk31r8h4rnszdgzpga32"; - type = "gem"; - }; - version = "1.8.9"; - }; - jekyll = { - dependencies = [ - "addressable" - "colorator" - "em-websocket" - "i18n" - "jekyll-sass-converter" - "jekyll-watch" - "kramdown" - "kramdown-parser-gfm" - "liquid" - "mercenary" - "pathutil" - "rouge" - "safe_yaml" - "terminal-table" - ]; - groups = [ "default" ]; - platforms = [ ]; - source = { - remotes = [ "https://rubygems.org" ]; - sha256 = "0cqkh78jw8scrajyx5nla0vwm9fvp2qql3kdcvvplcq9mazy8snq"; - type = "gem"; - }; - version = "4.2.0"; - }; - jekyll-feed = { - dependencies = [ "jekyll" ]; - groups = [ "default" ]; - platforms = [ ]; - source = { - remotes = [ "https://rubygems.org" ]; - sha256 = "1zxqkrnix0xiw98531h5ga6h69jhzlx2jh9qhvcl67p8nq3sgza9"; - type = "gem"; - }; - version = "0.15.1"; - }; - jekyll-sass-converter = { - dependencies = [ "sassc" ]; - groups = [ "default" ]; - platforms = [ ]; - source = { - remotes = [ "https://rubygems.org" ]; - sha256 = "04ncr44wrilz26ayqwlg7379yjnkb29mvx4j04i62b7czmdrc9dv"; - type = "gem"; - }; - version = "2.1.0"; - }; - jekyll-watch = { - dependencies = [ "listen" ]; - groups = [ "default" ]; - platforms = [ ]; - source = { - remotes = [ "https://rubygems.org" ]; - sha256 = "1qd7hy1kl87fl7l0frw5qbn22x7ayfzlv9a5ca1m59g0ym1ysi5w"; - type = "gem"; - }; - version = "2.2.1"; - }; - kramdown = { - dependencies = [ "rexml" ]; - groups = [ "default" ]; - platforms = [ ]; - source = { - remotes = [ "https://rubygems.org" ]; - sha256 = "1vmw752c26ny2jwl0npn0gbyqwgz4hdmlpxnsld9qi9xhk5b1qh7"; - type = "gem"; - }; - version = "2.3.0"; - }; - kramdown-parser-gfm = { - dependencies = [ "kramdown" ]; - groups = [ "default" ]; - platforms = [ ]; - source = { - remotes = [ "https://rubygems.org" ]; - sha256 = "0a8pb3v951f4x7h968rqfsa19c8arz21zw1vaj42jza22rap8fgv"; - type = "gem"; - }; - version = "1.1.0"; - }; - liquid = { - groups = [ "default" ]; - platforms = [ ]; - source = { - remotes = [ "https://rubygems.org" ]; - sha256 = "0zhg5ha8zy8zw9qr3fl4wgk4r5940n4128xm2pn4shpbzdbsj5by"; - type = "gem"; - }; - version = "4.0.3"; - }; - listen = { - dependencies = [ "rb-fsevent" "rb-inotify" ]; - groups = [ "default" ]; - platforms = [ ]; - source = { - remotes = [ "https://rubygems.org" ]; - sha256 = "0imzd0cb9vlkc3yggl4rph1v1wm4z9psgs4z6aqsqa5hgf8gr9hj"; - type = "gem"; - }; - version = "3.4.1"; - }; - mercenary = { - groups = [ "default" ]; - platforms = [ ]; - source = { - remotes = [ "https://rubygems.org" ]; - sha256 = "0f2i827w4lmsizrxixsrv2ssa3gk1b7lmqh8brk8ijmdb551wnmj"; - type = "gem"; - }; - version = "0.4.0"; - }; - pathutil = { - dependencies = [ "forwardable-extended" ]; - groups = [ "default" ]; - platforms = [ ]; - source = { - remotes = [ "https://rubygems.org" ]; - sha256 = "12fm93ljw9fbxmv2krki5k5wkvr7560qy8p4spvb9jiiaqv78fz4"; - type = "gem"; - }; - version = "0.16.2"; - }; - public_suffix = { - groups = [ "default" ]; - platforms = [ ]; - source = { - remotes = [ "https://rubygems.org" ]; - sha256 = "1xqcgkl7bwws1qrlnmxgh8g4g9m10vg60bhlw40fplninb3ng6d9"; - type = "gem"; - }; - version = "4.0.6"; - }; - rb-fsevent = { - groups = [ "default" ]; - platforms = [ ]; - source = { - remotes = [ "https://rubygems.org" ]; - sha256 = "1k9bsj7ni0g2fd7scyyy1sk9dy2pg9akniahab0iznvjmhn54h87"; - type = "gem"; - }; - version = "0.10.4"; - }; - rb-inotify = { - dependencies = [ "ffi" ]; - groups = [ "default" ]; - platforms = [ ]; - source = { - remotes = [ "https://rubygems.org" ]; - sha256 = "1jm76h8f8hji38z3ggf4bzi8vps6p7sagxn3ab57qc0xyga64005"; - type = "gem"; - }; - version = "0.10.1"; - }; - rexml = { - groups = [ "default" ]; - platforms = [ ]; - source = { - remotes = [ "https://rubygems.org" ]; - sha256 = "1mkvkcw9fhpaizrhca0pdgjcrbns48rlz4g6lavl5gjjq3rk2sq3"; - type = "gem"; - }; - version = "3.2.4"; - }; - rouge = { - groups = [ "default" ]; - platforms = [ ]; - source = { - remotes = [ "https://rubygems.org" ]; - sha256 = "0b4b300i3m4m4kw7w1n9wgxwy16zccnb7271miksyzd0wq5b9pm3"; - type = "gem"; - }; - version = "3.26.0"; - }; - safe_yaml = { - groups = [ "default" ]; - platforms = [ ]; - source = { - remotes = [ "https://rubygems.org" ]; - sha256 = "0j7qv63p0vqcd838i2iy2f76c3dgwzkiz1d1xkg7n0pbnxj2vb56"; - type = "gem"; - }; - version = "1.0.5"; - }; - sassc = { - dependencies = [ "ffi" ]; - groups = [ "default" ]; - platforms = [ ]; - source = { - remotes = [ "https://rubygems.org" ]; - sha256 = "0gpqv48xhl8mb8qqhcifcp0pixn206a7imc07g48armklfqa4q2c"; - type = "gem"; - }; - version = "2.4.0"; - }; - terminal-table = { - dependencies = [ "unicode-display_width" ]; - groups = [ "default" ]; - platforms = [ ]; - source = { - remotes = [ "https://rubygems.org" ]; - sha256 = "18rbrh464ysqbdv53iwj0r8frshn65566kyj044cp3x9c2754jwh"; - type = "gem"; - }; - version = "2.0.0"; - }; - unicode-display_width = { - groups = [ "default" ]; - platforms = [ ]; - source = { - remotes = [ "https://rubygems.org" ]; - sha256 = "06i3id27s60141x6fdnjn5rar1cywdwy64ilc59cz937303q3mna"; - type = "gem"; - }; - version = "1.7.0"; - }; -} diff --git a/pkgs/konawall-toggle/default.nix b/pkgs/konawall-toggle/default.nix deleted file mode 100644 index 52c2e319..00000000 --- a/pkgs/konawall-toggle/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ stdenv, wrapShellScriptBin, pkgs }: - -let toggle = wrapShellScriptBin "konawall-toggle" ./toggle.sh { }; -status = wrapShellScriptBin "konawall-status" ./status.sh { }; -in stdenv.mkDerivation { - pname = "konawall-toggle"; - version = "0.0.1"; - unpackPhase = "true"; - installPhase = '' - mkdir -p $out/bin - cp ${status}/bin/konawall-status $out/bin/konawall-status - cp ${toggle}/bin/konawall-toggle $out/bin/konawall-toggle - chmod +x $out/bin/konawall-{status,toggle} - ''; -} diff --git a/pkgs/konawall-toggle/status.sh b/pkgs/konawall-toggle/status.sh deleted file mode 100644 index 5e7c69a5..00000000 --- a/pkgs/konawall-toggle/status.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash -set -eu -set -o pipefail - -sleep 0.5s - -if systemctl --user is-active konawall-rotation.timer --quiet; then - status='{"text": "", "alt": "Konawall is enabled.", "class": "enabled"}' -else - status='{"text": "", "alt": "Konawall is disabled.", "class": "disabled"}' -fi - -echo $status diff --git a/pkgs/konawall-toggle/toggle.sh b/pkgs/konawall-toggle/toggle.sh deleted file mode 100644 index 8bc58468..00000000 --- a/pkgs/konawall-toggle/toggle.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -set -eu -set -o pipefail - - -if systemctl --user is-active konawall-rotation.timer --quiet; then - systemctl --user stop konawall-rotation.timer -else - systemctl --user start konawall-rotation.timer -fi diff --git a/pkgs/libreelec-dvb-firmware/default.nix b/pkgs/libreelec-dvb-firmware/default.nix deleted file mode 100644 index 39caf669..00000000 --- a/pkgs/libreelec-dvb-firmware/default.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ stdenv, fetchFromGitHub, lib}: - -stdenv.mkDerivation rec { - name = "libreelec-fw-dvb"; - version = "1.4.2"; - - src = fetchFromGitHub { - repo = "dvb-firmware"; - owner = "LibreElec"; - rev = version; - sha256 = "1xnfl4gp6d81gpdp86v5xgcqiqz2nf1i43sb3a4i5jqs8kxcap2k"; - }; - - buildPhase = ""; - installPhase = '' - mkdir -p $out/lib - cp -rv firmware $out/lib/ - ''; - - meta = with lib; { - license = lib.licenses.unfreeRedistributableFirmware; - maintainers = with maintainers; [ kittywitch ]; - platforms = with platforms; linux; - }; -} - diff --git a/pkgs/screenstub/default.nix b/pkgs/screenstub/default.nix deleted file mode 100644 index d4ddb6d9..00000000 --- a/pkgs/screenstub/default.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ fetchFromGitHub, rustPlatform, pkg-config, lib, libxcb, udev, python3 }: - -rustPlatform.buildRustPackage rec { - pname = "screenstub"; - version = "2021-01-08"; - src = fetchFromGitHub { - owner = "arcnmx"; - repo = pname; - rev = "e379279fedaaa1d06b1d89da4cf54752814a456f"; - sha256 = "0qv15rpazrpdspfcvyizbjdrrm2nrqz0790pa8zvp5bjsw4mvwvx"; - }; - - patches = [ ./main.patch ]; - - nativeBuildInputs = [ pkg-config python3 ]; - buildInputs = [ libxcb udev ]; - - cargoSha256 = "1m85lisy0085z4lr27lw0b9kbf134qz8dkjvcjnkwxgikx60pq3i"; - - doCheck = false; -} diff --git a/pkgs/screenstub/main.patch b/pkgs/screenstub/main.patch deleted file mode 100644 index 7ed86bd0..00000000 --- a/pkgs/screenstub/main.patch +++ /dev/null @@ -1,142 +0,0 @@ -diff --git a/qemu/src/lib.rs b/qemu/src/lib.rs -index 6a84bd4..d83cc49 100644 ---- a/qemu/src/lib.rs -+++ b/qemu/src/lib.rs -@@ -137,7 +137,7 @@ impl Qemu { - match events.recv().await { - Ok(qapi::qmp::Event::DEVICE_DELETED { ref data, .. }) if data.device.as_ref() == Some(&id) => { - // work around qemu bug. without this delay, device_add will work but the new device might be immediately deleted -- sleep(Duration::from_millis(128)).await; -+ sleep(Duration::from_millis(256)).await; - - break Ok(()) - }, -diff --git a/src/main.rs b/src/main.rs -index 3dc30a2..ed87aaa 100644 ---- a/src/main.rs -+++ b/src/main.rs -@@ -161,8 +161,8 @@ async fn main_result(spawner: &Arc) -> Result { - }; - - let repeat = false; -- let bus = None; -- let mut route_keyboard = Route::new(config.qemu.routing, qemu.clone(), "screenstub-route-kbd".into(), bus.clone(), repeat); -+ //let bus = None; -+ let mut route_keyboard = Route::new(config.qemu.routing, qemu.clone(), "screenstub-route-kbd".into(), Some("pci.23".into()), repeat); - if let Some(builder) = route_keyboard.builder() { - builder - .name("screenstub-kbd") -@@ -171,7 +171,7 @@ async fn main_result(spawner: &Arc) -> Result { - } - let mut events_keyboard = route_keyboard.spawn(spawner, error_sender.clone()); - -- let mut route_relative = Route::new(config.qemu.routing, qemu.clone(), "screenstub-route-mouse".into(), bus.clone(), repeat); -+ let mut route_relative = Route::new(config.qemu.routing, qemu.clone(), "screenstub-route-mouse".into(), Some("pci.22".into()), repeat); - if let Some(builder) = route_relative.builder() { - builder - .name("screenstub-mouse") -@@ -180,7 +180,7 @@ async fn main_result(spawner: &Arc) -> Result { - } - let mut events_relative = route_relative.spawn(spawner, error_sender.clone()); - -- let mut route_absolute = Route::new(config.qemu.routing, qemu.clone(), "screenstub-route-tablet".into(), bus, repeat); -+ let mut route_absolute = Route::new(config.qemu.routing, qemu.clone(), "screenstub-route-tablet".into(), Some("pci.21".into()), repeat); - if let Some(builder) = route_absolute.builder() { - builder - .name("screenstub-tablet") -diff --git a/src/route.rs b/src/route.rs -index 0448b52..417c197 100644 ---- a/src/route.rs -+++ b/src/route.rs -@@ -180,12 +180,10 @@ pub struct RouteUInputVirtio { - - impl UInputCommands for RouteUInputVirtio { - fn command_create(&self, qemu: &Arc, path: &Path) -> Pin> + Send>> { -- let name = match self.bus.is_some() { -- true => "virtio-input-host-device", // TODO: double-check this, what is the virtio bus for? -- false => "virtio-input-host-pci", -- }; -- let command = qmp::device_add::new(name, Some(self.id.clone()), self.bus.clone(), vec![ -+ let name = "virtio-input-host-pci"; -+ let command = qmp::device_add::new(name,Some(self.id.clone()) , self.bus.clone(), vec![ - ("evdev".into(), Any::String(path.display().to_string())), -+ //("addr".into(), Any::String("3".to_string())) - ]); - let deadline = Instant::now() + Duration::from_millis(512); // HACK: wait for udev to see device and change permissions - let qemu = qemu.clone(); -@@ -213,12 +211,15 @@ pub struct RouteUInputInputLinux { - impl UInputCommands for RouteUInputInputLinux { - fn command_create(&self, qemu: &Arc, path: &Path) -> Pin> + Send>> { - let path = path.display(); -- let command = qmp::object_add::new(&self.id, "input-linux", vec![ -+ let command = qmp::object_add::new("input-linux", &self.id, vec![ - ("evdev".into(), Any::String(path.to_string())), - ("repeat".into(), Any::Bool(self.repeat)), - ]); - let qemu = qemu.clone(); -+ let id_ = self.id.clone(); - async move { -+ let _ = qemu.execute_qmp(qmp::object_del { id: id_ }).await; -+ tokio::time::sleep(Duration::from_millis(512)).await; - qemu.execute_qmp(command).map_ok(drop).await - }.boxed() - } -@@ -283,7 +284,7 @@ pub enum Route { - impl Route { - pub fn new(routing: ConfigQemuRouting, qemu: Arc, id: String, bus: Option, repeat: bool) -> Self { - match routing { -- ConfigQemuRouting::InputLinux => Route::InputLinux(RouteUInput::new_input_linux(qemu, id, repeat)), -+ ConfigQemuRouting::InputLinux => Route::InputLinux(RouteUInput::new_input_linux(qemu, id, false)), - ConfigQemuRouting::VirtioHost => Route::VirtioHost(RouteUInput::new_virtio_host(qemu, id, bus)), - ConfigQemuRouting::Qmp => Route::Qmp(RouteQmp::new(qemu)), - ConfigQemuRouting::Spice => unimplemented!("SPICE routing"), -diff --git a/x/src/lib.rs b/x/src/lib.rs -index a517922..c37b951 100644 ---- a/x/src/lib.rs -+++ b/x/src/lib.rs -@@ -88,7 +88,7 @@ pub struct XContext { - window: xcore::Window, - ext_input: xcore::QueryExtensionReply, - ext_test: xcore::QueryExtensionReply, -- ext_dpms: xcore::QueryExtensionReply, -+// ext_dpms: xcore::QueryExtensionReply, - ext_xkb: xcore::QueryExtensionReply, - setup: xcore::Setup, - -@@ -128,8 +128,8 @@ impl XContext { - .expect("XKB required"); - let ext_test = sink.extension(ExtensionKind::Test).await.await? - .expect("XTest required"); -- let ext_dpms = sink.extension(ExtensionKind::DPMS).await.await? -- .expect("DPMS required"); -+ // let ext_dpms = sink.extension(ExtensionKind::DPMS).await.await? -+// .expect("DPMS required"); - let _ = sink.execute(xinput::XIQueryVersionRequest { - major_opcode: ext_input.major_opcode, - major_version: 2, -@@ -211,7 +211,7 @@ impl XContext { - ext_input, - ext_test, - ext_xkb, -- ext_dpms, -+ // ext_dpms, - display, - - sink, -@@ -506,13 +506,14 @@ impl XContext { - - Ok(match event { - ExtensionEvent::Core(xcore::Events::VisibilityNotify(event)) => { -- let dpms_blank = { -+/* let dpms_blank = { - let info = self.sink.execute(dpms::InfoRequest { - major_opcode: self.ext_dpms.major_opcode, - }).await.await?; - - info.power_level.get() != dpms::DPMSMode::On -- }; -+ };*/ -+ let dpms_blank = false; - self.event_queue.push(if dpms_blank { - XEvent::Visible(false) - } else { diff --git a/pkgs/wezterm-terminfo/default.nix b/pkgs/wezterm-terminfo/default.nix deleted file mode 100644 index fa449151..00000000 --- a/pkgs/wezterm-terminfo/default.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ stdenv, fetchFromGitHub, lib, ncurses }: - -stdenv.mkDerivation rec { - pname = "wezterm-terminfo"; - version = "20210502-154244-3f7122cb"; - - src = fetchFromGitHub { - owner = "wez"; - repo = pname; - rev = version; - sha256 = "9HPhb7Vyy5DwBW1xeA6sEIBmmOXlky9lPShu6ZoixPw="; - fetchSubmodules = true; - }; - - nativeBuildInputs = [ - ncurses - ]; - - buildPhase = ""; - installPhase = '' - mkdir -p $out/share/terminfo/w - ${ncurses}/bin/tic -x -o $out/share/terminfo $src/termwiz/data/wezterm.terminfo - mkdir -p $out/nix-support - echo "$out" >> $out/nix-support/propagated-user-env-packages - ''; - - meta = with lib; { - license = lib.licenses.mit; - maintainers = with maintainers; [ kittywitch ]; - platforms = with platforms; linux; - }; -} - diff --git a/pkgs/yggdrasil/change-runtime-dir.patch b/pkgs/yggdrasil/change-runtime-dir.patch deleted file mode 100644 index b4edc6a8..00000000 --- a/pkgs/yggdrasil/change-runtime-dir.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ruN a/src/defaults/defaults_linux.go b/src/defaults/defaults_linux.go ---- a/src/defaults/defaults_linux.go 2019-06-17 10:23:09.495613784 -0700 -+++ b/src/defaults/defaults_linux.go 2019-07-01 10:17:11.295669440 -0700 -@@ -7,7 +7,7 @@ - func GetDefaults() platformDefaultParameters { - return platformDefaultParameters{ - // Admin -- DefaultAdminListen: "unix:///var/run/yggdrasil.sock", -+ DefaultAdminListen: "unix:///var/run/yggdrasil/yggdrasil.sock", - - // Configuration (used for yggdrasilctl) - DefaultConfigFile: "/etc/yggdrasil.conf", diff --git a/pkgs/yggdrasil/default.nix b/pkgs/yggdrasil/default.nix deleted file mode 100644 index 8228132b..00000000 --- a/pkgs/yggdrasil/default.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ lib, buildGoModule, fetchFromGitHub, nixosTests }: - -buildGoModule rec { - pname = "yggdrasil"; - version = "0.3.16"; - - src = fetchFromGitHub { - owner = "yggdrasil-network"; - repo = "yggdrasil-go"; - rev = "v${version}"; - sha256 = "sha256-uUF0zkgtzdMZB/GKOtawjn7AQBkRoiAEj9nUUmpQSVQ="; - }; - - vendorSha256 = "sha256-619PSqd7pl3Akj/kzLQhDIp1adumBGhLrzQsZvMzC7w="; - - doCheck = false; - - # Change the default location of the management socket on Linux - # systems so that the yggdrasil system service unit does not have to - # be granted write permission to /run. - patches = [ ./change-runtime-dir.patch ]; - - subPackages = [ "cmd/yggdrasil" "cmd/yggdrasilctl" ]; - - buildFlagsArray = '' - -ldflags= - -X github.com/yggdrasil-network/yggdrasil-go/src/version.buildVersion=${version} - -X github.com/yggdrasil-network/yggdrasil-go/src/version.buildName=${pname} - -s -w - ''; - - passthru.tests.basic = nixosTests.yggdrasil; - - meta = with lib; { - description = - "An experiment in scalable routing as an encrypted IPv6 overlay network"; - homepage = "https://yggdrasil-network.github.io/"; - license = licenses.lgpl3; - maintainers = with maintainers; [ ehmry gazally lassulus ]; - }; -} diff --git a/wiki b/wiki index b7cbb297..1728473e 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit b7cbb2972190f2bf92fa20ee58d746a32bc639e1 +Subproject commit 1728473ec19a5fe0caa95683eebc308c85731bc3