Compare commits
27 commits
3dc7f562e9
...
b478f7b1ae
| Author | SHA1 | Date | |
|---|---|---|---|
| b478f7b1ae | |||
| f65bdf0013 | |||
| b7f933e0e5 | |||
| 57e63e4b6d | |||
| a67a54bda2 | |||
| 9751fdb888 | |||
| 24407448d4 | |||
| c1e2114c57 | |||
| 97bcc5f34e | |||
| f14f5c7f8a | |||
| 5b545a28f1 | |||
| 1dc65a37e7 | |||
| a997d36964 | |||
| 0c5836bc56 | |||
| 77839ab2ef | |||
| 8a8e4f93a5 | |||
| 07d8f5a03f | |||
| a9ba93f834 | |||
| d2a8894eb2 | |||
| 22f97b4ac7 | |||
| 921d604ebe | |||
| e3243ebe80 | |||
| 4b6f62b25a | |||
| c5be292dfc | |||
| bfda64288e | |||
| 89bc60609f | |||
| 2eb2a83dca |
17 changed files with 249 additions and 78 deletions
30
flake.lock
generated
30
flake.lock
generated
|
|
@ -14,11 +14,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1736955230,
|
||||
"narHash": "sha256-uenf8fv2eG5bKM8C/UvFaiJMZ4IpUFaQxk9OH5t/1gA=",
|
||||
"lastModified": 1747575206,
|
||||
"narHash": "sha256-NwmAFuDUO/PFcgaGGr4j3ozG9Pe5hZ/ogitWhY+D81k=",
|
||||
"owner": "ryantm",
|
||||
"repo": "agenix",
|
||||
"rev": "e600439ec4c273cf11e06fe4d9d906fb98fa097c",
|
||||
"rev": "4835b1dc898959d8547a871ef484930675cb47f1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -36,11 +36,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1700795494,
|
||||
"narHash": "sha256-gzGLZSiOhf155FW7262kdHo2YDeugp3VuIFb4/GGng0=",
|
||||
"lastModified": 1744478979,
|
||||
"narHash": "sha256-dyN+teG9G82G+m+PX/aSAagkC+vUv0SgUw3XkPhQodQ=",
|
||||
"owner": "lnl7",
|
||||
"repo": "nix-darwin",
|
||||
"rev": "4b9b83d5a92e8c1fbfd8eb27eda375908c11ec4d",
|
||||
"rev": "43975d782b418ebf4969e9ccba82466728c2851b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -117,11 +117,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1742649964,
|
||||
"narHash": "sha256-DwOTp7nvfi8mRfuL1escHDXabVXFGT1VlPD1JHrtrco=",
|
||||
"lastModified": 1747372754,
|
||||
"narHash": "sha256-2Y53NGIX2vxfie1rOW0Qb86vjRZ7ngizoo+bnXU9D9k=",
|
||||
"owner": "cachix",
|
||||
"repo": "git-hooks.nix",
|
||||
"rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82",
|
||||
"rev": "80479b6ec16fefd9c1db3ea13aeb038c60530f46",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -159,11 +159,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1743869639,
|
||||
"narHash": "sha256-Xhe3whfRW/Ay05z9m1EZ1/AkbV1yo0tm1CbgjtCi4rQ=",
|
||||
"lastModified": 1747978958,
|
||||
"narHash": "sha256-pQQnbxWpY3IiZqgelXHIe/OAE/Yv4NSQq7fch7M6nXQ=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "d094c6763c6ddb860580e7d3b4201f8f496a6836",
|
||||
"rev": "7419250703fd5eb50e99bdfb07a86671939103ea",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -175,11 +175,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1744777043,
|
||||
"narHash": "sha256-O6jgTxz9BKUiaJl03JsVHvSjtCOC8gHfDvC2UCfcLMc=",
|
||||
"lastModified": 1747744144,
|
||||
"narHash": "sha256-W7lqHp0qZiENCDwUZ5EX/lNhxjMdNapFnbErcbnP11Q=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "7a6f7f4c1c69eee05641beaa40e7f85da8e69fb0",
|
||||
"rev": "2795c506fe8fb7b03c36ccb51f75b6df0ab2553f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
|||
|
|
@ -22,10 +22,6 @@ let
|
|||
];
|
||||
|
||||
mkHome = name: system: inputs.home-manager.lib.homeManagerConfiguration {
|
||||
# Work-around for home-manager
|
||||
# * not letting me set `lib` as an extraSpecialArgs
|
||||
# * not respecting `nixpkgs.overlays` [1]
|
||||
# [1]: https://github.com/nix-community/home-manager/issues/2954
|
||||
pkgs = inputs.nixpkgs.legacyPackages.${system};
|
||||
|
||||
modules = defaultModules ++ [
|
||||
|
|
|
|||
|
|
@ -15,8 +15,10 @@ let
|
|||
];
|
||||
|
||||
buildHost = name: system: lib.nixosSystem {
|
||||
inherit system;
|
||||
modules = defaultModules ++ [
|
||||
{
|
||||
nixpkgs.hostPlatform = system;
|
||||
}
|
||||
"${self}/hosts/nixos/${name}"
|
||||
];
|
||||
specialArgs = {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,20 @@
|
|||
services.gpg-agent.enable = lib.mkForce false;
|
||||
|
||||
my.home = {
|
||||
atuin = {
|
||||
package = pkgs.stdenv.mkDerivation {
|
||||
pname = "atuin";
|
||||
version = "18.4.0";
|
||||
|
||||
buildCommand = ''
|
||||
mkdir -p $out/bin
|
||||
ln -s /usr/bin/atuin $out/bin/atuin
|
||||
'';
|
||||
|
||||
meta.mainProgram = "atuin";
|
||||
};
|
||||
};
|
||||
|
||||
git = {
|
||||
package = pkgs.emptyDirectory;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -7,6 +7,20 @@
|
|||
services.gpg-agent.enable = lib.mkForce false;
|
||||
|
||||
my.home = {
|
||||
atuin = {
|
||||
package = pkgs.stdenv.mkDerivation {
|
||||
pname = "atuin";
|
||||
version = "18.4.0";
|
||||
|
||||
buildCommand = ''
|
||||
mkdir -p $out/bin
|
||||
ln -s /usr/bin/atuin $out/bin/atuin
|
||||
'';
|
||||
|
||||
meta.mainProgram = "atuin";
|
||||
};
|
||||
};
|
||||
|
||||
git = {
|
||||
package = pkgs.emptyDirectory;
|
||||
};
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -24,6 +24,7 @@
|
|||
./gtk
|
||||
./htop
|
||||
./jq
|
||||
./jujutsu
|
||||
./keyboard
|
||||
./mail
|
||||
./mpv
|
||||
|
|
|
|||
|
|
@ -11,6 +11,10 @@ in
|
|||
git = {
|
||||
enable = my.mkDisableOption "git integration";
|
||||
};
|
||||
|
||||
jujutsu = {
|
||||
enable = my.mkDisableOption "jujutsu integration";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
|
|
@ -23,6 +27,20 @@ in
|
|||
properly configured.
|
||||
'';
|
||||
}
|
||||
{
|
||||
assertion = cfg.enable -> config.programs.git.enable;
|
||||
message = ''
|
||||
`config.my.home.delta` relies on `config.programs.git` to be
|
||||
enabled.
|
||||
'';
|
||||
}
|
||||
{
|
||||
assertion = cfg.jujutsu.enable -> cfg.git.enable;
|
||||
message = ''
|
||||
`config.my.home.delta.jujutsu` relies on `config.my.home.delta.git`
|
||||
being enabled.
|
||||
'';
|
||||
}
|
||||
];
|
||||
|
||||
home.packages = [ cfg.package ];
|
||||
|
|
@ -57,5 +75,25 @@ in
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
programs.jujutsu = lib.mkIf cfg.jujutsu.enable {
|
||||
settings = {
|
||||
merge-tools = {
|
||||
delta = {
|
||||
# Errors are signaled with exit codes greater or equal to 2
|
||||
diff-expected-exit-codes = [ 0 1 ];
|
||||
};
|
||||
};
|
||||
|
||||
ui = {
|
||||
diff = {
|
||||
# Delta expects a `git diff` input
|
||||
format = "git";
|
||||
};
|
||||
|
||||
pager = "${lib.getExe cfg.package}";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,9 +12,7 @@ let
|
|||
in
|
||||
{
|
||||
config = lib.mkIf cfg.enable {
|
||||
xdg.configFile."tridactyl/tridactylrc".source = pkgs.substituteAll {
|
||||
src = ./tridactylrc;
|
||||
|
||||
xdg.configFile."tridactyl/tridactylrc".source = pkgs.replaceVars ./tridactylrc {
|
||||
editorcmd = lib.concatStringsSep " " [
|
||||
# Use my configured terminal
|
||||
term
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ in
|
|||
services.gpg-agent = {
|
||||
enable = true;
|
||||
enableSshSupport = true; # One agent to rule them all
|
||||
pinentryPackage = cfg.pinentry;
|
||||
pinentry.package = cfg.pinentry;
|
||||
extraConfig = ''
|
||||
allow-loopback-pinentry
|
||||
'';
|
||||
|
|
|
|||
128
modules/home/jujutsu/default.nix
Normal file
128
modules/home/jujutsu/default.nix
Normal file
|
|
@ -0,0 +1,128 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
cfg = config.my.home.jujutsu;
|
||||
|
||||
inherit (lib.my) mkMailAddress;
|
||||
in
|
||||
{
|
||||
options.my.home.jujutsu = with lib; {
|
||||
enable = my.mkDisableOption "jujutsu configuration";
|
||||
|
||||
package = mkPackageOption pkgs "jujutsu" { };
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
assertions = [
|
||||
{
|
||||
# For `jj git` commands
|
||||
assertion = cfg.enable -> config.my.home.git.enable;
|
||||
message = ''
|
||||
`config.my.home.jujutsu` relies on `config.my.home.git` being enabled.
|
||||
'';
|
||||
}
|
||||
];
|
||||
|
||||
programs.jujutsu = {
|
||||
enable = true;
|
||||
|
||||
inherit (cfg) package;
|
||||
|
||||
settings = {
|
||||
# Who am I?
|
||||
user = {
|
||||
name = "Bruno BELANYI";
|
||||
email = mkMailAddress "bruno" "belanyi.fr";
|
||||
};
|
||||
|
||||
aliases = {
|
||||
jj = [ "util" "exec" "--" "jj" ];
|
||||
# FIXME:
|
||||
# * topo sort by default (I think? test it)
|
||||
# * still not a big fan of the template
|
||||
lol = [ "log" "-r" "..@" "-T" "builtin_log_oneline" ];
|
||||
lola = [ "lol" "-r" "all()" ];
|
||||
# TODO:
|
||||
# * `pick` (https://github.com/jj-vcs/jj/issues/5446): [ "util" "exec" "--" "bash" "-c" "jj log -p -r \"diff_contains($1)\"" ]
|
||||
# * `root`: `jj workspace root` (barely necessary then)
|
||||
};
|
||||
|
||||
# FIXME: git equivalents
|
||||
# blame = {
|
||||
# coloring = "repeatedLines";
|
||||
# markIgnoredLines = true;
|
||||
# markUnblamables = true;
|
||||
# };
|
||||
# FIXME: log colors should probably match git
|
||||
# FIXME: patience diff?
|
||||
# FIXME: fetch prune/pruneTags?
|
||||
# FIXME: pull.rebase=true? Probably true TBH
|
||||
# FIXME: push.default=simple? Probably true TBH
|
||||
# FIXME: conflict style? ui.conflict-marker-style=git is diff3/zdiff3
|
||||
|
||||
# FIXME: from ma_9's config, plus my own stuff
|
||||
# snapshot = {
|
||||
# auto-track = "none()";
|
||||
# };
|
||||
#
|
||||
# ui = {
|
||||
# diff-editor = ":builtin"; # To silence hints
|
||||
# movement = {
|
||||
# edit = false;
|
||||
# };
|
||||
# };
|
||||
|
||||
templates = {
|
||||
# Equivalent to `commit.verbose = true` in Git
|
||||
draft_commit_description = "commit_description_verbose(self)";
|
||||
};
|
||||
|
||||
template-aliases = {
|
||||
"commit_description_verbose(commit)" = ''
|
||||
concat(
|
||||
commit_description(commit),
|
||||
"JJ: ignore-rest\n",
|
||||
diff.git(),
|
||||
)
|
||||
'';
|
||||
# FIXME: use `diff.summary()` instead? Supported by syntax highlighting
|
||||
# See https://github.com/jj-vcs/jj/issues/1946#issuecomment-2572986485
|
||||
# FIXME: tree-sitter grammar isn't in `nvim-treesitter` (https://github.com/kareigu/tree-sitter-jjdescription)
|
||||
"commit_description(commit)" = ''
|
||||
concat(
|
||||
commit.description(), "\n",
|
||||
"JJ: This commit contains the following changes:\n",
|
||||
indent("JJ: ", diff.stat(72)),
|
||||
)
|
||||
'';
|
||||
};
|
||||
|
||||
"--scope" = [
|
||||
# Multiple identities
|
||||
{
|
||||
"--when" = {
|
||||
repositories = [ "~/git/EPITA/" ];
|
||||
};
|
||||
user = {
|
||||
name = "Bruno BELANYI";
|
||||
email = mkMailAddress "bruno.belanyi" "epita.fr";
|
||||
};
|
||||
}
|
||||
{
|
||||
"--when" = {
|
||||
repositories = [ "~/git/work/" ];
|
||||
};
|
||||
user = {
|
||||
name = "Bruno BELANYI";
|
||||
email = mkMailAddress "ambroisie" "google.com";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# To drop in a `local.toml` configuration, not-versioned
|
||||
xdg.configFile = {
|
||||
"jj/conf.d/.keep".text = "";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -53,6 +53,10 @@ M.on_attach = function(client, bufnr)
|
|||
vim.diagnostic.open_float(nil, { scope = "buffer" })
|
||||
end
|
||||
|
||||
local function toggle_inlay_hints()
|
||||
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
|
||||
end
|
||||
|
||||
local keys = {
|
||||
buffer = bufnr,
|
||||
-- LSP navigation
|
||||
|
|
@ -67,6 +71,7 @@ M.on_attach = function(client, bufnr)
|
|||
{ "<leader>ca", vim.lsp.buf.code_action, desc = "Code actions" },
|
||||
{ "<leader>cd", cycle_diagnostics_display, desc = "Cycle diagnostics display" },
|
||||
{ "<leader>cD", show_buffer_diagnostics, desc = "Show buffer diagnostics" },
|
||||
{ "<leader>ch", toggle_inlay_hints, desc = "Toggle inlay hints" },
|
||||
{ "<leader>cr", vim.lsp.buf.rename, desc = "Rename symbol" },
|
||||
{ "<leader>cs", vim.lsp.buf.signature_help, desc = "Show signature" },
|
||||
{ "<leader>ct", vim.lsp.buf.type_definition, desc = "Go to type definition" },
|
||||
|
|
|
|||
|
|
@ -127,6 +127,7 @@ in
|
|||
{ class = "^Blueman-.*$"; }
|
||||
{ title = "^htop$"; }
|
||||
{ class = "^Thunderbird$"; instance = "Mailnews"; window_role = "filterlist"; }
|
||||
{ class = "^firefox$"; instance = "Places"; window_role = "Organizer"; }
|
||||
{ class = "^pavucontrol.*$"; }
|
||||
{ class = "^Arandr$"; }
|
||||
{ class = "^\\.blueman-manager-wrapped$"; }
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@ in
|
|||
my.home.udiskie.enable = true;
|
||||
# udiskie fails if it can't find this dbus service
|
||||
services.udisks2.enable = true;
|
||||
# Ensure i3lock can actually unlock the session
|
||||
security.pam.services.i3lock.enable = true;
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,27 +38,13 @@ in
|
|||
# Make it work with socket auth
|
||||
POSTGRES_URL_OVERRIDE = "postgresql://mealie:@/mealie?host=/run/postgresql";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services = {
|
||||
mealie = {
|
||||
after = [ "postgresql.service" ];
|
||||
requires = [ "postgresql.service" ];
|
||||
# Automatic PostgreSQL provisioning
|
||||
database = {
|
||||
createLocally = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Set-up database
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
ensureDatabases = [ "mealie" ];
|
||||
ensureUsers = [
|
||||
{
|
||||
name = "mealie";
|
||||
ensureDBOwnership = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
my.services.nginx.virtualHosts = {
|
||||
mealie = {
|
||||
inherit (cfg) port;
|
||||
|
|
|
|||
|
|
@ -44,11 +44,15 @@ in
|
|||
adminuser = cfg.admin;
|
||||
adminpassFile = cfg.passwordFile;
|
||||
dbtype = "pgsql";
|
||||
dbhost = "/run/postgresql";
|
||||
};
|
||||
|
||||
https = true;
|
||||
|
||||
# Automatic PostgreSQL provisioning
|
||||
database = {
|
||||
createLocally = true;
|
||||
};
|
||||
|
||||
settings = {
|
||||
overwriteprotocol = "https"; # Nginx only allows SSL
|
||||
};
|
||||
|
|
@ -60,22 +64,6 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
ensureDatabases = [ "nextcloud" ];
|
||||
ensureUsers = [
|
||||
{
|
||||
name = "nextcloud";
|
||||
ensureDBOwnership = true;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
systemd.services."nextcloud-setup" = {
|
||||
requires = [ "postgresql.service" ];
|
||||
after = [ "postgresql.service" ];
|
||||
};
|
||||
|
||||
# The service above configures the domain, no need for my wrapper
|
||||
services.nginx.virtualHosts."nextcloud.${config.networking.domain}" = {
|
||||
forceSSL = true;
|
||||
|
|
|
|||
|
|
@ -52,30 +52,28 @@ in
|
|||
|
||||
mediaDir = lib.mkIf (cfg.documentPath != null) cfg.documentPath;
|
||||
|
||||
settings =
|
||||
let
|
||||
paperlessDomain = "paperless.${config.networking.domain}";
|
||||
in
|
||||
{
|
||||
# Use SSO
|
||||
PAPERLESS_ENABLE_HTTP_REMOTE_USER = true;
|
||||
PAPERLESS_HTTP_REMOTE_USER_HEADER_NAME = "HTTP_X_USER";
|
||||
settings = {
|
||||
# Use SSO
|
||||
PAPERLESS_ENABLE_HTTP_REMOTE_USER = true;
|
||||
PAPERLESS_ENABLE_HTTP_REMOTE_USER_API = true;
|
||||
PAPERLESS_HTTP_REMOTE_USER_HEADER_NAME = "HTTP_X_USER";
|
||||
|
||||
# Security settings
|
||||
PAPERLESS_ALLOWED_HOSTS = paperlessDomain;
|
||||
PAPERLESS_CORS_ALLOWED_HOSTS = "https://${paperlessDomain}";
|
||||
# Security settings
|
||||
PAPERLESS_URL = "https://paperless.${config.networking.domain}";
|
||||
PAPERLESS_USE_X_FORWARD_HOST = true;
|
||||
PAPERLESS_PROXY_SSL_HEADER = [ "HTTP_X_FORWARDED_PROTO" "https" ];
|
||||
|
||||
# OCR settings
|
||||
PAPERLESS_OCR_LANGUAGE = "fra+eng";
|
||||
# OCR settings
|
||||
PAPERLESS_OCR_LANGUAGE = "fra+eng";
|
||||
|
||||
# Workers
|
||||
PAPERLESS_TASK_WORKERS = 3;
|
||||
PAPERLESS_THREADS_PER_WORKER = 4;
|
||||
# Workers
|
||||
PAPERLESS_TASK_WORKERS = 3;
|
||||
PAPERLESS_THREADS_PER_WORKER = 4;
|
||||
|
||||
# Misc
|
||||
PAPERLESS_TIME_ZONE = config.time.timeZone;
|
||||
PAPERLESS_ADMIN_USER = cfg.username;
|
||||
};
|
||||
# Misc
|
||||
PAPERLESS_TIME_ZONE = config.time.timeZone;
|
||||
PAPERLESS_ADMIN_USER = cfg.username;
|
||||
};
|
||||
|
||||
# Admin password
|
||||
passwordFile = cfg.passwordFile;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue