From 35bc79265c1b43678ec23761bcd82b5c29781ec6 Mon Sep 17 00:00:00 2001 From: prescientmoon Date: Sun, 13 Oct 2024 02:34:34 +0200 Subject: [PATCH] Better octodns file structure --- dns/{ => config}/common.nix | 1 + dns/{ => config}/octodns.yaml | 0 dns/implementation/default.nix | 69 ++++++++++++++++ dns/implementation/gen-zone-file.nix | 37 +++++++++ .../nixos-module-assertions.nix | 0 .../implementation/nixos-module.nix | 0 .../implementation}/octodns-cloudflare.nix | 0 dns/pkgs.nix | 48 ----------- flake.lock | 69 ++++++---------- flake.nix | 10 ++- home/features/desktop/spotify.nix | 50 +++++------ .../neovim/config/ftplugin/purescript.lua | 1 - home/features/neovim/config/lazy-lock.json | 6 +- .../neovim/config/lua/my/abbreviations/fp.lua | 15 ---- .../config/lua/my/abbreviations/global.lua | 13 --- .../config/lua/my/abbreviations/init.lua | 4 - .../config/lua/my/abbreviations/math.lua | 20 ----- home/features/neovim/config/lua/my/lazy.lua | 3 +- .../neovim/config/lua/my/plugins/whichkey.lua | 35 -------- .../config/lua/my/{plugins => }/themes.lua | 0 .../features/neovim/config/spell/en.utf-8.add | 1 - .../neovim/config/spell/en.utf-8.add.spl | Bin 40 -> 0 bytes home/features/neovim/default.nix | 78 +++--------------- home/features/neovim/snippets/all.miros | 1 + .../neovim/snippets/common/math-phrases.miros | 23 ++++++ hosts/nixos/common/global/default.nix | 4 + hosts/nixos/lapetus/services/microbin.nix | 11 +-- modules/README.md | 12 --- modules/common/README.md | 8 -- modules/common/octodns.nix | 48 ----------- modules/nixos/README.md | 16 ++-- modules/nixos/default.nix | 2 - pkgs/default.nix | 15 +--- 33 files changed, 219 insertions(+), 381 deletions(-) rename dns/{ => config}/common.nix (98%) rename dns/{ => config}/octodns.yaml (100%) create mode 100644 dns/implementation/default.nix create mode 100644 dns/implementation/gen-zone-file.nix rename modules/nixos/dns-assertions.nix => dns/implementation/nixos-module-assertions.nix (100%) rename modules/nixos/dns.nix => dns/implementation/nixos-module.nix (100%) rename {pkgs => dns/implementation}/octodns-cloudflare.nix (100%) delete mode 100644 dns/pkgs.nix delete mode 100644 home/features/neovim/config/ftplugin/purescript.lua delete mode 100644 home/features/neovim/config/lua/my/abbreviations/fp.lua delete mode 100644 home/features/neovim/config/lua/my/abbreviations/global.lua delete mode 100644 home/features/neovim/config/lua/my/plugins/whichkey.lua rename home/features/neovim/config/lua/my/{plugins => }/themes.lua (100%) delete mode 100644 home/features/neovim/config/spell/en.utf-8.add delete mode 100644 home/features/neovim/config/spell/en.utf-8.add.spl create mode 100644 home/features/neovim/snippets/common/math-phrases.miros delete mode 100644 modules/common/octodns.nix diff --git a/dns/common.nix b/dns/config/common.nix similarity index 98% rename from dns/common.nix rename to dns/config/common.nix index 160b727..ddf90c1 100644 --- a/dns/common.nix +++ b/dns/config/common.nix @@ -72,6 +72,7 @@ in satellite.dns.records = lib.flatten [ (ghPage "doffycup") (ghPage "erratic-gate") + (ghPage "giftstogo") (migaduMail "" "kfkhyexd") (migaduMail "orbit" "24s7lnum") ]; diff --git a/dns/octodns.yaml b/dns/config/octodns.yaml similarity index 100% rename from dns/octodns.yaml rename to dns/config/octodns.yaml diff --git a/dns/implementation/default.nix b/dns/implementation/default.nix new file mode 100644 index 0000000..6b8465e --- /dev/null +++ b/dns/implementation/default.nix @@ -0,0 +1,69 @@ +{ + pkgs, + octodnsConfig, + nixosConfigurations ? { }, + extraModules ? [ ], +}: +let + # {{{ Prepare packages + octodns = pkgs.octodns.overrideAttrs (_: { + version = "unstable-2024-10-08"; + src = pkgs.fetchFromGitHub { + owner = "octodns"; + repo = "octodns"; + rev = "a1456cb1fcf00916ca06b204755834210a3ea9cf"; + sha256 = "192hbxhb0ghcbzqy3h8q194n4iy7bqfj9ra9qqjff3x2z223czxb"; + }; + }); + + octodns-cloudflare = pkgs.python3Packages.callPackage (import ./octodns-cloudflare.nix) { + inherit octodns; + }; + + fullOctodns = octodns.withProviders (ps: [ octodns-cloudflare ]); +in +# }}} +rec { + # {{{ Build zone files + octodns-zones = + let + nixosConfigModules = pkgs.lib.mapAttrsToList (_: current: { + satellite.dns = current.config.satellite.dns; + }) nixosConfigurations; + + evaluated = pkgs.lib.evalModules { + specialArgs = { + inherit pkgs; + }; + + modules = [ ./nixos-module.nix ] ++ nixosConfigModules ++ extraModules; + }; + in + import ./gen-zone-file.nix { + inherit pkgs; + inherit (evaluated) config; + }; + # }}} + # {{{ Make the CLI use the newly built zone files + octodns-sync = pkgs.symlinkJoin { + name = "octodns-sync"; + paths = [ fullOctodns ]; + buildInputs = [ + pkgs.makeWrapper + pkgs.yq + ]; + + postBuild = '' + cat ${octodnsConfig} | yq '.providers.zones.directory="${octodns-zones}"' > $out/config.yaml + wrapProgram $out/bin/octodns-sync \ + --run 'export CLOUDFLARE_TOKEN=$( \ + sops \ + --decrypt \ + --extract "[\"cloudflare_dns_api_token\"]" \ + ./hosts/nixos/common/secrets.yaml \ + )' \ + --add-flags "--config-file $out/config.yaml" + ''; + }; + # }}} +} diff --git a/dns/implementation/gen-zone-file.nix b/dns/implementation/gen-zone-file.nix new file mode 100644 index 0000000..15ab71a --- /dev/null +++ b/dns/implementation/gen-zone-file.nix @@ -0,0 +1,37 @@ +{ + config, + pkgs, + lib ? pkgs.lib, +}: +let + format = pkgs.formats.yaml { }; + cfg = config.satellite.dns; + grouped = builtins.groupBy (entry: entry.zone) cfg.records; + cpInvocations = lib.mapAttrsToList ( + zone: group: + let + grouped = builtins.groupBy (entry: entry.at) group; + contents = lib.mapAttrs ( + at: entries: + lib.lists.forEach entries ( + entry: + let + content = + if builtins.typeOf entry.value == "list" then + { values = entry.value; } + else + { inherit (entry) value; }; + cloudflare = if entry.enableCloudflareProxy then { octodns.cloudflare.proxied = true; } else { }; + in + { inherit (entry) ttl type; } // content // cloudflare + ) + ) grouped; + file = format.generate "${zone}.yaml" contents; + in + "cp ${file} $out/${zone}.yaml" + ) grouped; +in +pkgs.runCommand "octodns-zones" { } '' + mkdir $out + ${lib.concatStringsSep "\n" cpInvocations} +'' diff --git a/modules/nixos/dns-assertions.nix b/dns/implementation/nixos-module-assertions.nix similarity index 100% rename from modules/nixos/dns-assertions.nix rename to dns/implementation/nixos-module-assertions.nix diff --git a/modules/nixos/dns.nix b/dns/implementation/nixos-module.nix similarity index 100% rename from modules/nixos/dns.nix rename to dns/implementation/nixos-module.nix diff --git a/pkgs/octodns-cloudflare.nix b/dns/implementation/octodns-cloudflare.nix similarity index 100% rename from pkgs/octodns-cloudflare.nix rename to dns/implementation/octodns-cloudflare.nix diff --git a/dns/pkgs.nix b/dns/pkgs.nix deleted file mode 100644 index 4d0c823..0000000 --- a/dns/pkgs.nix +++ /dev/null @@ -1,48 +0,0 @@ -{ pkgs, self, ... }: -rec { - octodns-zones = - let - nixosConfigModules = pkgs.lib.mapAttrsToList ( - key: current: - # The iso image doesn't do any dns stuff - if key == "iso" then - { } - else - # Copy over all dns records - { satellite.dns = current.config.satellite.dns; } - ) self.nixosConfigurations; - - evaluated = pkgs.lib.evalModules { - specialArgs = { - inherit pkgs; - }; - modules = [ - ../modules/nixos/dns.nix - ../modules/common/octodns.nix - ./common.nix - ] ++ nixosConfigModules; - }; - in - evaluated.config.satellite.dns.octodns; - - octodns-sync = pkgs.symlinkJoin { - name = "octodns-sync"; - paths = [ self.packages.${pkgs.system}.octodns ]; - buildInputs = [ - pkgs.makeWrapper - pkgs.yq - ]; - - postBuild = '' - cat ${./octodns.yaml} | yq '.providers.zones.directory="${octodns-zones}"' > $out/config.yaml - wrapProgram $out/bin/octodns-sync \ - --run 'export CLOUDFLARE_TOKEN=$( \ - sops \ - --decrypt \ - --extract "[\"cloudflare_dns_api_token\"]" \ - ./hosts/nixos/common/secrets.yaml \ - )' \ - --add-flags "--config-file $out/config.yaml" - ''; - }; -} diff --git a/flake.lock b/flake.lock index 266f2f7..6f323ce 100644 --- a/flake.lock +++ b/flake.lock @@ -602,6 +602,22 @@ } }, "flake-compat_7": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_8": { "flake": false, "locked": { "lastModified": 1673956053, @@ -823,24 +839,6 @@ "type": "github" } }, - "flake-utils_8": { - "inputs": { - "systems": "systems_7" - }, - "locked": { - "lastModified": 1685518550, - "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "fromYaml": { "flake": false, "locked": { @@ -1276,11 +1274,11 @@ "purifix": "purifix" }, "locked": { - "lastModified": 1713856075, - "narHash": "sha256-3nmcWGRczFJAiObkG+XUK9OdY8EVjySOUbDSK6yVyVE=", + "lastModified": 1728771451, + "narHash": "sha256-WazYd0cPY7FqDanOfyMf9qiciSj2wEL8NJ1sV8LV4Rs=", "owner": "prescientmoon", "repo": "miros", - "rev": "37081c34cb04b0751527c4ed740220c57cea3151", + "rev": "2e49f31f22855d1428ab693cf7d0e25b839dce28", "type": "github" }, "original": { @@ -2077,21 +2075,21 @@ }, "spicetify-nix": { "inputs": { - "flake-utils": "flake-utils_8", + "flake-compat": "flake-compat_7", "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1704167711, - "narHash": "sha256-kFDq+kf/Di/P8bq5sUP8pVwRkrSVrABksBjMPmLic3s=", - "owner": "the-argus", + "lastModified": 1728706579, + "narHash": "sha256-uMa7cC1F2m7DHGOT5yQ1ZoUFVWxsnZDBi9VXwOgnhqw=", + "owner": "Gerg-L", "repo": "spicetify-nix", - "rev": "1325416f951d6a82cfddb1289864ad782e2b87c4", + "rev": "59aa525938e501bdacad3753034e864a426b66f5", "type": "github" }, "original": { - "owner": "the-argus", + "owner": "Gerg-L", "repo": "spicetify-nix", "type": "github" } @@ -2107,7 +2105,7 @@ "base16-kitty": "base16-kitty", "base16-tmux": "base16-tmux", "base16-vim": "base16-vim", - "flake-compat": "flake-compat_7", + "flake-compat": "flake-compat_8", "gnome-shell": "gnome-shell", "home-manager": "home-manager_3", "nixpkgs": "nixpkgs_13" @@ -2265,21 +2263,6 @@ "type": "github" } }, - "systems_7": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "template-haskell-reload": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index f7159fc..79c80db 100644 --- a/flake.nix +++ b/flake.nix @@ -56,7 +56,7 @@ miros.inputs.nixpkgs.follows = "nixpkgs"; # Spotify client with theming support - spicetify-nix.url = "github:the-argus/spicetify-nix"; + spicetify-nix.url = "github:Gerg-L/spicetify-nix"; spicetify-nix.inputs.nixpkgs.follows = "nixpkgs"; # }}} # {{{ Theming @@ -103,10 +103,12 @@ myPkgs = import ./pkgs { inherit pkgs upkgs; }; in myPkgs - // { - octodns = myPkgs.octodns.withProviders (ps: [ myPkgs.octodns-cloudflare ]); + // (import ./dns/implementation) { + inherit pkgs; + extraModules = [ ./dns/config/common.nix ]; + octodnsConfig = ./dns/config/octodns.yaml; + nixosConfigurations = builtins.removeAttrs self.nixosConfigurations [ "iso" ]; } - // (import ./dns/pkgs.nix) { inherit pkgs self system; } ); # }}} # {{{ Bootstrapping and other pinned devshells diff --git a/home/features/desktop/spotify.nix b/home/features/desktop/spotify.nix index 6ebde9e..6b723a4 100644 --- a/home/features/desktop/spotify.nix +++ b/home/features/desktop/spotify.nix @@ -1,11 +1,17 @@ -{ inputs, pkgs, config, lib, ... }: +{ + inputs, + pkgs, + config, + lib, + ... +}: let - spicePkgs = inputs.spicetify-nix.packages.${pkgs.system}.default; + spicePkgs = inputs.spicetify-nix.legacyPackages.${pkgs.system}; themeMap = lib.fix (self: { - "Catppuccin Mocha" = spicePkgs.themes.Comfy; - "Catppuccin Latte" = spicePkgs.themes.Comfy; - "Catppuccin Frappe" = spicePkgs.themes.Comfy; - "Catppuccin Macchiato" = spicePkgs.themes.Comfy; + "Catppuccin Mocha" = spicePkgs.themes.comfy; + "Catppuccin Latte" = spicePkgs.themes.comfy; + "Catppuccin Frappe" = spicePkgs.themes.comfy; + "Catppuccin Macchiato" = spicePkgs.themes.comfy; default.light = self."Catppuccin Latte"; default.dark = self."Catppuccin Macchiato"; @@ -32,34 +38,28 @@ in colorScheme = config.satellite.theming.get colorschemeMap; enabledExtensions = with spicePkgs.extensions; [ + adblock + betterGenres + bookmark + fullAlbumDate fullAppDisplayMod - shuffle # Working shuffle + groupSession keyboardShortcut - skipStats # Track my skips listPlaylistsWithSong # Adds button to show playlists which contain a song playlistIntersection # Shows stuff that's in two different playlists - fullAlbumDate - bookmark - trashbin - groupSession - wikify # Shows an artist's wikipedia entry - songStats - showQueueDuration - # REASON: broken - # https://github.com/the-argus/spicetify-nix/issues/50 - # genre - adblock savePlaylists # Adds a button to duplicate playlists + showQueueDuration + shuffle # Working shuffle + skipStats # Track my skips + songStats + trashbin + wikify # Shows an artist's wikipedia entry ]; }; # {{{ Persistence - satellite.persistence.at.state.apps.spotify.directories = [ - "${config.xdg.configHome}/spotify" - ]; + satellite.persistence.at.state.apps.spotify.directories = [ "${config.xdg.configHome}/spotify" ]; - satellite.persistence.at.cache.apps.spotify.directories = [ - "${config.xdg.cacheHome}/spotify" - ]; + satellite.persistence.at.cache.apps.spotify.directories = [ "${config.xdg.cacheHome}/spotify" ]; # }}} } diff --git a/home/features/neovim/config/ftplugin/purescript.lua b/home/features/neovim/config/ftplugin/purescript.lua deleted file mode 100644 index 6188a5d..0000000 --- a/home/features/neovim/config/ftplugin/purescript.lua +++ /dev/null @@ -1 +0,0 @@ -require("my.abbreviations.fp").setup() diff --git a/home/features/neovim/config/lazy-lock.json b/home/features/neovim/config/lazy-lock.json index 5838df5..4998b78 100644 --- a/home/features/neovim/config/lazy-lock.json +++ b/home/features/neovim/config/lazy-lock.json @@ -10,7 +10,6 @@ "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, "conform": { "branch": "master", "commit": "cd75be867f2331b22905f47d28c0c270a69466aa" }, "crates": { "branch": "main", "commit": "c3fd47391de6999f4c939af89494d08443f71916" }, - "discord-rich-presence": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" }, "dressing": { "branch": "master", "commit": "6741f1062d3dc6e4755367a7e9b347b553623f04" }, "fidget": { "branch": "main", "commit": "0ba1e16d07627532b6cae915cc992ecac249fb97" }, "flash": { "branch": "main", "commit": "d0799ae43a581d9f190e182e2a1f389d2887c42a" }, @@ -43,8 +42,10 @@ "nui": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, "null-ls": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, + "obsidian": { "branch": "main", "commit": "14e0427bef6c55da0d63f9a313fd9941be3a2479" }, "plenary": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, "purescript": { "branch": "main", "commit": "82348352e6568fcc0385bd7c99a8ead3a479feea" }, + "quicker.nvim": { "branch": "master", "commit": "183041a46d6c908eefb1c23ea02cce9c8f41256e" }, "rustacean": { "branch": "master", "commit": "5c0c44149e43b907dae2e0fe053284ad56226eb7" }, "rzip": { "branch": "master", "commit": "f65400fed27b27c7cff7ef8d428c4e5ff749bf28" }, "scrap": { "branch": "main", "commit": "cc8453ed613932c744c3d1ec42f379b78bd8b92c" }, @@ -52,6 +53,5 @@ "typst": { "branch": "main", "commit": "4d18ced62599ffe5b3c0e5e49566d5456121bc02" }, "undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" }, "wakatime": { "branch": "master", "commit": "3cb40867cb5a3120f9bef76eff88edc7f1dc1a23" }, - "web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" }, - "which-key.nvim": { "branch": "main", "commit": "c77cda8cd2f54965e4316699f1d124a2b3bf9d49" } + "web-devicons": { "branch": "master", "commit": "c0cfc1738361b5da1cd0a962dd6f774cc444f856" } } \ No newline at end of file diff --git a/home/features/neovim/config/lua/my/abbreviations/fp.lua b/home/features/neovim/config/lua/my/abbreviations/fp.lua deleted file mode 100644 index fdcc62a..0000000 --- a/home/features/neovim/config/lua/my/abbreviations/fp.lua +++ /dev/null @@ -1,15 +0,0 @@ -local A = require("my.abbreviations") -local scrap = require("scrap") -local M = {} - -M.symbols = { - { "mto", ">>=" }, -- [M]onadic [t]o - { "oalt", "<|>" }, -- [O]peration [A]lternative - { "omono", "<>" }, -- [O]peration [M]onoid -} - -function M.setup() - A.manyLocalAbbr(scrap.expand_many(M.symbols, A.no_capitalization)) -end - -return M diff --git a/home/features/neovim/config/lua/my/abbreviations/global.lua b/home/features/neovim/config/lua/my/abbreviations/global.lua deleted file mode 100644 index c372b58..0000000 --- a/home/features/neovim/config/lua/my/abbreviations/global.lua +++ /dev/null @@ -1,13 +0,0 @@ -local A = require("my.abbreviations") -local scrap = require("scrap") -local M = {} - -M.words = { - { "thrf", "therefore" }, -} - -function M.setup() - A.manyGlobalAbbr(scrap.expand_many(M.words)) -end - -return M diff --git a/home/features/neovim/config/lua/my/abbreviations/init.lua b/home/features/neovim/config/lua/my/abbreviations/init.lua index eccb5aa..cdf3032 100644 --- a/home/features/neovim/config/lua/my/abbreviations/init.lua +++ b/home/features/neovim/config/lua/my/abbreviations/init.lua @@ -23,8 +23,4 @@ function M.manyGlobalAbbr(abbreviations) end end -function M.setup() - require("my.abbreviations.global").setup() -end - return M diff --git a/home/features/neovim/config/lua/my/abbreviations/math.lua b/home/features/neovim/config/lua/my/abbreviations/math.lua index 74b6b56..b66a8c4 100644 --- a/home/features/neovim/config/lua/my/abbreviations/math.lua +++ b/home/features/neovim/config/lua/my/abbreviations/math.lua @@ -8,26 +8,6 @@ local function nocap(d) end M.words = { - -- {{{ General phrases - { "thrf", "therefore" }, - { "bcla", "by contradiction let's assume" }, - { "wlg", "without loss of generality" }, - { "tits", "that is to say," }, - { "wpbd", "we will prove the statement in both directions." }, - { "stam{,s}", "statement{}" }, - { "{ww,tt}{m,i}", "{which,this} {means,implies}" }, - { "cex{,s}", "counterexample{}" }, - { "er{t,s,r}", "{transitivity,symmetry,reflexivity}" }, - -- }}} - -- {{{ Calculus & analysis - { "ib{p,s}", "integration by {parts,substitution}" }, - { "{o,c,}nb{,h}{,s}", "{open,closed,} neighbour{,hood}{}" }, - { - "{n,}{{c,}d,iv,it}ble", - "{non-,}{{continuously,} differentia,inverti,integra}ble", - }, - nocap({ "lshiz{c,}", "Lipschitz{ condition,}" }), - -- }}} -- {{{ Linear algebra { "rref", "reduced row echalon form" }, { "eg{va,ve,p}{,s}", "eigen{value,vector,pair}{}" }, diff --git a/home/features/neovim/config/lua/my/lazy.lua b/home/features/neovim/config/lua/my/lazy.lua index 132cc9b..6140999 100644 --- a/home/features/neovim/config/lua/my/lazy.lua +++ b/home/features/neovim/config/lua/my/lazy.lua @@ -6,8 +6,7 @@ end function M.setup() require("lazy").setup({ - require("my.plugins.themes"), - require("my.plugins.whichkey"), + require("my.themes"), unpack(require("nix").lazy), }, { defaults = { lazy = true }, diff --git a/home/features/neovim/config/lua/my/plugins/whichkey.lua b/home/features/neovim/config/lua/my/plugins/whichkey.lua deleted file mode 100644 index 3f1d5ed..0000000 --- a/home/features/neovim/config/lua/my/plugins/whichkey.lua +++ /dev/null @@ -1,35 +0,0 @@ -local runtime = require("my.tempest") - -local M = { - "folke/which-key.nvim", - -- event = "VeryLazy", - lazy = true, - cond = runtime.blacklist("vscode"), -} - -function M.config() - local wk = require("which-key") - - wk.setup({ - window = { - winblend = 0, - pumblend = 0, - border = "single", - }, - layout = { align = "center" }, - }) - - wk.register({ - [""] = { - f = { name = "[F]iles" }, - g = { name = "[G]o to" }, - r = { name = "[R]ename / [R]eplace / [R]eload" }, - l = { name = "[L]ocal" }, - w = { name = "[W]orkspace" }, - y = { name = "[Y]ank" }, - s = { name = "[S]ettings" }, - }, - }) -end - -return M diff --git a/home/features/neovim/config/lua/my/plugins/themes.lua b/home/features/neovim/config/lua/my/themes.lua similarity index 100% rename from home/features/neovim/config/lua/my/plugins/themes.lua rename to home/features/neovim/config/lua/my/themes.lua diff --git a/home/features/neovim/config/spell/en.utf-8.add b/home/features/neovim/config/spell/en.utf-8.add deleted file mode 100644 index 946b83c..0000000 --- a/home/features/neovim/config/spell/en.utf-8.add +++ /dev/null @@ -1 +0,0 @@ -Context/! diff --git a/home/features/neovim/config/spell/en.utf-8.add.spl b/home/features/neovim/config/spell/en.utf-8.add.spl deleted file mode 100644 index 646dcf61e7e78adb4ec6b487b63228c4b6a4abda..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 40 ocmWIZ^erw(&B-zP&%nSSz?jUK&zQ$p!kEff0VJ7(fPxSJ0MD@pZvX%Q diff --git a/home/features/neovim/default.nix b/home/features/neovim/default.nix index 8603085..03b5db6 100644 --- a/home/features/neovim/default.nix +++ b/home/features/neovim/default.nix @@ -362,9 +362,7 @@ let # {{{ scrap scrap = { package = "prescientmoon/scrap.nvim"; - event = "InsertEnter"; - config.setup."my.abbreviations" = true; }; # }}} # }}} @@ -375,10 +373,6 @@ let name = "mini.statusline"; dependencies.lua = [ "web-devicons" ]; - cond = blacklist [ - "vscode" - "firenvim" - ]; lazy = false; opts.content.inactive = @@ -417,10 +411,6 @@ let name = "mini.files"; dependencies.lua = [ "web-devicons" ]; - cond = blacklist [ - "vscode" - "firenvim" - ]; keys = { mapping = ""; desc = "[S]earch [F]iles"; @@ -439,6 +429,17 @@ let opts.mappings.go_in_plus = "l"; }; # }}} + # {{{ quicker.nvim + quicker-nvim = { + package = "stevearc/quicker.nvim"; + name = "quicker.nvim"; + dependencies.lua = [ "web-devicons" ]; + event = "FileType qf"; + + opts = { }; + }; + # }}} + # {{{ harpoon harpoon = { package = "ThePrimeagen/harpoon"; @@ -478,7 +479,6 @@ let telescope = { package = "nvim-telescope/telescope.nvim"; version = "0.1.x"; - cond = blacklist "vscode"; event = "VeryLazy"; # {{{ Dependencies @@ -550,7 +550,6 @@ let dressing = { package = "stevearc/dressing.nvim"; - cond = blacklist "vscode"; event = "VeryLazy"; opts = { @@ -572,7 +571,6 @@ let package = "lukas-reineke/indent-blankline.nvim"; main = "ibl"; - cond = blacklist "vscode"; event = "VeryLazy"; config = true; @@ -624,7 +622,6 @@ let package = "j-hui/fidget.nvim"; tag = "legacy"; - cond = blacklist "vscode"; event = "BufReadPre"; config = true; }; @@ -644,7 +641,6 @@ let dependencies.nix = [ pkgs.tree-sitter ]; - cond = blacklist "vscode"; event = "VeryLazy"; #{{{ Highlighting @@ -665,7 +661,6 @@ let flash = { package = "folke/flash.nvim"; - cond = blacklist "vscode"; keys = let nmap = mode: mapping: action: desc: { @@ -689,7 +684,6 @@ let ftft = { package = "gukz/ftFT.nvim"; - cond = blacklist "vscode"; keys = [ "f" "F" @@ -704,7 +698,6 @@ let clipboard-image = { package = "postfen/clipboard-image.nvim"; - cond = blacklist "firenvim"; cmd = "PasteImg"; keys = { @@ -734,7 +727,6 @@ let lastplace = { package = "ethanholz/nvim-lastplace"; - cond = blacklist "vscode"; event = "BufReadPre"; opts.lastplace_ignore_buftype = [ @@ -748,7 +740,6 @@ let undotree = { package = "mbbill/undotree"; - cond = blacklist "vscode"; cmd = "UndotreeToggle"; keys = nmap "u" "UndoTreeToggle" "[U]ndo tree"; }; @@ -897,7 +888,6 @@ let package = "L3MON4D3/LuaSnip"; version = "v2"; - cond = blacklist "vscode"; config = _: do [ @@ -963,7 +953,6 @@ let dir = miros-nvim; dependencies.nix = [ miros ]; - cond = blacklist "vscode"; ft = "miros"; keys = { @@ -1018,7 +1007,6 @@ let ]; package = "neovim/nvim-lspconfig"; - cond = blacklist "vscode"; event = "VeryLazy"; config = @@ -1106,7 +1094,6 @@ let ); package = "stevearc/conform.nvim"; - cond = blacklist "vscode"; event = "VeryLazy"; opts.format_on_save.lsp_fallback = true; @@ -1165,7 +1152,6 @@ let dependencies.lua = [ "lspconfig" ]; dependencies.nix = lib.lists.optional packedTargets.python pkgs.ruff; - cond = blacklist "vscode"; event = "VeryLazy"; opts = _: { sources = [ (require "null-ls" /builtins/diagnostics/ruff) ]; }; @@ -1187,7 +1173,6 @@ let "luasnip" ]; - cond = blacklist "vscode"; event = [ "InsertEnter" "CmdlineEnter" @@ -1207,7 +1192,6 @@ let "nvim-neotest/nvim-nio" ]; - cond = blacklist "vscode"; config = _: { setup.neotest = { status.virtual_text = true; @@ -1245,7 +1229,6 @@ let dependencies.lua = [ "plenary" ]; version = "^2"; - cond = blacklist "vscode"; ft = [ "haskell" "lhaskell" @@ -1276,7 +1259,6 @@ let pkgs.rustfmt ]; - cond = blacklist "vscode"; lazy = false; # This plugin is already lazy config.autocmds = { @@ -1296,7 +1278,6 @@ let package = "saecki/crates.nvim"; dependencies.lua = [ "plenary" ]; - cond = blacklist "vscode"; event = "BufReadPost Cargo.toml"; # {{{ Set up null_ls source @@ -1374,7 +1355,6 @@ let "lspconfig" ]; - cond = blacklist "vscode"; ft = "lean"; opts = { @@ -1399,7 +1379,6 @@ let "lspconfig" ]; - cond = blacklist "vscode"; ft = [ "idris2" "lidris2" @@ -1436,7 +1415,6 @@ let github-actions = { package = "yasuhiroki/github-actions-yaml.vim"; - cond = blacklist "vscode"; ft = [ "yml" "yaml" @@ -1452,7 +1430,6 @@ let upkgs.typstfmt ]; - cond = blacklist "vscode"; ft = "typst"; }; # }}} @@ -1460,7 +1437,6 @@ let purescript = { package = "purescript-contrib/purescript-vim"; - cond = blacklist "vscode"; ft = "purescript"; }; # }}} @@ -1468,7 +1444,6 @@ let hyprland = { package = "theRealCarneiro/hyprland-vim-syntax"; - cond = blacklist "vscode"; ft = "hypr"; init.autocmds = { @@ -1483,7 +1458,6 @@ let # Required for yarn PNP to work rzip = { package = "lbrayner/vim-rzip"; - cond = blacklist "vscode"; event = "VeryLazy"; }; # }}} @@ -1499,7 +1473,6 @@ let in { dir = "${djot}/editors/vim"; - cond = blacklist "vscode"; ft = "djot"; config.autocmds = { @@ -1518,10 +1491,6 @@ let package = "wakatime/vim-wakatime"; dependencies.nix = [ pkgs.wakatime ]; - cond = blacklist [ - "vscode" - "firenvim" - ]; event = "VeryLazy"; }; # }}} @@ -1531,10 +1500,6 @@ let package = "andweeb/presence.nvim"; main = "presence"; - cond = blacklist [ - "vscode" - "firenvim" - ]; event = "VeryLazy"; config = true; }; @@ -1545,10 +1510,6 @@ let package = "ruifm/gitlinker.nvim"; dependencies.lua = [ "plenary" ]; - cond = blacklist [ - "vscode" - "firenvim" - ]; opts.mappings = "yg"; keys = { mapping = opts.mappings; @@ -1566,16 +1527,7 @@ let dependencies.lua = [ "plenary" ]; event = "VeryLazy"; - cond = [ - (blacklist [ - "vscode" - "firenvim" - ]) - ( - # lua - lua "vim.loop.cwd() == ${encode obsidianVault}" - ) - ]; + cond = lua "vim.loop.cwd() == ${encode obsidianVault}"; config.keys = let @@ -1623,11 +1575,7 @@ let # {{{ navigator navigator = { package = "numToStr/Navigator.nvim"; - cond = blacklist [ - "vscode" - "firenvim" - "neovide" - ]; + cond = blacklist [ "neovide" ]; config = true; keys = [ diff --git a/home/features/neovim/snippets/all.miros b/home/features/neovim/snippets/all.miros index f96ab4b..e6fe07f 100644 --- a/home/features/neovim/snippets/all.miros +++ b/home/features/neovim/snippets/all.miros @@ -9,3 +9,4 @@ block auto abbr lor \/ abbr langle ⟨ abbr rangle \⟩ + abbr thrf therefore diff --git a/home/features/neovim/snippets/common/math-phrases.miros b/home/features/neovim/snippets/common/math-phrases.miros new file mode 100644 index 0000000..1183726 --- /dev/null +++ b/home/features/neovim/snippets/common/math-phrases.miros @@ -0,0 +1,23 @@ +block !word + for s <- @⟨,s⟩ + + block + for b <- @⟨b,B⟩ + for w <- @⟨w,W⟩ + for t <- @⟨w,W⟩ + + + abbr @b⋄cla @b⋄y contradiction let's assume + abbr @w⋄lg @w⋄ithout loss of generality + abbr @t⋄its @t⋄hat is to say, + abbr @w⋄pbd @w⋄e will prove the statement in both directions. + + abbr stam@s statement@s + abbr cex@s counterexample@s + + for who <- @⟨which, this⟩ + for what <- @⟨means, implies⟩ + abbr @who@what @⟨@who:which,this⟩@⟨@what:means,implies⟩ + + for kind <- @⟨parts,substitution⟩ + abbr ib@⟨@kind:p,s⟩ integration by @kind diff --git a/hosts/nixos/common/global/default.nix b/hosts/nixos/common/global/default.nix index b032ed3..28a52ed 100644 --- a/hosts/nixos/common/global/default.nix +++ b/hosts/nixos/common/global/default.nix @@ -14,6 +14,10 @@ let inputs.stylix.nixosModules.stylix inputs.sops-nix.nixosModules.sops # }}} + # {{{ Satellite subprojects + ../../../../dns/implementation/nixos-module.nix + ../../../../dns/implementation/nixos-module-assertions.nix + # }}} # {{{ global configuration ./cli/fish.nix ./services/openssh.nix diff --git a/hosts/nixos/lapetus/services/microbin.nix b/hosts/nixos/lapetus/services/microbin.nix index 9654f58..8076e07 100644 --- a/hosts/nixos/lapetus/services/microbin.nix +++ b/hosts/nixos/lapetus/services/microbin.nix @@ -1,11 +1,11 @@ -{ config, lib, ... }: +{ config, ... }: { sops.secrets.microbin_env.sopsFile = ../secrets.yaml; satellite.cloudflared.at.bin.port = config.satellite.ports.microbin; services.microbin = { enable = true; - dataDir = "/var/lib/microbin"; + dataDir = "/persist/state/var/lib/microbin"; passwordFile = config.sops.secrets.microbin_env.path; # {{{ Settings @@ -39,11 +39,4 @@ }; # }}} }; - - systemd.services.microbin.serviceConfig = { - # We want to use systemd's `StateDirectory` mechanism to fix permissions - ReadWritePaths = lib.mkForce [ ]; - }; - - environment.persistence."/persist/state".directories = [ "/var/lib/private/microbin" ]; } diff --git a/modules/README.md b/modules/README.md index d1a416d..008e653 100644 --- a/modules/README.md +++ b/modules/README.md @@ -9,15 +9,3 @@ This directory contains custom module definitions used throughout my config. | [common](./common) | Modules usable in both HM and nixos (and perhaps other places) | | [nixos](./nixos) | Nixos specific functionality | | [home-manager](./home-manager) | Home manager specific functionality | - -## Common modules - -| Name | Attribute | Description | -| ----------------------------------------------- | --------------------------- | --------------------------------------------------------------------------------------------- | -| [toggles](./common/toggles.nix) | `satellite.toggles` | Generic interface for feature flags | -| [lua-lib](./common/lua-lib.nix) | `satellite.lib.lua` | Helpers for working with lua code | -| [korora-lua](./common/korora-lua.nix) | - | Nix -> lua encoder typechecked using [korora](https://github.com/adisbladis/korora) | -| [korora-neovim](./common/korora-neovim.nix) | - | Nix -> neovim config helpers typechecked using [korora](https://github.com/adisbladis/korora) | -| [theming](./common/theming.nix) | `satellite.theming` | [stylix](https://github.com/danth/stylix) theming helpers and configuration | -| [lua-colorscheme](./common/lua-colorscheme.nix) | `satellite.colorscheme.lua` | Base16 theme to lua module generation | -| [octodns](./common/octodns.nix) | `satellite.dns.octodns` | Octodns config generation | diff --git a/modules/common/README.md b/modules/common/README.md index 1ebe514..90dfe5a 100644 --- a/modules/common/README.md +++ b/modules/common/README.md @@ -10,11 +10,3 @@ | [korora-neovim](korora-neovim.nix) | - | Nix -> neovim config helpers | | [theming](theming.nix) | `satellite.theming` | Stylix theming helpers | | [lua-colorscheme](lua-colorscheme.nix) | `satellite.colorscheme.lua` | Base16 theme -> lua | - -## Other modules - -These are special-purpose modules that are used for other purposes - -| Name | Attribute | Description | -| ---------------------- | ----------------------- | ------------------------- | -| [octodns](octodns.nix) | `satellite.dns.octodns` | Octodns config generation | diff --git a/modules/common/octodns.nix b/modules/common/octodns.nix deleted file mode 100644 index 08ddc06..0000000 --- a/modules/common/octodns.nix +++ /dev/null @@ -1,48 +0,0 @@ -{ - config, - pkgs, - lib, - ... -}: -let - format = pkgs.formats.yaml { }; - cfg = config.satellite.dns; -in -{ - options.satellite.dns.octodns = lib.mkOption { - description = "Derivation building a directory containing all the zone files"; - type = lib.types.path; - }; - - config.satellite.dns.octodns = - let - grouped = builtins.groupBy (entry: entry.zone) cfg.records; - cpLines = lib.mapAttrsToList ( - zone: group: - let - grouped = builtins.groupBy (entry: entry.at) group; - contents = lib.mapAttrs ( - at: entries: - lib.lists.forEach entries ( - entry: - let - content = - if builtins.typeOf entry.value == "list" then - { values = entry.value; } - else - { inherit (entry) value; }; - cloudflare = if entry.enableCloudflareProxy then { octodns.cloudflare.proxied = true; } else { }; - in - { inherit (entry) ttl type; } // content // cloudflare - ) - ) grouped; - file = format.generate "${zone}.yaml" contents; - in - "cp ${file} $out/${zone}.yaml" - ) grouped; - in - pkgs.runCommand "octodns-zones" { } '' - mkdir $out - ${lib.concatStringsSep "\n" cpLines} - ''; -} diff --git a/modules/nixos/README.md b/modules/nixos/README.md index 3644dbe..8e88e2e 100644 --- a/modules/nixos/README.md +++ b/modules/nixos/README.md @@ -1,11 +1,9 @@ # Nixos modules -| Name | Attribute | Description | -| ------------------------------------ | ----------------------- | ------------------------------------ | -| [pounce](pounce.nix) | `services.pounce` | Pounce & calico configuration | -| [nginx](nginx.nix) | `satellite.nginx` | Nginx configuration | -| [ports](ports.nix) | `satellite.ports` | Global port specification | -| [cloudflared](cloudflared.nix) | `satellite.cloudflared` | Cloudflare tunnel configuration | -| [pilot](pilot.nix) | `satellite.pilot` | Defines the concept of a "main user" | -| [dns](dns.nix) | `satellite.dns` | DNS record creation | -| [dns-assertions](dns-assertions.nix) | `satellite.dns` | DNS record validation | +| Name | Attribute | Description | +| ------------------------------ | ----------------------- | ------------------------------------ | +| [pounce](pounce.nix) | `services.pounce` | Pounce & calico configuration | +| [nginx](nginx.nix) | `satellite.nginx` | Nginx configuration | +| [ports](ports.nix) | `satellite.ports` | Global port specification | +| [cloudflared](cloudflared.nix) | `satellite.cloudflared` | Cloudflare tunnel configuration | +| [pilot](pilot.nix) | `satellite.pilot` | Defines the concept of a "main user" | diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix index 4f5f73f..e984101 100644 --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -7,6 +7,4 @@ nginx = ./nginx.nix; pilot = ./pilot.nix; pounce = ./pounce.nix; - dns = ./dns.nix; - dns-assertions = ./dns-assertions.nix; } diff --git a/pkgs/default.nix b/pkgs/default.nix index 1c6447f..6e3f8c7 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -9,21 +9,8 @@ let plymouthThemes = pkgs.callPackage (import ./plymouth-themes.nix) { }; in -rec { +{ plymouthThemeCutsAlt = plymouthThemes.cuts_alt; vimclip = pkgs.callPackage (import ./vimclip.nix) { }; homer = pkgs.callPackage (import ./homer.nix) { }; - - octodns = pkgs.octodns.overrideAttrs (_: { - version = "unstable-2024-10-08"; - src = pkgs.fetchFromGitHub { - owner = "octodns"; - repo = "octodns"; - rev = "a1456cb1fcf00916ca06b204755834210a3ea9cf"; - sha256 = "192hbxhb0ghcbzqy3h8q194n4iy7bqfj9ra9qqjff3x2z223czxb"; - }; - }); - octodns-cloudflare = pkgs.python3Packages.callPackage (import ./octodns-cloudflare.nix) { - inherit octodns; - }; }