From fdf7cb9e98ca5e930fdd7eb13fad88a42cf1b5a2 Mon Sep 17 00:00:00 2001 From: kat witch Date: Mon, 22 Feb 2021 05:40:19 +0000 Subject: [PATCH] Reformat. Small changes. Ran nixfmt on the whole project. Added an alias for doing that. Changed some SSH aliases. --- config/common/default.nix | 7 +-- config/hosts/athame/virtualhosts.nix | 84 +++++++++++++------------- config/hosts/boline/configuration.nix | 2 +- config/hosts/samhain/configuration.nix | 3 +- config/hosts/yule/configuration.nix | 8 +-- config/users/kat/default.nix | 15 +++-- config/users/kat/gaming.nix | 2 +- config/users/kat/kitty.nix | 3 +- lib/hosts.nix | 3 +- 9 files changed, 62 insertions(+), 65 deletions(-) diff --git a/config/common/default.nix b/config/common/default.nix index 87ab1d6e..4ba1c25b 100644 --- a/config/common/default.nix +++ b/config/common/default.nix @@ -4,11 +4,7 @@ let sources = import ../../nix/sources.nix; unstable = import sources.nixpkgs-unstable { }; in { - imports = [ - ../../modules - ../users - (sources.home-manager + "/nixos") - ]; + imports = [ ../../modules ../users (sources.home-manager + "/nixos") ]; #boot.kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; #boot.kernelParams = [ "quiet" ]; @@ -49,6 +45,7 @@ in { ripgrep git kitty.terminfo + nixfmt mprime wget rsync diff --git a/config/hosts/athame/virtualhosts.nix b/config/hosts/athame/virtualhosts.nix index 1c596891..f00acea3 100644 --- a/config/hosts/athame/virtualhosts.nix +++ b/config/hosts/athame/virtualhosts.nix @@ -8,51 +8,49 @@ let secrets = (import ../../../../secrets.nix); in { services.nginx.virtualHosts = { - "kittywit.ch" = { - root = "/var/www/kittywitch"; - locations = { - "/_matrix" = { proxyPass = "http://[::1]:8008"; }; - "= /.well-known/matrix/server".extraConfig = - let server = { "m.server" = "kittywit.ch:443"; }; - in '' - add_header Content-Type application/json; - return 200 '${builtins.toJSON server}'; - ''; - "= /.well-known/matrix/client".extraConfig = let - client = { - "m.homeserver" = { "base_url" = "https://kittywit.ch"; }; - "m.identity_server" = { "base_url" = "https://vector.im"; }; - }; + "kittywit.ch" = { + root = "/var/www/kittywitch"; + locations = { + "/_matrix" = { proxyPass = "http://[::1]:8008"; }; + "= /.well-known/matrix/server".extraConfig = + let server = { "m.server" = "kittywit.ch:443"; }; in '' add_header Content-Type application/json; - add_header Access-Control-Allow-Origin *; - return 200 '${builtins.toJSON client}'; + return 200 '${builtins.toJSON server}'; ''; - }; - } // common; - "vault.kittywit.ch" = { - locations = { - "/".proxyPass = "http://127.0.0.1:4000"; - "/notifications/hub".proxyPass = "http://127.0.0.1:3012"; - "/notifications/hub/negotiate".proxyPass = "http://127.0.0.1:80"; - }; - } // common; - "git.kittywit.ch" = { - locations = { - "/".proxyPass = "http://127.0.0.1:3000"; - }; - } // common; - "znc.kittywit.ch" = { - locations = { "/".proxyPass = "http://127.0.0.1:5000"; }; - } // common; - "irc.kittywit.ch" = { - locations = { - "/" = { root = pkgs.glowing-bear; }; - "^~ /weechat" = { - proxyPass = "http://127.0.0.1:9000"; - proxyWebsockets = true; + "= /.well-known/matrix/client".extraConfig = let + client = { + "m.homeserver" = { "base_url" = "https://kittywit.ch"; }; + "m.identity_server" = { "base_url" = "https://vector.im"; }; }; + in '' + add_header Content-Type application/json; + add_header Access-Control-Allow-Origin *; + return 200 '${builtins.toJSON client}'; + ''; + }; + } // common; + "vault.kittywit.ch" = { + locations = { + "/".proxyPass = "http://127.0.0.1:4000"; + "/notifications/hub".proxyPass = "http://127.0.0.1:3012"; + "/notifications/hub/negotiate".proxyPass = "http://127.0.0.1:80"; + }; + } // common; + "git.kittywit.ch" = { + locations = { "/".proxyPass = "http://127.0.0.1:3000"; }; + } // common; + "znc.kittywit.ch" = { + locations = { "/".proxyPass = "http://127.0.0.1:5000"; }; + } // common; + "irc.kittywit.ch" = { + locations = { + "/" = { root = pkgs.glowing-bear; }; + "^~ /weechat" = { + proxyPass = "http://127.0.0.1:9000"; + proxyWebsockets = true; }; - } // common; - } // secrets.virtualHosts.athame; -} \ No newline at end of file + }; + } // common; + } // secrets.virtualHosts.athame; +} diff --git a/config/hosts/boline/configuration.nix b/config/hosts/boline/configuration.nix index 624eb97f..13a00a4b 100644 --- a/config/hosts/boline/configuration.nix +++ b/config/hosts/boline/configuration.nix @@ -18,7 +18,7 @@ domain = "kittywit.ch"; hostId = "0417b551"; useDHCP = false; - interfaces.ens3.ipv4.addresses = [{ + interfaces.ens3.ipv4.addresses = [{ address = "104.244.73.10"; prefixLength = 24; }]; diff --git a/config/hosts/samhain/configuration.nix b/config/hosts/samhain/configuration.nix index 328eb649..9affbfa1 100644 --- a/config/hosts/samhain/configuration.nix +++ b/config/hosts/samhain/configuration.nix @@ -9,8 +9,7 @@ ./torrenting.nix ]; - meta.deploy.profiles = - [ "desktop" "development" "sway" "gaming" "network" ]; + meta.deploy.profiles = [ "desktop" "development" "sway" "gaming" "network" ]; meta.deploy.ssh.host = "192.168.1.135"; # libvirtd is used for our virtual machine diff --git a/config/hosts/yule/configuration.nix b/config/hosts/yule/configuration.nix index 71ad021a..4e0f368c 100644 --- a/config/hosts/yule/configuration.nix +++ b/config/hosts/yule/configuration.nix @@ -1,13 +1,9 @@ { config, pkgs, ... }: { - imports = [ - ./hardware.nix - ../../services/zfs.nix - ]; + imports = [ ./hardware.nix ../../services/zfs.nix ]; - meta.deploy.profiles = - [ "desktop" "development" "sway" "gaming" "network" ]; + meta.deploy.profiles = [ "desktop" "development" "sway" "gaming" "network" ]; meta.deploy.ssh.host = "192.168.1.92"; boot.loader.systemd-boot.enable = true; diff --git a/config/users/kat/default.nix b/config/users/kat/default.nix index 4ddc6b2e..98fcd720 100644 --- a/config/users/kat/default.nix +++ b/config/users/kat/default.nix @@ -1,7 +1,15 @@ { config, pkgs, ... }: { - imports = [ ./desktop.nix ./gaming.nix ./network.nix ./sway.nix ./waybar.nix ./kitty.nix ./emacs.nix ]; + imports = [ + ./desktop.nix + ./gaming.nix + ./network.nix + ./sway.nix + ./waybar.nix + ./kitty.nix + ./emacs.nix + ]; users.users.kat = { uid = 1000; @@ -18,6 +26,7 @@ home-manager.users.kat = { programs.fish = { enable = true; + shellAliases = { nixdirfmt = "fd --color=never .nix | xargs nixfmt"; }; plugins = [{ name = "bass"; src = pkgs.fetchFromGitHub { @@ -55,11 +64,9 @@ port = 62954; }; in { - "athame" = { hostname = "kittywit.ch"; } // kat; + "athame" = { hostname = "athame.kittywit.ch"; } // kat; "samhain" = { hostname = "192.168.1.135"; } // kat; - "litha" = { hostname = "192.168.1.240"; } // kat; "yule" = { hostname = "192.168.1.92"; } // kat; - "mabon" = { hostname = "192.168.1.218"; } // kat; "boline" = { hostname = "boline.kittywit.ch"; } // kat; }; }; diff --git a/config/users/kat/gaming.nix b/config/users/kat/gaming.nix index dbb267d7..4e793fcc 100644 --- a/config/users/kat/gaming.nix +++ b/config/users/kat/gaming.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, ... }: { config = lib.mkIf (lib.elem "gaming" config.meta.deploy.profiles) { diff --git a/config/users/kat/kitty.nix b/config/users/kat/kitty.nix index f213f9fd..dd62c77d 100644 --- a/config/users/kat/kitty.nix +++ b/config/users/kat/kitty.nix @@ -1,6 +1,7 @@ { config, lib, pkgs, ... }: -let style = import ./style.nix; in { +let style = import ./style.nix; +in { config = lib.mkIf (lib.elem "desktop" config.meta.deploy.profiles) { home-manager.users.kat = { diff --git a/lib/hosts.nix b/lib/hosts.nix index 1c9c23e4..7a9bb3bd 100644 --- a/lib/hosts.nix +++ b/lib/hosts.nix @@ -1,6 +1,5 @@ { pkgs, hostsDir ? ../config/hosts -, commonImports ? [ ../config/common ../modules ], pkgsPath ? ../pkgs -}: +, commonImports ? [ ../config/common ../modules ], pkgsPath ? ../pkgs }: with pkgs.lib;