1
Fork 0

Uhhhh, lots of changes I forgot to push earlier

This commit is contained in:
prescientmoon 2024-09-24 05:41:40 +02:00
parent de5e4fe049
commit 5230faf7c4
Signed by: prescientmoon
SSH key fingerprint: SHA256:WFp/cO76nbarETAoQcQXuV+0h7XJsEsOCI0UsyPIy6U
20 changed files with 1697 additions and 1634 deletions

View file

@ -1,9 +1,9 @@
args: {
haskell = import ./haskell.nix args;
lua = import ./lua.nix args;
purescript = import ./purescript.nix args;
rwtw = import ./rwtw.nix args;
typst = import ./typst.nix args;
lua = import ./lua.nix args;
web = import ./web.nix args;
bootstrap = import ./bootstrap/shell.nix args;
}

7
devshells/web.nix Normal file
View file

@ -0,0 +1,7 @@
{ pkgs, ... }:
pkgs.mkShell {
packages = with pkgs; [
typescript
nodejs
];
}

View file

@ -1,4 +1,9 @@
{ pkgs, config, lib, ... }:
{
pkgs,
config,
lib,
...
}:
let
repaint = "commandline -f repaint";
fishKeybinds = {
@ -20,8 +25,10 @@ let
"\\e\\[70\\;5u" = ''nvim +":lua require('mini.files').open()"'';
};
mkKeybind = key: value:
let escaped = lib.escapeShellArg value;
mkKeybind =
key: value:
let
escaped = lib.escapeShellArg value;
in
''
bind -M default ${key} ${escaped}
@ -34,13 +41,9 @@ in
enable = true;
defaultOptions = [ "--no-scrollbar" ];
changeDirWidgetOptions = [
"--preview '${lib.getExe pkgs.eza} --icons --tree --color=always {}'"
];
changeDirWidgetOptions = [ "--preview '${lib.getExe pkgs.eza} --icons --tree --color=always {}'" ];
fileWidgetOptions = [
"--preview '${lib.getExe pkgs.bat} --number --color=always {}'"
];
fileWidgetOptions = [ "--preview '${lib.getExe pkgs.bat} --number --color=always {}'" ];
};
stylix.targets.fzf.enable = true;
@ -65,26 +68,20 @@ in
let
plugins = with pkgs.fishPlugins; [
z # Jump to directories by typing "z <directory-name>"
grc # Adds color to a bunch of built in commands
done # Trigger a notification when long commands finish execution
puffer # Text expansion (i.e. expanding .... to ../../../)
sponge # Remove failed commands and whatnot from history
forgit # Git tui thingy? (I'm still trying this one out)
colored-man-pages # Self explainatory:)
colored-man-pages
];
in
# For some reason home-manager expects a slightly different format 🤔
lib.forEach plugins
(plugin: {
lib.forEach plugins (plugin: {
name = plugin.pname;
inherit (plugin) src;
});
# }}}
};
# I sometimes get errors about `grc` being missing, so I gave up and added it here.
home.packages = [ pkgs.grc ];
satellite.persistence.at.state.apps.fish.directories = [
"${config.xdg.dataHome}/fish"
"${config.xdg.dataHome}/z" # The z fish plugin requires this

View file

@ -49,6 +49,18 @@
init.defaultBranch = "main";
rebase.autoStash = true;
push.default = "current";
push.autoSetupRemote = true;
# {{{ URL rewriting
url."git@github.com:".insteadOf = [
# Normalize GitHub URLs to SSH to avoid authentication issues with HTTPS.
"https://github.com/"
# Allows typing `git clone github:owner/repo`.
"github:"
];
# }}}
# {{{ Signing
# Sign commits using ssh
gpg.format = "ssh";

View file

@ -2,19 +2,19 @@
lib.fix (self: {
"Catppuccin Mocha" = fetchurl {
url = "https://catppuccin.github.io/discord/dist/catppuccin-mocha.theme.css";
sha256 = "1gafrnm5mz8zh63zvcr3jp5fkzs9l0xnpwq3b4k7sbbzwg04nzw5";
sha256 = "0y9vha3gb48yid65r2zfkc6l021j1s8mlac3klkbksla9gqnd9wr";
};
"Catppuccin Frappe" = fetchurl {
url = "https://catppuccin.github.io/discord/dist/catppuccin-frappe.theme.css";
sha256 = "05y43fcwgy4sv9q6c49r5c92jzvq8vjrk05wy2zblp5v7zrli7sl";
sha256 = "19kmmydkbpig14ql6zn0vqzlfykm6qg7r317vwjzq9dg092lflam";
};
"Catppuccin Latte" = fetchurl {
url = "https://catppuccin.github.io/discord/dist/catppuccin-latte.theme.css";
sha256 = "1c7vwr8f6sip7lsyp770hm170pnld1ikvqdsh2fxlsdkkn6ay2k3";
sha256 = "0lm1mzflyxmzpsyfkbcd1v7d1xp5i683yc6npbsm12z4hqn2smf6";
};
"Catppuccin Macchiato" = fetchurl {
url = "https://catppuccin.github.io/discord/dist/catppuccin-macchiato.theme.css";
sha256 = "11vig9i5kwhcbblspcp928gf4mvvp3v0qsibmh82wyxyw9ddzr7d";
sha256 = "01zd5zf9b4a2kkwnkpzg37g1macan6201wyi7zj2crsbxy8b7j6k";
};
default.dark = self."Catppuccin Macchiato";
default.light = self."Catppuccin Latte";

View file

@ -8,3 +8,5 @@ local nix = require("nix")
tempest.configureMany(nix.pre)
require("my.lazy").setup()
tempest.configureMany(nix.post)
require("my.helpers.folding").setup()

View file

@ -45,11 +45,10 @@
"nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" },
"plenary": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" },
"purescript": { "branch": "main", "commit": "82348352e6568fcc0385bd7c99a8ead3a479feea" },
"rust-tools": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" },
"rustacean": { "branch": "master", "commit": "5c0c44149e43b907dae2e0fe053284ad56226eb7" },
"rzip": { "branch": "master", "commit": "f65400fed27b27c7cff7ef8d428c4e5ff749bf28" },
"scrap": { "branch": "main", "commit": "cc8453ed613932c744c3d1ec42f379b78bd8b92c" },
"telescope": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"treesitter": { "branch": "master", "commit": "7f4ac678770175cdf0d42c015f4a5b6e18b6cb33" },
"typst": { "branch": "main", "commit": "4d18ced62599ffe5b3c0e5e49566d5456121bc02" },
"undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" },
"wakatime": { "branch": "master", "commit": "3cb40867cb5a3120f9bef76eff88edc7f1dc1a23" },

View file

@ -0,0 +1,23 @@
local M = {}
local function createFold(name)
local commentstring = vim.o.commentstring
local start_comment = string.gsub(commentstring, "%%s", " {{{ " .. name)
local end_comment = string.gsub(commentstring, "%%s", " }}}")
-- Leave visual mode
local esc = vim.api.nvim_replace_termcodes("<esc>", true, false, true)
vim.api.nvim_feedkeys(esc, "x", false)
vim.cmd(":'>put='" .. end_comment .. "'")
vim.cmd(":'<-1put='" .. start_comment .. "'")
end
function M.setup()
vim.keymap.set("v", "<C-i>", function()
local name = vim.fn.input("Fold name: ")
createFold(name)
end, { desc = "Create fold markers around area" })
end
return M

View file

@ -26,7 +26,7 @@ function M.setup()
fallback = true,
-- Directory where I store my local plugin projects
path = vim.g.nix_projects_path,
path = vim.g.nix_projects_dir,
patterns = { "prescientmoon" },
},
performance = {

View file

@ -29,9 +29,9 @@ let
mirosSnippetCache = "${config.xdg.cacheHome}/miros";
obsidianVault = "${config.xdg.userDirs.extraConfig.XDG_PROJECTS_DIR}/stellar-sanctum";
generated = nlib.generateConfig (
lib.fix (
self: with nlib; {
generated =
with nlib;
generateConfig {
# {{{ Pre-plugin config
pre = {
# {{{ General options
@ -508,7 +508,7 @@ let
in
[
(nmap "<c-p>" "find_files" "File finder [p]alette")
(nmap "<leader>d" "diagnostics" "[D]iagnostics")
(nmap "<leader>d" "diagnostics root_dir=true" "[D]iagnostics")
(nmap "<c-f>" "live_grep" "[F]ind in project")
(nmap "<c-t>" "builtin" "[T]elescope pickers")
# {{{ Files by extension
@ -1212,6 +1212,7 @@ let
status.virtual_text = true;
output.open_on_run = true;
adapters = [
(require "rustaceanvim.neotest")
(require "neotest-haskell" {
build_tools = [ "stack" ];
frameworks = [ "hspec" ];
@ -1266,21 +1267,24 @@ let
};
# }}}
# {{{ rust support
# {{{ rust-tools
rust-tools = {
package = "simrat39/rust-tools.nvim";
# {{{ rustacean
rustacean = {
package = "mrcjkb/rustaceanvim";
dependencies.nix = lib.lists.optionals packedTargets.rust [
pkgs.rust-analyzer
pkgs.rustfmt
];
cond = blacklist "vscode";
ft = "rust";
lazy = false; # This plugin is already lazy
opts.server.on_attach = tempestBufnr {
keys = {
config.autocmds = {
group = "RustaceanSettings";
event = "FileType";
pattern = "rs";
action.keys = {
mapping = "<leader>lc";
action = "<cmd>RustOpenCargo<cr>";
action = "<cmd>RustLsp openCargo<cr>";
desc = "Open [c]argo.toml";
};
};
@ -1635,19 +1639,17 @@ let
# }}}
};
# }}}
}
)
);
};
# {{{ extraRuntime
# Experimental nix module generation
generatedConfig = (config.satellite.lib.lua.writeFile "lua/nix" "init" generated.lua);
generatedConfig = config.satellite.lib.lua.writeFile "lua/nix" "init" generated.lua;
extraRuntime = lib.concatStringsSep "," [
generatedConfig
mirosSnippetCache
"${pkgs.vimPlugins.lazy-nvim}"
];
# }}}
# {{{ Client wrapper
# Wraps a neovim client, providing the dependencies

View file

@ -55,10 +55,10 @@ block text
pattern ([Ll]et)
name definition
snip @1 \$$1 = $2\$
snip @0 \$$1 = $2\$ @0
block auto
string im
string $
name inline math
snip \$$1\$$0
@ -92,11 +92,18 @@ block math
$7 & $8 & $9
\end{@matenv}
for operator <- @⟨eq,neq,defas,leq,geq,lt,gt,iip,iib,iff⟩
for symbol <- @⟨@operator:=,\neq,\coloneq,\leq,\geq,<,>,\implies,\impliedby,\iff⟩
for createabbr <- @⟨false,true⟩
for operator <- @⟨@createabbr:
@⟨eq,lt,gt⟩,
@⟨neq,defas,leq,geq,iip,iib,iff⟩
for symbol <- @⟨@createabbr:
@⟨@operator:=,<,>⟩,
@⟨@operator:\neq,\coloneq,\leq,\geq,\implies,\impliedby,\iff⟩
block auto
abbr @operator @symbol
abbr @⟨@createabbr:op-@operator,@operator⟩ @symbol
string a@operator
name align at @operator
@ -177,6 +184,7 @@ block math
abbr frl \forall
abbr exs \exists
abbr iin \in
abbr nin \not\in
abbr ccup \cup
abbr ccap \cap
@ -187,9 +195,8 @@ block math
abbr vsm \vecspace
abbr oball \ball
for noperator <- @⟨ordop,land,lor⟩
string @noperator
snip \\@noperator
for noperator <- @⟨ordop,land,lor,equiv,pmod⟩
abbr @noperator \\@noperator
for operator <- @⟨overline,hat,bar,abs,norm,prob,diprod,sin,cos,sqrt,ln,lrb,zmod,gen,diam,prob⟩
string @operator
@ -247,10 +254,10 @@ block math
name limit to @limtarget
snip \lim_{$1 \to @limtargetsymbol} $0
string dint
string intd
name definite integral
snip \int_{$|1⟨$1,-\infty$1⟩}^$|2⟨{$2},\infty$2⟩ $3 \dif $0
string iint
string inti
name indefinite integral
snip \int $1 \dif $0

View file

@ -113,6 +113,16 @@
"${config.xdg.configHome}/Signal" # Why tf does signal store it's state here 💀
];
# }}}
# {{{ What's app
satellite.persistence.at.state.apps.whatsapp.directories = [
"${config.xdg.configHome}/whatsapp-for-linux"
"${config.xdg.stateHome}/whatsapp-for-linux"
];
satellite.persistence.at.cache.apps.whatsapp.directories = [
"${config.xdg.cacheHome}/whatsapp-for-linux"
];
# }}}
# {{{ Lutris
# TODO: there might be more to cache in .cache/lutris
satellite.persistence.at.state.apps.lutris.directories = [

View file

@ -53,6 +53,9 @@
programs.kdeconnect.enable = true;
programs.firejail.enable = true;
# }}}
# {{{ SSH keys
users.users.pilot.openssh.authorizedKeys.keyFiles = [ ../tethys/keys/id_ed25519.pub ];
# }}}
satellite.pilot.name = "moon";
boot.loader.systemd-boot.enable = true;

View file

@ -62,19 +62,13 @@
# {{{ /persist/data
"persist-data" = {
mountpoint = "/persist/data";
mountOptions = [
"compress=zstd"
"noatime"
];
mountOptions = [ "compress=zstd" ];
};
# }}}
# {{{ /persist/state
"persist-state" = {
mountpoint = "/persist/state";
mountOptions = [
"compress=zstd"
"noatime"
];
mountOptions = [ "compress=zstd" ];
};
# }}}
# {{{ /local/nix

View file

@ -74,4 +74,9 @@ in
};
# }}}
};
environment.persistence."/persist/local/cache".directories = [
"/var/cache/restic-backups-data"
"/var/cache/restic-backups-state"
];
}

View file

@ -21,6 +21,9 @@
# Configure users through nix only
mutableUsers = false;
# Sync up root and `pilot` shell
users.root.shell = config.users.users.pilot.shell;
# {{{ Create pilot user
users.pilot = {
inherit (config.satellite.pilot) name;
@ -46,27 +49,6 @@
hashedPasswordFile = config.sops.secrets.pilot_password.path;
shell = pkgs.fish;
# {{{ Authorize ssh keys
openssh.authorizedKeys.keyFiles =
let
# Record containing all the hosts
hosts = outputs.nixosConfigurations;
# Function from hostname to relative path to public ssh key
idKey = host: ../../${host}/keys/id_ed25519.pub;
in
lib.pipe hosts [
# attrsetof host -> attrsetof path
(builtins.mapAttrs (name: _: idKey name)) # string -> host -> path
# attrsetof path -> path[]
builtins.attrValues
# path[] -> path[]
(builtins.filter builtins.pathExists)
];
# }}}
};
# }}}
};

View file

@ -43,10 +43,14 @@
];
};
# }}}
# Tell sops-nix to use the hermes keys for decrypting secrets
sops.age.sshKeyPaths = [ "/hermes/secrets/hermes/ssh_host_ed25519_key" ];
# {{{ SSH keys
users.users.pilot.openssh.authorizedKeys.keyFiles = [
../calypso/keys/id_ed25519.pub
../lapetus/keys/id_ed25519.pub
../tethys/keys/id_ed25519.pub
];
# }}}
# {{{ Install some packages
environment.systemPackages =
let
cloneConfig = pkgs.writeShellScriptBin "liftoff" ''
@ -60,6 +64,10 @@
neovim # Text editor
cloneConfig # Clones my nixos config from github
];
# }}}
# Tell sops-nix to use the hermes keys for decrypting secrets
sops.age.sshKeyPaths = [ "/hermes/secrets/hermes/ssh_host_ed25519_key" ];
# Fast but bad compression
# isoImage.squashfsCompression = "gzip -Xcompression-level 1";

View file

@ -26,7 +26,7 @@
./services/grafana.nix
./services/guacamole
./services/homer.nix
./services/intray.nix
# ./services/intray.nix
./services/invidious.nix
./services/jellyfin.nix
./services/jupyter.nix
@ -65,6 +65,15 @@
}
];
# }}}
# {{{ SSH keys
users.users.pilot.openssh.authorizedKeys.keyFiles = [
../calypso/keys/id_ed25519.pub
../tethys/keys/id_ed25519.pub
];
users.users.root.openssh.authorizedKeys.keyFiles =
config.users.users.pilot.openssh.authorizedKeys.keyFiles;
# }}}
boot.loader.systemd-boot.enable = true;
}

View file

@ -59,4 +59,7 @@
# }
];
# }}}
# {{{ SSH keys
users.users.pilot.openssh.authorizedKeys.keyFiles = [ ../calypso/keys/id_ed25519.pub ];
# }}}
}