Compare commits
9 commits
main
...
tmux-under
| Author | SHA1 | Date | |
|---|---|---|---|
| 2e1f408dbf | |||
| 82cd41cc54 | |||
| 4460f095a5 | |||
| 5492365d0a | |||
| 0a927c5cc0 | |||
| 5e5f63eb26 | |||
| 8b028ce19f | |||
| d4668416af | |||
| 88b943076d |
68 changed files with 535 additions and 616 deletions
72
flake.lock
generated
72
flake.lock
generated
|
|
@ -14,11 +14,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1770165109,
|
"lastModified": 1754433428,
|
||||||
"narHash": "sha256-9VnK6Oqai65puVJ4WYtCTvlJeXxMzAp/69HhQuTdl/I=",
|
"narHash": "sha256-NA/FT2hVhKDftbHSwVnoRTFhes62+7dxZbxj5Gxvghs=",
|
||||||
"owner": "ryantm",
|
"owner": "ryantm",
|
||||||
"repo": "agenix",
|
"repo": "agenix",
|
||||||
"rev": "b027ee29d959fda4b60b57566d64c98a202e0feb",
|
"rev": "9edb1787864c4f59ae5074ad498b6272b3ec308d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -53,15 +53,15 @@
|
||||||
"flake-compat": {
|
"flake-compat": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1767039857,
|
"lastModified": 1747046372,
|
||||||
"narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
|
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
|
||||||
"owner": "NixOS",
|
"owner": "edolstra",
|
||||||
"repo": "flake-compat",
|
"repo": "flake-compat",
|
||||||
"rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
|
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "edolstra",
|
||||||
"repo": "flake-compat",
|
"repo": "flake-compat",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
|
@ -73,11 +73,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1775087534,
|
"lastModified": 1756770412,
|
||||||
"narHash": "sha256-91qqW8lhL7TLwgQWijoGBbiD4t7/q75KTi8NxjVmSmA=",
|
"narHash": "sha256-+uWLQZccFHwqpGqr2Yt5VsW/PbeJVTn9Dk6SHWhNRPw=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-parts",
|
"repo": "flake-parts",
|
||||||
"rev": "3107b77cd68437b9a76194f0f7f9c55f2329ca5b",
|
"rev": "4524271976b625a4a605beefd893f270620fd751",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -117,11 +117,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1775585728,
|
"lastModified": 1755960406,
|
||||||
"narHash": "sha256-8Psjt+TWvE4thRKktJsXfR6PA/fWWsZ04DVaY6PUhr4=",
|
"narHash": "sha256-RF7j6C1TmSTK9tYWO6CdEMtg6XZaUKcvZwOCD2SICZs=",
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "git-hooks.nix",
|
"repo": "git-hooks.nix",
|
||||||
"rev": "580633fa3fe5fc0379905986543fd7495481913d",
|
"rev": "e891a93b193fcaf2fc8012d890dc7f0befe86ec2",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -159,11 +159,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1775622785,
|
"lastModified": 1756954499,
|
||||||
"narHash": "sha256-/yFxO+7oS1SymDfJ2iVO7K5vJKcYfe9XGIJ+quLqz0Q=",
|
"narHash": "sha256-Pg4xBHzvzNY8l9x/rLWoJMnIR8ebG+xeU+IyqThIkqU=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "527e47b78fe67213072f706bf933a9705a8c4974",
|
"rev": "ed1a98c375450dfccf427adacd2bfd1a7b22eb25",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -175,11 +175,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1775423009,
|
"lastModified": 1756936398,
|
||||||
"narHash": "sha256-vPKLpjhIVWdDrfiUM8atW6YkIggCEKdSAlJPzzhkQlw=",
|
"narHash": "sha256-/o1TTpMIICpjrMHBilL9lYm/r69uhdK1L8j1pfY6tWU=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "68d8aa3d661f0e6bd5862291b5bb263b2a6595c9",
|
"rev": "47f28ad9378956563df9a884fd1b209b64336ba3",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -196,19 +196,20 @@
|
||||||
],
|
],
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
],
|
||||||
|
"treefmt-nix": "treefmt-nix"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1775654726,
|
"lastModified": 1753980880,
|
||||||
"narHash": "sha256-4R6Bc5EIQ+HxVte1Mo1B3OkyYFVmehywOPiH3Z9CAIU=",
|
"narHash": "sha256-aj1pbYxL6N+XFqBHjB4B1QP0bnKRcg1AfpgT5zUFsW8=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "NUR",
|
"repo": "NUR",
|
||||||
"rev": "c73a8885bd1bb5d329e16a4512e2c2708c5981a7",
|
"rev": "16db3e61da7606984a05b4dfc33cd1d26d22fb22",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"ref": "main",
|
"ref": "master",
|
||||||
"repo": "NUR",
|
"repo": "NUR",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
|
@ -240,6 +241,27 @@
|
||||||
"repo": "default",
|
"repo": "default",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"treefmt-nix": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nur",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1733222881,
|
||||||
|
"narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "treefmt-nix",
|
||||||
|
"rev": "49717b5af6f80172275d47a418c9719a31a78b53",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "treefmt-nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@
|
||||||
type = "github";
|
type = "github";
|
||||||
owner = "nix-community";
|
owner = "nix-community";
|
||||||
repo = "NUR";
|
repo = "NUR";
|
||||||
ref = "main";
|
ref = "master";
|
||||||
inputs = {
|
inputs = {
|
||||||
flake-parts.follows = "flake-parts";
|
flake-parts.follows = "flake-parts";
|
||||||
nixpkgs.follows = "nixpkgs";
|
nixpkgs.follows = "nixpkgs";
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,6 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
nixf-diagnose = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
nixpkgs-fmt = {
|
nixpkgs-fmt = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{ self, lib, ... }:
|
{ self, ... }:
|
||||||
let
|
let
|
||||||
default-overlays = import "${self}/overlays";
|
default-overlays = import "${self}/overlays";
|
||||||
|
|
||||||
|
|
@ -8,7 +8,7 @@ let
|
||||||
|
|
||||||
# Expose my custom packages
|
# Expose my custom packages
|
||||||
pkgs = _final: prev: {
|
pkgs = _final: prev: {
|
||||||
ambroisie = lib.recurseIntoAttrs (import "${self}/pkgs" { pkgs = prev; });
|
ambroisie = prev.recurseIntoAttrs (import "${self}/pkgs" { pkgs = prev; });
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,8 @@
|
||||||
terminalFeatures = {
|
terminalFeatures = {
|
||||||
# HTerm uses `xterm-256color` as its `$TERM`, so use that here
|
# HTerm uses `xterm-256color` as its `$TERM`, so use that here
|
||||||
xterm-256color = { };
|
xterm-256color = { };
|
||||||
|
# Terminal app uses `xterm.js`, not HTerm
|
||||||
|
"xterm.js" = { };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,8 @@
|
||||||
terminalFeatures = {
|
terminalFeatures = {
|
||||||
# HTerm uses `xterm-256color` as its `$TERM`, so use that here
|
# HTerm uses `xterm-256color` as its `$TERM`, so use that here
|
||||||
xterm-256color = { };
|
xterm-256color = { };
|
||||||
|
# Terminal app uses `xterm.js`, not HTerm
|
||||||
|
"xterm.js" = { };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
# Network-Manager applet
|
# Network-Manager applet
|
||||||
nm-applet.enable = true;
|
nm-applet.enable = true;
|
||||||
# Terminal
|
# Terminal
|
||||||
terminal.program = "alacritty";
|
terminal.default = "alacritty";
|
||||||
# Transmission remote
|
# Transmission remote
|
||||||
trgui.enable = true;
|
trgui.enable = true;
|
||||||
# Zathura document viewer
|
# Zathura document viewer
|
||||||
|
|
|
||||||
7
hosts/nixos/porthos/secrets/pyload/credentials.age
Normal file
7
hosts/nixos/porthos/secrets/pyload/credentials.age
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
age-encryption.org/v1
|
||||||
|
-> ssh-ed25519 cKojmg nJbOfp0/wmFOZLzcWjoGB7wEB8e56aO1NntSmn5KomU
|
||||||
|
/Vio4Z/t7IPJrdzdwUPidVH3wrouSkwRzNHP0T4z3x0
|
||||||
|
-> ssh-ed25519 jPowng QXg/xqs7/VfkYQg3X77w4i53q64bL9oYeTxqb9NVhiQ
|
||||||
|
sMHIXlmrIxtIr+s0X4lBqev/PPd3AKD5P7AP5K4NeJg
|
||||||
|
--- gzTn+6+aa4Ptic1lsvSt+r3IEBysHrvMMIyONogMDF0
|
||||||
|
<EFBFBD>ÏÂ<EFBFBD>Ë®UE_í</¯çQ·Ü+U“AГMÄÿ/kï×dAL/”úÕįÍoæ\XïEDÇÑfã\ièÄ‘½àpF„`#¬n4è–x1î<31>ûÞèDëàÂË5CéЦ&fòB»q${Gg…Aqˆ³@üVu!Cc…R\ªÖ¨
|
||||||
|
|
@ -78,12 +78,23 @@ in
|
||||||
|
|
||||||
"podgrab/password.age".publicKeys = all;
|
"podgrab/password.age".publicKeys = all;
|
||||||
|
|
||||||
|
"pyload/credentials.age".publicKeys = all;
|
||||||
|
|
||||||
"servarr/autobrr/session-secret.age".publicKeys = all;
|
"servarr/autobrr/session-secret.age".publicKeys = all;
|
||||||
"servarr/cross-seed/configuration.json.age".publicKeys = all;
|
"servarr/cross-seed/configuration.json.age".publicKeys = all;
|
||||||
|
|
||||||
"sso/auth-key.age".publicKeys = all;
|
"sso/auth-key.age" = {
|
||||||
"sso/ambroisie/password-hash.age".publicKeys = all;
|
owner = "nginx-sso";
|
||||||
"sso/ambroisie/totp-secret.age".publicKeys = all;
|
publicKeys = all;
|
||||||
|
};
|
||||||
|
"sso/ambroisie/password-hash.age" = {
|
||||||
|
owner = "nginx-sso";
|
||||||
|
publicKeys = all;
|
||||||
|
};
|
||||||
|
"sso/ambroisie/totp-secret.age" = {
|
||||||
|
owner = "nginx-sso";
|
||||||
|
publicKeys = all;
|
||||||
|
};
|
||||||
|
|
||||||
"tandoor-recipes/secret-key.age".publicKeys = all;
|
"tandoor-recipes/secret-key.age".publicKeys = all;
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -134,6 +134,10 @@ in
|
||||||
};
|
};
|
||||||
# Regular backups
|
# Regular backups
|
||||||
postgresql-backup.enable = true;
|
postgresql-backup.enable = true;
|
||||||
|
pyload = {
|
||||||
|
enable = true;
|
||||||
|
credentialsFile = secrets."pyload/credentials".path;
|
||||||
|
};
|
||||||
# RSS provider for websites that do not provide any feeds
|
# RSS provider for websites that do not provide any feeds
|
||||||
rss-bridge.enable = true;
|
rss-bridge.enable = true;
|
||||||
# Usenet client
|
# Usenet client
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,8 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
programs.calibre = {
|
home.packages = with pkgs; [
|
||||||
enable = true;
|
cfg.package
|
||||||
|
];
|
||||||
inherit (cfg) package;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,8 @@
|
||||||
./zsh
|
./zsh
|
||||||
];
|
];
|
||||||
|
|
||||||
home.stateVersion = "26.05";
|
# First sane reproducible version
|
||||||
|
home.stateVersion = "20.09";
|
||||||
|
|
||||||
# Start services automatically
|
# Start services automatically
|
||||||
systemd.user.startServices = "sd-switch";
|
systemd.user.startServices = "sd-switch";
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.my.home.delta;
|
cfg = config.my.home.delta;
|
||||||
|
|
||||||
|
configFormat = pkgs.formats.gitIni { };
|
||||||
|
configPath = "${config.xdg.configHome}/delta/config";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.my.home.delta = with lib; {
|
options.my.home.delta = with lib; {
|
||||||
|
|
@ -14,14 +17,28 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
programs.delta = {
|
assertions = [
|
||||||
enable = true;
|
{
|
||||||
|
# For its configuration
|
||||||
|
assertion = cfg.enable -> cfg.git.enable;
|
||||||
|
message = ''
|
||||||
|
`config.my.home.delta` must enable `config.my.home.delta.git` to be
|
||||||
|
properly configured.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
{
|
||||||
|
assertion = cfg.enable -> config.programs.git.enable;
|
||||||
|
message = ''
|
||||||
|
`config.my.home.delta` relies on `config.programs.git` to be
|
||||||
|
enabled.
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
inherit (cfg) package;
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
enableGitIntegration = cfg.git.enable;
|
xdg.configFile."delta/config".source = configFormat.generate "delta-config" {
|
||||||
|
delta = {
|
||||||
options = {
|
|
||||||
features = "diff-highlight decorations";
|
features = "diff-highlight decorations";
|
||||||
|
|
||||||
# Less jarring style for `diff-highlight` emulation
|
# Less jarring style for `diff-highlight` emulation
|
||||||
|
|
@ -45,5 +62,18 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
programs.git = lib.mkIf cfg.git.enable {
|
||||||
|
delta = {
|
||||||
|
enable = true;
|
||||||
|
inherit (cfg) package;
|
||||||
|
};
|
||||||
|
|
||||||
|
includes = [
|
||||||
|
{
|
||||||
|
path = configPath;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.my.home.discord;
|
cfg = config.my.home.discord;
|
||||||
|
|
||||||
|
jsonFormat = pkgs.formats.json { };
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.my.home.discord = with lib; {
|
options.my.home.discord = with lib; {
|
||||||
|
|
@ -10,15 +12,14 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
programs.discord = {
|
home.packages = with pkgs; [
|
||||||
enable = true;
|
cfg.package
|
||||||
|
];
|
||||||
|
|
||||||
inherit (cfg) package;
|
xdg.configFile."discord/settings.json".source =
|
||||||
|
jsonFormat.generate "discord.json" {
|
||||||
settings = {
|
|
||||||
# Do not keep me from using the app just to force an update
|
# Do not keep me from using the app just to force an update
|
||||||
SKIP_HOST_UPDATE = true;
|
SKIP_HOST_UPDATE = true;
|
||||||
};
|
};
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,6 @@ in
|
||||||
"browser.newtabpage.activity-stream.feeds.sections" = false;
|
"browser.newtabpage.activity-stream.feeds.sections" = false;
|
||||||
"browser.newtabpage.activity-stream.feeds.system.topstories" = false; # Disable top stories
|
"browser.newtabpage.activity-stream.feeds.system.topstories" = false; # Disable top stories
|
||||||
"browser.newtabpage.activity-stream.section.highlights.includePocket" = false; # Disable pocket
|
"browser.newtabpage.activity-stream.section.highlights.includePocket" = false; # Disable pocket
|
||||||
"browser.urlbar.trimURLs" = false; # Always show the `http://` prefix
|
|
||||||
"extensions.pocket.enabled" = false; # Disable pocket
|
"extensions.pocket.enabled" = false; # Disable pocket
|
||||||
"media.eme.enabled" = true; # Enable DRM
|
"media.eme.enabled" = true; # Enable DRM
|
||||||
"media.gmp-widevinecdm.enabled" = true; # Enable DRM
|
"media.gmp-widevinecdm.enabled" = true; # Enable DRM
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
let
|
let
|
||||||
cfg = config.my.home.firefox.tridactyl;
|
cfg = config.my.home.firefox.tridactyl;
|
||||||
|
|
||||||
term = config.my.home.terminal.program;
|
term = config.my.home.terminal.default;
|
||||||
|
|
||||||
vimCommandLine = {
|
vimCommandLine = {
|
||||||
alacritty = ''-e "vim" "%f" "+normal!%lGzv%c|"'';
|
alacritty = ''-e "vim" "%f" "+normal!%lGzv%c|"'';
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ in
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable (lib.mkMerge [
|
config = lib.mkIf cfg.enable (lib.mkMerge [
|
||||||
{
|
{
|
||||||
home.packages = [
|
home.packages = with pkgs; [
|
||||||
cfg.package
|
cfg.package
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
*.out
|
*.out
|
||||||
|
|
||||||
# Python files
|
# Python files
|
||||||
.venv/
|
env/
|
||||||
__pycache__/
|
__pycache__/
|
||||||
*.py[cod]
|
*.py[cod]
|
||||||
.mypy_cache/
|
.mypy_cache/
|
||||||
|
|
|
||||||
|
|
@ -21,31 +21,29 @@ in
|
||||||
config.programs.git = lib.mkIf cfg.enable {
|
config.programs.git = lib.mkIf cfg.enable {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
# Who am I?
|
||||||
|
userEmail = mkMailAddress "bruno" "belanyi.fr";
|
||||||
|
userName = "Bruno BELANYI";
|
||||||
|
|
||||||
inherit (cfg) package;
|
inherit (cfg) package;
|
||||||
|
|
||||||
|
aliases = {
|
||||||
|
git = "!git";
|
||||||
|
lol = "log --graph --decorate --pretty=oneline --abbrev-commit --topo-order";
|
||||||
|
lola = "lol --all";
|
||||||
|
assume = "update-index --assume-unchanged";
|
||||||
|
unassume = "update-index --no-assume-unchanged";
|
||||||
|
assumed = "!git ls-files -v | grep ^h | cut -c 3-";
|
||||||
|
pick = "log -p -G";
|
||||||
|
push-new = "!git push -u origin "
|
||||||
|
+ ''"$(git branch | grep '^* ' | cut -f2- -d' ')"'';
|
||||||
|
root = "git rev-parse --show-toplevel";
|
||||||
|
};
|
||||||
|
|
||||||
lfs.enable = true;
|
lfs.enable = true;
|
||||||
|
|
||||||
# There's more
|
# There's more
|
||||||
settings = {
|
extraConfig = {
|
||||||
# Who am I?
|
|
||||||
user = {
|
|
||||||
email = mkMailAddress "bruno" "belanyi.fr";
|
|
||||||
name = "Bruno BELANYI";
|
|
||||||
};
|
|
||||||
|
|
||||||
alias = {
|
|
||||||
git = "!git";
|
|
||||||
lol = "log --graph --decorate --pretty=oneline --abbrev-commit --topo-order";
|
|
||||||
lola = "lol --all";
|
|
||||||
assume = "update-index --assume-unchanged";
|
|
||||||
unassume = "update-index --no-assume-unchanged";
|
|
||||||
assumed = "!git ls-files -v | grep ^h | cut -c 3-";
|
|
||||||
pick = "log -p -G";
|
|
||||||
push-new = "!git push -u origin "
|
|
||||||
+ ''"$(git branch | grep '^* ' | cut -f2- -d' ')"'';
|
|
||||||
root = "git rev-parse --show-toplevel";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Makes it a bit more readable
|
# Makes it a bit more readable
|
||||||
blame = {
|
blame = {
|
||||||
coloring = "repeatedLines";
|
coloring = "repeatedLines";
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ let
|
||||||
lib.mkDefault [ (lib.getExe pkgs.ambroisie.rbw-pass) "Mail" passName ];
|
lib.mkDefault [ (lib.getExe pkgs.ambroisie.rbw-pass) "Mail" passName ];
|
||||||
|
|
||||||
address = mkMailAddress address domain;
|
address = mkMailAddress address domain;
|
||||||
aliases = map (lib.flip mkMailAddress domain) aliases;
|
aliases = builtins.map (lib.flip mkMailAddress domain) aliases;
|
||||||
|
|
||||||
inherit primary;
|
inherit primary;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ in
|
||||||
|
|
||||||
scripts = [
|
scripts = [
|
||||||
pkgs.mpvScripts.mpris # Allow controlling using media keys
|
pkgs.mpvScripts.mpris # Allow controlling using media keys
|
||||||
pkgs.mpvScripts.mpv-cheatsheet-ng # Show some simple mappings on '?'
|
pkgs.mpvScripts.mpv-cheatsheet # Show some simple mappings on '?'
|
||||||
pkgs.mpvScripts.uosc # Nicer UI
|
pkgs.mpvScripts.uosc # Nicer UI
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,16 @@
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.my.home.terminal;
|
cfg = config.my.home.terminal.alacritty;
|
||||||
|
inherit (config.my.home.terminal) colors;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config = lib.mkIf (cfg.program == "alacritty") {
|
options.my.home.terminal.alacritty = with lib; {
|
||||||
|
enable = lib.mkEnableOption "alacritty" // {
|
||||||
|
default = config.my.home.terminal.default == "alacritty";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
programs.alacritty = {
|
programs.alacritty = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
|
@ -14,36 +21,36 @@ in
|
||||||
|
|
||||||
colors = {
|
colors = {
|
||||||
primary = {
|
primary = {
|
||||||
background = cfg.colors.background;
|
background = colors.background;
|
||||||
foreground = cfg.colors.foreground;
|
foreground = colors.foreground;
|
||||||
|
|
||||||
bright_foreground = cfg.colors.foregroundBold;
|
bright_foreground = colors.foregroundBold;
|
||||||
};
|
};
|
||||||
|
|
||||||
cursor = {
|
cursor = {
|
||||||
cursor = cfg.colors.cursor;
|
cursor = colors.cursor;
|
||||||
};
|
};
|
||||||
|
|
||||||
normal = {
|
normal = {
|
||||||
black = cfg.colors.black;
|
black = colors.black;
|
||||||
red = cfg.colors.red;
|
red = colors.red;
|
||||||
green = cfg.colors.green;
|
green = colors.green;
|
||||||
yellow = cfg.colors.yellow;
|
yellow = colors.yellow;
|
||||||
blue = cfg.colors.blue;
|
blue = colors.blue;
|
||||||
magenta = cfg.colors.magenta;
|
magenta = colors.magenta;
|
||||||
cyan = cfg.colors.cyan;
|
cyan = colors.cyan;
|
||||||
white = cfg.colors.white;
|
white = colors.white;
|
||||||
};
|
};
|
||||||
|
|
||||||
bright = {
|
bright = {
|
||||||
black = cfg.colors.blackBold;
|
black = colors.blackBold;
|
||||||
red = cfg.colors.redBold;
|
red = colors.redBold;
|
||||||
green = cfg.colors.greenBold;
|
green = colors.greenBold;
|
||||||
yellow = cfg.colors.yellowBold;
|
yellow = colors.yellowBold;
|
||||||
blue = cfg.colors.blueBold;
|
blue = colors.blueBold;
|
||||||
magenta = cfg.colors.magentaBold;
|
magenta = colors.magentaBold;
|
||||||
cyan = cfg.colors.cyanBold;
|
cyan = colors.cyanBold;
|
||||||
white = cfg.colors.whiteBold;
|
white = colors.whiteBold;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -16,11 +16,11 @@ in
|
||||||
|
|
||||||
options.my.home = with lib; {
|
options.my.home = with lib; {
|
||||||
terminal = {
|
terminal = {
|
||||||
program = mkOption {
|
default = mkOption {
|
||||||
type = with types; nullOr (enum [ "alacritty" "termite" ]);
|
type = with types; nullOr (enum [ "alacritty" "termite" ]);
|
||||||
default = null;
|
default = null;
|
||||||
example = "termite";
|
example = "termite";
|
||||||
description = "Which terminal to use for home session";
|
description = "Which default terminal to use for home session";
|
||||||
};
|
};
|
||||||
|
|
||||||
colors = {
|
colors = {
|
||||||
|
|
@ -56,7 +56,7 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config.home.sessionVariables = lib.mkIf (cfg.program != null) {
|
config.home.sessionVariables = lib.mkIf (cfg.default != null) {
|
||||||
TERMINAL = cfg.program;
|
TERMINAL = cfg.default;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,16 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.my.home.terminal;
|
cfg = config.my.home.terminal.termite;
|
||||||
|
inherit (config.my.home.terminal) colors;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
config = lib.mkIf (cfg.program == "termite") {
|
options.my.home.terminal.termite = with lib; {
|
||||||
|
enable = lib.mkEnableOption "termite" // {
|
||||||
|
default = config.my.home.terminal.default == "termite";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
programs.termite = {
|
programs.termite = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
|
@ -24,11 +31,11 @@ in
|
||||||
|
|
||||||
|
|
||||||
# Colors
|
# Colors
|
||||||
backgroundColor = cfg.colors.background;
|
backgroundColor = colors.background;
|
||||||
cursorColor = cfg.colors.cursor;
|
cursorColor = colors.cursor;
|
||||||
foregroundColor = cfg.colors.foreground;
|
foregroundColor = colors.foreground;
|
||||||
foregroundBoldColor = cfg.colors.foregroundBold;
|
foregroundBoldColor = colors.foregroundBold;
|
||||||
colorsExtra = with cfg.colors; ''
|
colorsExtra = with colors; ''
|
||||||
# Normal colors
|
# Normal colors
|
||||||
color0 = ${black}
|
color0 = ${black}
|
||||||
color1 = ${red}
|
color1 = ${red}
|
||||||
|
|
|
||||||
|
|
@ -6,13 +6,16 @@ let
|
||||||
(config.my.home.wm.windowManager != null)
|
(config.my.home.wm.windowManager != null)
|
||||||
];
|
];
|
||||||
|
|
||||||
mkTerminalFeature = opt: flag:
|
mkTerminalFlag = tmuxVar: opt: flag:
|
||||||
let
|
let
|
||||||
mkFlag = term: ''set -as terminal-features ",${term}:${flag}"'';
|
mkFlag = term: ''set -as ${tmuxVar} ",${term}:${flag}"'';
|
||||||
enabledTerminals = lib.filterAttrs (_: v: v.${opt}) cfg.terminalFeatures;
|
enabledTerminals = lib.filterAttrs (_: v: v.${opt}) cfg.terminalFeatures;
|
||||||
terminals = lib.attrNames enabledTerminals;
|
terminals = lib.attrNames enabledTerminals;
|
||||||
in
|
in
|
||||||
lib.concatMapStringsSep "\n" mkFlag terminals;
|
lib.concatMapStringsSep "\n" mkFlag terminals;
|
||||||
|
|
||||||
|
mkTerminalFeature = mkTerminalFlag "terminal-features";
|
||||||
|
mkTerminalOverride = mkTerminalFlag "terminal-overrides";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.my.home.tmux = with lib; {
|
options.my.home.tmux = with lib; {
|
||||||
|
|
@ -28,12 +31,14 @@ in
|
||||||
hyperlinks = my.mkDisableOption "hyperlinks through OSC8";
|
hyperlinks = my.mkDisableOption "hyperlinks through OSC8";
|
||||||
|
|
||||||
trueColor = my.mkDisableOption "24-bit (RGB) color support";
|
trueColor = my.mkDisableOption "24-bit (RGB) color support";
|
||||||
|
|
||||||
|
underscoreStyle = my.mkDisableOption "underscore style/color support";
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
default = { ${config.my.home.terminal.program} = { }; };
|
default = { ${config.my.home.terminal.default} = { }; };
|
||||||
defaultText = literalExpression ''
|
defaultText = literalExpression ''
|
||||||
{ ''${config.my.home.terminal.program} = { }; };
|
{ ''${config.my.home.terminal.default} = { }; };
|
||||||
'';
|
'';
|
||||||
example = { xterm-256color = { }; };
|
example = { xterm-256color = { }; };
|
||||||
description = ''
|
description = ''
|
||||||
|
|
@ -54,6 +59,20 @@ in
|
||||||
terminal = "tmux-256color"; # I want accurate termcap info
|
terminal = "tmux-256color"; # I want accurate termcap info
|
||||||
aggressiveResize = true; # Automatic resize when switching client size
|
aggressiveResize = true; # Automatic resize when switching client size
|
||||||
|
|
||||||
|
# FIXME
|
||||||
|
# * Sixel support
|
||||||
|
# * OSC 133 prompt integration
|
||||||
|
# FIXME: when sensible-on-top is disabled: check if any of those are unset
|
||||||
|
# * tmux bind-key $prefix_without_ctrl last-window
|
||||||
|
# *
|
||||||
|
# * tmux bind-key C-b send-prefix: included
|
||||||
|
# * aggressive resize? done
|
||||||
|
# * tmux bind-key C-p previous-window: done
|
||||||
|
# * tmux bind-key C-n next-window: done
|
||||||
|
# * C-r to refresh my config: done
|
||||||
|
# * tmux set-option -g focus-events on: done
|
||||||
|
|
||||||
|
# FIXME: make PRs for `bind-key` description
|
||||||
plugins = with pkgs.tmuxPlugins; builtins.filter (attr: attr != { }) [
|
plugins = with pkgs.tmuxPlugins; builtins.filter (attr: attr != { }) [
|
||||||
# Open high-lighted files in copy mode
|
# Open high-lighted files in copy mode
|
||||||
open
|
open
|
||||||
|
|
@ -126,6 +145,11 @@ in
|
||||||
${mkTerminalFeature "hyperlinks" "hyperlinks"}
|
${mkTerminalFeature "hyperlinks" "hyperlinks"}
|
||||||
# Force 24-bit color for each relevant $TERM
|
# Force 24-bit color for each relevant $TERM
|
||||||
${mkTerminalFeature "trueColor" "RGB"}
|
${mkTerminalFeature "trueColor" "RGB"}
|
||||||
|
# Force underscore style/color for each relevant $TERM
|
||||||
|
${mkTerminalFeature "underscoreStyle" "usstyle"}
|
||||||
|
# FIXME: see https://github.com/folke/tokyonight.nvim#fix-undercurls-in-tmux for additional overrides
|
||||||
|
# ${mkTerminalOverride "underscoreStyle" "Smulx=\\E[4::%p1%dm"}
|
||||||
|
# ${mkTerminalOverride "underscoreStyle" "Setulc=\\E[58::2::::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m"}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
home.packages = [
|
home.packages = with pkgs; [
|
||||||
cfg.package
|
cfg.package
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ local keys = {
|
||||||
|
|
||||||
-- Disable option
|
-- Disable option
|
||||||
{ "]o", group = "Disable option" },
|
{ "]o", group = "Disable option" },
|
||||||
{ "]ob", desc = "Dark background" },
|
{ "]ob", desc = "Light background" },
|
||||||
{ "]oc", desc = "Cursor line" },
|
{ "]oc", desc = "Cursor line" },
|
||||||
{ "]od", desc = "Diff" },
|
{ "]od", desc = "Diff" },
|
||||||
{ "]of", "<cmd>FormatDisable<CR>", desc = "LSP Formatting" },
|
{ "]of", "<cmd>FormatDisable<CR>", desc = "LSP Formatting" },
|
||||||
|
|
@ -101,7 +101,7 @@ local keys = {
|
||||||
|
|
||||||
-- Toggle option
|
-- Toggle option
|
||||||
{ "yo", group = "Toggle option" },
|
{ "yo", group = "Toggle option" },
|
||||||
{ "yob", desc = "Toggle background" },
|
{ "yob", desc = "Light background" },
|
||||||
{ "yoc", desc = "Cursor line" },
|
{ "yoc", desc = "Cursor line" },
|
||||||
{ "yod", desc = "Diff" },
|
{ "yod", desc = "Diff" },
|
||||||
{ "yof", "<cmd>FormatToggle<CR>", desc = "LSP Formatting" },
|
{ "yof", "<cmd>FormatToggle<CR>", desc = "LSP Formatting" },
|
||||||
|
|
|
||||||
7
modules/home/vim/ftdetect/glsl.lua
Normal file
7
modules/home/vim/ftdetect/glsl.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
-- Use GLSL filetype for common shader file extensions
|
||||||
|
vim.filetype.add({
|
||||||
|
extension = {
|
||||||
|
frag = "glsl",
|
||||||
|
vert = "glsl",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
@ -81,6 +81,9 @@ set updatetime=250
|
||||||
" Disable all mouse integrations
|
" Disable all mouse integrations
|
||||||
set mouse=
|
set mouse=
|
||||||
|
|
||||||
|
" Set dark mode by default
|
||||||
|
set background=dark
|
||||||
|
|
||||||
" Setup some overrides for gruvbox
|
" Setup some overrides for gruvbox
|
||||||
lua << EOF
|
lua << EOF
|
||||||
local gruvbox = require("gruvbox")
|
local gruvbox = require("gruvbox")
|
||||||
|
|
@ -112,7 +115,7 @@ colorscheme gruvbox
|
||||||
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||||
" Enable search high-lighting while the search is on-going
|
" Enable search high-lighting while the search is on-going
|
||||||
set hlsearch
|
set hlsearch
|
||||||
" Ignore case on search unless \C is in search terms
|
" Ignore case on search
|
||||||
set ignorecase
|
set ignorecase
|
||||||
" Ignore case unless there is an uppercase letter in the pattern
|
" Ignore case unless there is an uppercase letter in the pattern
|
||||||
set smartcase
|
set smartcase
|
||||||
|
|
|
||||||
|
|
@ -85,18 +85,4 @@ M.on_attach = function(client, bufnr)
|
||||||
wk.add(keys)
|
wk.add(keys)
|
||||||
end
|
end
|
||||||
|
|
||||||
--- list all active LSP clients for specific buffer, or all buffers
|
|
||||||
--- @param bufnr int? buffer number
|
|
||||||
--- @return table all active LSP client names
|
|
||||||
M.list_clients = function(bufnr)
|
|
||||||
local clients = vim.lsp.get_clients({ bufnr = bufnr })
|
|
||||||
local names = {}
|
|
||||||
|
|
||||||
for _, client in ipairs(clients) do
|
|
||||||
table.insert(names, client.name)
|
|
||||||
end
|
|
||||||
|
|
||||||
return names
|
|
||||||
end
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,15 @@ M.is_executable = function(cmd)
|
||||||
return cmd and vim.fn.executable(cmd) == 1
|
return cmd and vim.fn.executable(cmd) == 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- return a function that checks if a given command is executable
|
||||||
|
--- @param cmd string? command to check
|
||||||
|
--- @return fun(): boolean executable
|
||||||
|
M.is_executable_condition = function(cmd)
|
||||||
|
return function()
|
||||||
|
return M.is_executable(cmd)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
--- whether or not we are currently in an SSH connection
|
--- whether or not we are currently in an SSH connection
|
||||||
--- @return boolean ssh connection
|
--- @return boolean ssh connection
|
||||||
M.is_ssh = function()
|
M.is_ssh = function()
|
||||||
|
|
@ -25,6 +34,20 @@ M.is_ssh = function()
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- list all active LSP clients for specific buffer, or all buffers
|
||||||
|
--- @param bufnr int? buffer number
|
||||||
|
--- @return table all active LSP client names
|
||||||
|
M.list_lsp_clients = function(bufnr)
|
||||||
|
local clients = vim.lsp.get_clients({ bufnr = bufnr })
|
||||||
|
local names = {}
|
||||||
|
|
||||||
|
for _, client in ipairs(clients) do
|
||||||
|
table.insert(names, client.name)
|
||||||
|
end
|
||||||
|
|
||||||
|
return names
|
||||||
|
end
|
||||||
|
|
||||||
--- partially apply a function with given arguments
|
--- partially apply a function with given arguments
|
||||||
M.partial = function(f, ...)
|
M.partial = function(f, ...)
|
||||||
local a = { ... }
|
local a = { ... }
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
-- Show lines numbers
|
-- Show lines numbers
|
||||||
vim.opt.number = true
|
vim.opt.number = true
|
||||||
|
|
||||||
local numbertoggle = vim.api.nvim_create_augroup("ambroisie.numbertoggle", { clear = true })
|
local numbertoggle = vim.api.nvim_create_augroup("numbertoggle", { clear = true })
|
||||||
|
|
||||||
-- Toggle numbers between relative and absolute when changing buffers
|
-- Toggle numbers between relative and absolute when changing buffers
|
||||||
vim.api.nvim_create_autocmd({ "BufEnter", "FocusGained", "InsertLeave", "WinEnter" }, {
|
vim.api.nvim_create_autocmd({ "BufEnter", "FocusGained", "InsertLeave", "WinEnter" }, {
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,10 @@ gitsigns.setup({
|
||||||
})
|
})
|
||||||
|
|
||||||
local keys = {
|
local keys = {
|
||||||
|
-- Navigation
|
||||||
|
{ "[c", utils.partial(nav_hunk, "prev"), desc = "Previous hunk/diff" },
|
||||||
|
{ "]c", utils.partial(nav_hunk, "next"), desc = "Next hunk/diff" },
|
||||||
|
-- Commands
|
||||||
{ "<leader>g", group = "Git" },
|
{ "<leader>g", group = "Git" },
|
||||||
{ "<leader>gb", gitsigns.toggle_current_line_blame, desc = "Toggle blame virtual text" },
|
{ "<leader>gb", gitsigns.toggle_current_line_blame, desc = "Toggle blame virtual text" },
|
||||||
{ "<leader>gd", gitsigns.diffthis, desc = "Diff buffer" },
|
{ "<leader>gd", gitsigns.diffthis, desc = "Diff buffer" },
|
||||||
|
|
@ -51,20 +55,14 @@ local keys = {
|
||||||
{ "<leader>g]", utils.partial(gitsigns.nav_hunk, "next"), desc = "Next hunk" },
|
{ "<leader>g]", utils.partial(gitsigns.nav_hunk, "next"), desc = "Next hunk" },
|
||||||
}
|
}
|
||||||
|
|
||||||
local moves = {
|
|
||||||
mode = { "n", "x", "o" },
|
|
||||||
{ "[c", utils.partial(nav_hunk, "prev"), desc = "Previous hunk/diff" },
|
|
||||||
{ "]c", utils.partial(nav_hunk, "next"), desc = "Next hunk/diff" },
|
|
||||||
}
|
|
||||||
|
|
||||||
local objects = {
|
local objects = {
|
||||||
mode = "o",
|
mode = "o",
|
||||||
{ "ih", gitsigns.select_hunk, desc = "git hunk" },
|
{ "ih", gitsigns.select_hunk, desc = "Git hunk" },
|
||||||
}
|
}
|
||||||
-- Visual
|
-- Visual
|
||||||
local visual = {
|
local visual = {
|
||||||
mode = { "x" },
|
mode = { "x" },
|
||||||
{ "ih", gitsigns.select_hunk, desc = "git hunk" },
|
{ "ih", gitsigns.select_hunk, desc = "Git hunk" },
|
||||||
{ "<leader>g", group = "Git" },
|
{ "<leader>g", group = "Git" },
|
||||||
{ "<leader>gp", gitsigns.preview_hunk, desc = "Preview selection" },
|
{ "<leader>gp", gitsigns.preview_hunk, desc = "Preview selection" },
|
||||||
{ "<leader>gr", make_visual(gitsigns.reset_hunk), desc = "Restore selection" },
|
{ "<leader>gr", make_visual(gitsigns.reset_hunk), desc = "Restore selection" },
|
||||||
|
|
@ -73,6 +71,5 @@ local visual = {
|
||||||
}
|
}
|
||||||
|
|
||||||
wk.add(keys)
|
wk.add(keys)
|
||||||
wk.add(moves)
|
|
||||||
wk.add(objects)
|
wk.add(objects)
|
||||||
wk.add(visual)
|
wk.add(visual)
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
local lspconfig = require("lspconfig")
|
||||||
local lsp = require("ambroisie.lsp")
|
local lsp = require("ambroisie.lsp")
|
||||||
local utils = require("ambroisie.utils")
|
local utils = require("ambroisie.utils")
|
||||||
|
|
||||||
|
|
@ -24,27 +25,59 @@ vim.diagnostic.config({
|
||||||
-- Inform servers we are able to do completion, snippets, etc...
|
-- Inform servers we are able to do completion, snippets, etc...
|
||||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
|
|
||||||
-- Shared configuration
|
-- C/C++
|
||||||
vim.lsp.config("*", {
|
if utils.is_executable("clangd") then
|
||||||
capabilities = capabilities,
|
lspconfig.clangd.setup({
|
||||||
on_attach = lsp.on_attach,
|
capabilities = capabilities,
|
||||||
})
|
on_attach = lsp.on_attach,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
local servers = {
|
-- Haskell
|
||||||
-- C/C++
|
if utils.is_executable("haskell-language-server-wrapper") then
|
||||||
clangd = {},
|
lspconfig.hls.setup({
|
||||||
-- Haskell
|
capabilities = capabilities,
|
||||||
hls = {},
|
on_attach = lsp.on_attach,
|
||||||
-- Nix
|
})
|
||||||
nil_ls = {},
|
end
|
||||||
-- Python
|
|
||||||
pyright = {},
|
-- Nix
|
||||||
ruff = {},
|
if utils.is_executable("nil") then
|
||||||
-- Rust
|
lspconfig.nil_ls.setup({
|
||||||
rust_analyzer = {},
|
capabilities = capabilities,
|
||||||
-- Shell
|
on_attach = lsp.on_attach,
|
||||||
bashls = {
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Python
|
||||||
|
if utils.is_executable("pyright") then
|
||||||
|
lspconfig.pyright.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = lsp.on_attach,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
if utils.is_executable("ruff") then
|
||||||
|
lspconfig.ruff.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = lsp.on_attach,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Rust
|
||||||
|
if utils.is_executable("rust-analyzer") then
|
||||||
|
lspconfig.rust_analyzer.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = lsp.on_attach,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Shell
|
||||||
|
if utils.is_executable("bash-language-server") then
|
||||||
|
lspconfig.bashls.setup({
|
||||||
filetypes = { "bash", "sh", "zsh" },
|
filetypes = { "bash", "sh", "zsh" },
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = lsp.on_attach,
|
||||||
settings = {
|
settings = {
|
||||||
bashIde = {
|
bashIde = {
|
||||||
shfmt = {
|
shfmt = {
|
||||||
|
|
@ -55,17 +88,28 @@ local servers = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
})
|
||||||
-- Starlark
|
end
|
||||||
starpls = {},
|
|
||||||
-- Generic
|
-- Starlark
|
||||||
harper_ls = {},
|
if utils.is_executable("starpls") then
|
||||||
typos_lsp = {},
|
lspconfig.starpls.setup({
|
||||||
}
|
capabilities = capabilities,
|
||||||
|
on_attach = lsp.on_attach,
|
||||||
for server, config in pairs(servers) do
|
})
|
||||||
if not vim.tbl_isempty(config) then
|
end
|
||||||
vim.lsp.config(server, config)
|
|
||||||
end
|
-- Generic
|
||||||
vim.lsp.enable(server)
|
if utils.is_executable("harper-ls") then
|
||||||
|
lspconfig.harper_ls.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = lsp.on_attach,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
if utils.is_executable("typos-lsp") then
|
||||||
|
lspconfig.typos_lsp.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = lsp.on_attach,
|
||||||
|
})
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
local lualine = require("lualine")
|
local lualine = require("lualine")
|
||||||
local oil = require("oil")
|
local oil = require("oil")
|
||||||
local lsp = require("ambroisie.lsp")
|
local utils = require("ambroisie.utils")
|
||||||
|
|
||||||
local function list_spell_languages()
|
local function list_spell_languages()
|
||||||
if not vim.opt.spell:get() then
|
if not vim.opt.spell:get() then
|
||||||
|
|
@ -11,7 +11,7 @@ local function list_spell_languages()
|
||||||
end
|
end
|
||||||
|
|
||||||
local function list_lsp_clients()
|
local function list_lsp_clients()
|
||||||
local client_names = lsp.list_clients(0)
|
local client_names = utils.list_lsp_clients(0)
|
||||||
|
|
||||||
if #client_names == 0 then
|
if #client_names == 0 then
|
||||||
return ""
|
return ""
|
||||||
|
|
|
||||||
|
|
@ -10,11 +10,11 @@ null_ls.setup({
|
||||||
null_ls.register({
|
null_ls.register({
|
||||||
null_ls.builtins.diagnostics.buildifier.with({
|
null_ls.builtins.diagnostics.buildifier.with({
|
||||||
-- Only used if available
|
-- Only used if available
|
||||||
condition = utils.partial(utils.is_executable, "buildifier"),
|
condition = utils.is_executable_condition("buildifier"),
|
||||||
}),
|
}),
|
||||||
null_ls.builtins.formatting.buildifier.with({
|
null_ls.builtins.formatting.buildifier.with({
|
||||||
-- Only used if available
|
-- Only used if available
|
||||||
condition = utils.partial(utils.is_executable, "buildifier"),
|
condition = utils.is_executable_condition("buildifier"),
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -22,7 +22,7 @@ null_ls.register({
|
||||||
null_ls.register({
|
null_ls.register({
|
||||||
null_ls.builtins.formatting.nixpkgs_fmt.with({
|
null_ls.builtins.formatting.nixpkgs_fmt.with({
|
||||||
-- Only used if available
|
-- Only used if available
|
||||||
condition = utils.partial(utils.is_executable, "nixpkgs-fmt"),
|
condition = utils.is_executable_condition("nixpkgs-fmt"),
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
@ -30,19 +30,19 @@ null_ls.register({
|
||||||
null_ls.register({
|
null_ls.register({
|
||||||
null_ls.builtins.diagnostics.mypy.with({
|
null_ls.builtins.diagnostics.mypy.with({
|
||||||
-- Only used if available
|
-- Only used if available
|
||||||
condition = utils.partial(utils.is_executable, "mypy"),
|
condition = utils.is_executable_condition("mypy"),
|
||||||
}),
|
}),
|
||||||
null_ls.builtins.diagnostics.pylint.with({
|
null_ls.builtins.diagnostics.pylint.with({
|
||||||
-- Only used if available
|
-- Only used if available
|
||||||
condition = utils.partial(utils.is_executable, "pylint"),
|
condition = utils.is_executable_condition("pylint"),
|
||||||
}),
|
}),
|
||||||
null_ls.builtins.formatting.black.with({
|
null_ls.builtins.formatting.black.with({
|
||||||
extra_args = { "--fast" },
|
extra_args = { "--fast" },
|
||||||
-- Only used if available
|
-- Only used if available
|
||||||
condition = utils.partial(utils.is_executable, "black"),
|
condition = utils.is_executable_condition("black"),
|
||||||
}),
|
}),
|
||||||
null_ls.builtins.formatting.isort.with({
|
null_ls.builtins.formatting.isort.with({
|
||||||
-- Only used if available
|
-- Only used if available
|
||||||
condition = utils.partial(utils.is_executable, "isort"),
|
condition = utils.is_executable_condition("isort"),
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,95 +1,54 @@
|
||||||
local treesitter = require("nvim-treesitter")
|
local ts_config = require("nvim-treesitter.configs")
|
||||||
local ts_select = require("nvim-treesitter-textobjects.select")
|
|
||||||
local ts_move = require("nvim-treesitter-textobjects.move")
|
|
||||||
local utils = require("ambroisie.utils")
|
|
||||||
local wk = require("which-key")
|
|
||||||
|
|
||||||
local function select_textobject(query)
|
ts_config.setup({
|
||||||
return utils.partial(ts_select.select_textobject, query)
|
highlight = {
|
||||||
end
|
enable = true,
|
||||||
|
-- Avoid duplicate highlighting
|
||||||
local function goto_next_start(query)
|
additional_vim_regex_highlighting = false,
|
||||||
return utils.partial(ts_move.goto_next_start, query)
|
|
||||||
end
|
|
||||||
local function goto_next_end(query)
|
|
||||||
return utils.partial(ts_move.goto_next_end, query)
|
|
||||||
end
|
|
||||||
local function goto_previous_start(query)
|
|
||||||
return utils.partial(ts_move.goto_previous_start, query)
|
|
||||||
end
|
|
||||||
local function goto_previous_end(query)
|
|
||||||
return utils.partial(ts_move.goto_previous_end, query)
|
|
||||||
end
|
|
||||||
|
|
||||||
local objects = {
|
|
||||||
mode = { "x", "o" },
|
|
||||||
{ "aa", select_textobject("@parameter.outer"), desc = "a parameter" },
|
|
||||||
{ "ia", select_textobject("@parameter.inner"), desc = "inner parameter" },
|
|
||||||
{ "ab", select_textobject("@block.outer"), desc = "a block" },
|
|
||||||
{ "ib", select_textobject("@block.inner"), desc = "inner block" },
|
|
||||||
{ "ac", select_textobject("@class.outer"), desc = "a class" },
|
|
||||||
{ "ic", select_textobject("@class.inner"), desc = "inner class" },
|
|
||||||
{ "af", select_textobject("@function.outer"), desc = "a function" },
|
|
||||||
{ "if", select_textobject("@function.inner"), desc = "inner function" },
|
|
||||||
{ "ak", select_textobject("@comment.outer"), desc = "a comment" },
|
|
||||||
{ "aS", select_textobject("@statement.outer"), desc = "a statement" },
|
|
||||||
}
|
|
||||||
local moves = {
|
|
||||||
mode = { "n", "x", "o" },
|
|
||||||
-- Next start
|
|
||||||
{ "]m", goto_next_start("@function.outer"), desc = "Next method start" },
|
|
||||||
{ "]S", goto_next_start("@statement.outer"), desc = "Next statement start" },
|
|
||||||
{ "]]", goto_next_start("@class.outer"), desc = "Next class start" },
|
|
||||||
-- Next end
|
|
||||||
{ "]M", goto_next_end("@function.outer"), desc = "Next method end" },
|
|
||||||
{ "][", goto_next_end("@class.outer"), desc = "Next class end" },
|
|
||||||
-- Previous start
|
|
||||||
{ "[m", goto_previous_start("@function.outer"), desc = "Previous method start" },
|
|
||||||
{ "[S", goto_previous_start("@statement.outer"), desc = "Previous statement start" },
|
|
||||||
{ "[[", goto_previous_start("@class.outer"), desc = "Previous class start" },
|
|
||||||
-- Previous end
|
|
||||||
{ "[M", goto_previous_end("@function.outer"), desc = "Previous method end" },
|
|
||||||
{ "[]", goto_previous_end("@class.outer"), desc = "Previous class end" },
|
|
||||||
}
|
|
||||||
wk.add(objects)
|
|
||||||
wk.add(moves)
|
|
||||||
|
|
||||||
require("nvim-treesitter-textobjects").setup({
|
|
||||||
select = {
|
|
||||||
-- Jump to matching text objects
|
|
||||||
lookahead = true,
|
|
||||||
},
|
},
|
||||||
move = {
|
indent = {
|
||||||
-- Add to jump list
|
enable = true,
|
||||||
set_jumps = true,
|
},
|
||||||
|
textobjects = {
|
||||||
|
select = {
|
||||||
|
enable = true,
|
||||||
|
-- Jump to matching text objects
|
||||||
|
lookahead = true,
|
||||||
|
keymaps = {
|
||||||
|
["aa"] = { query = "@parameter.outer", desc = "a parameter" },
|
||||||
|
["ia"] = { query = "@parameter.inner", desc = "inner parameter" },
|
||||||
|
["ab"] = { query = "@block.outer", desc = "a block" },
|
||||||
|
["ib"] = { query = "@block.inner", desc = "inner block" },
|
||||||
|
["ac"] = { query = "@class.outer", desc = "a class" },
|
||||||
|
["ic"] = { query = "@class.inner", desc = "inner class" },
|
||||||
|
["af"] = { query = "@function.outer", desc = "a function" },
|
||||||
|
["if"] = { query = "@function.inner", desc = "inner function" },
|
||||||
|
["ak"] = { query = "@comment.outer", desc = "a comment" },
|
||||||
|
["aS"] = { query = "@statement.outer", desc = "a statement" },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
move = {
|
||||||
|
enable = true,
|
||||||
|
-- Add to jump list
|
||||||
|
set_jumps = true,
|
||||||
|
goto_next_start = {
|
||||||
|
["]m"] = { query = "@function.outer", desc = "Next method start" },
|
||||||
|
["]S"] = { query = "@statement.outer", desc = "Next statement start" },
|
||||||
|
["]]"] = { query = "@class.outer", desc = "Next class start" },
|
||||||
|
},
|
||||||
|
goto_next_end = {
|
||||||
|
["]M"] = { query = "@function.outer", desc = "Next method end" },
|
||||||
|
["]["] = { query = "@class.outer", desc = "Next class end" },
|
||||||
|
},
|
||||||
|
goto_previous_start = {
|
||||||
|
["[m"] = { query = "@function.outer", desc = "Previous method start" },
|
||||||
|
["[S"] = { query = "@statement.outer", desc = "Previous statement start" },
|
||||||
|
["[["] = { query = "@class.outer", desc = "Previous class start" },
|
||||||
|
},
|
||||||
|
goto_previous_end = {
|
||||||
|
["[M"] = { query = "@function.outer", desc = "Previous method end" },
|
||||||
|
["[]"] = { query = "@class.outer", desc = "Previous class end" },
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Automatically setup treesitter for supported filetypes
|
|
||||||
local function treesitter_try_attach(buf, language)
|
|
||||||
-- Try to load language
|
|
||||||
-- NOTE: the best way I found to check if a filetype has a grammar
|
|
||||||
if not vim.treesitter.language.add(language) then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Syntax highlighting
|
|
||||||
vim.treesitter.start(buf, language)
|
|
||||||
-- Indentation
|
|
||||||
vim.bo.indentexpr = "v:lua.require('nvim-treesitter').indentexpr()"
|
|
||||||
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
|
||||||
pattern = "*",
|
|
||||||
group = vim.api.nvim_create_augroup("ambroisie.treesitter_attach", { clear = true }),
|
|
||||||
callback = function(args)
|
|
||||||
local buf, filetype = args.buf, args.match
|
|
||||||
local language = vim.treesitter.language.get_lang(filetype)
|
|
||||||
if not language then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
treesitter_try_attach(buf, language)
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
local signtoggle = vim.api.nvim_create_augroup("ambroisie.signtoggle", { clear = true })
|
local signtoggle = vim.api.nvim_create_augroup("signtoggle", { clear = true })
|
||||||
|
|
||||||
-- Only show sign column for the currently focused buffer, if it has a number column
|
-- Only show sign column for the currently focused buffer, if it has a number column
|
||||||
vim.api.nvim_create_autocmd({ "BufEnter", "FocusGained", "WinEnter" }, {
|
vim.api.nvim_create_autocmd({ "BufEnter", "FocusGained", "WinEnter" }, {
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@ let
|
||||||
isEnabled = config.my.home.wm.windowManager == "i3";
|
isEnabled = config.my.home.wm.windowManager == "i3";
|
||||||
|
|
||||||
terminal =
|
terminal =
|
||||||
if config.my.home.terminal.program != null
|
if config.my.home.terminal.default != null
|
||||||
then config.my.home.terminal.program
|
then config.my.home.terminal.default
|
||||||
else "i3-sensible-terminal";
|
else "i3-sensible-terminal";
|
||||||
|
|
||||||
alt = "Mod1"; # `Alt` key
|
alt = "Mod1"; # `Alt` key
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ in
|
||||||
inactive_state = "Idle";
|
inactive_state = "Idle";
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
map (block: defaults // block) cfg.vpn.blockConfigs
|
builtins.map (block: defaults // block) cfg.vpn.blockConfigs
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ in
|
||||||
programs.rofi = {
|
programs.rofi = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
terminal = config.my.home.terminal.program; # null by default
|
terminal = config.my.home.terminal.default; # null by default
|
||||||
|
|
||||||
package = pkgs.rofi.override {
|
package = pkgs.rofi.override {
|
||||||
plugins = with pkgs; [
|
plugins = with pkgs; [
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,6 @@ in
|
||||||
|
|
||||||
launchTmux = mkEnableOption "auto launch tmux at shell start";
|
launchTmux = mkEnableOption "auto launch tmux at shell start";
|
||||||
|
|
||||||
completionSync = {
|
|
||||||
enable = mkEnableOption "zsh-completion-sync plugin";
|
|
||||||
};
|
|
||||||
|
|
||||||
notify = {
|
notify = {
|
||||||
enable = mkEnableOption "zsh-done notification";
|
enable = mkEnableOption "zsh-done notification";
|
||||||
|
|
||||||
|
|
@ -23,7 +19,7 @@ in
|
||||||
"direnv reload"
|
"direnv reload"
|
||||||
"fg"
|
"fg"
|
||||||
"git (?!push|pull|fetch)"
|
"git (?!push|pull|fetch)"
|
||||||
"home-manager (?!switch|build)"
|
"home-manager (?!switch|build|news)"
|
||||||
"htop"
|
"htop"
|
||||||
"less"
|
"less"
|
||||||
"man"
|
"man"
|
||||||
|
|
@ -72,7 +68,7 @@ in
|
||||||
plugins = [
|
plugins = [
|
||||||
{
|
{
|
||||||
name = "fast-syntax-highlighting";
|
name = "fast-syntax-highlighting";
|
||||||
file = "share/zsh/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh";
|
file = "share/zsh/site-functions/fast-syntax-highlighting.plugin.zsh";
|
||||||
src = pkgs.zsh-fast-syntax-highlighting;
|
src = pkgs.zsh-fast-syntax-highlighting;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
|
@ -122,18 +118,6 @@ in
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
(lib.mkIf cfg.completionSync.enable {
|
|
||||||
programs.zsh = {
|
|
||||||
plugins = [
|
|
||||||
{
|
|
||||||
name = "zsh-completion-sync";
|
|
||||||
file = "share/zsh-completion-sync/zsh-completion-sync.plugin.zsh";
|
|
||||||
src = pkgs.zsh-completion-sync;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
})
|
|
||||||
|
|
||||||
(lib.mkIf cfg.notify.enable {
|
(lib.mkIf cfg.notify.enable {
|
||||||
programs.zsh = {
|
programs.zsh = {
|
||||||
plugins = [
|
plugins = [
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,8 @@ in
|
||||||
|
|
||||||
amd = {
|
amd = {
|
||||||
enableKernelModule = lib.my.mkDisableOption "Kernel driver module";
|
enableKernelModule = lib.my.mkDisableOption "Kernel driver module";
|
||||||
|
|
||||||
|
amdvlk = lib.mkEnableOption "Use AMDVLK instead of Mesa RADV driver";
|
||||||
};
|
};
|
||||||
|
|
||||||
intel = {
|
intel = {
|
||||||
|
|
@ -33,6 +35,13 @@ in
|
||||||
(lib.mkIf (cfg.gpuFlavor == "amd") {
|
(lib.mkIf (cfg.gpuFlavor == "amd") {
|
||||||
hardware.amdgpu = {
|
hardware.amdgpu = {
|
||||||
initrd.enable = cfg.amd.enableKernelModule;
|
initrd.enable = cfg.amd.enableKernelModule;
|
||||||
|
# Vulkan
|
||||||
|
amdvlk = lib.mkIf cfg.amd.amdvlk {
|
||||||
|
enable = true;
|
||||||
|
support32Bit = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
hardware.graphics = {
|
hardware.graphics = {
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ in
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = map lib.hiPrio [
|
environment.systemPackages = builtins.map lib.hiPrio [
|
||||||
# Respect XDG conventions, leave my HOME alone
|
# Respect XDG conventions, leave my HOME alone
|
||||||
(pkgs.writeShellScriptBin "steam" ''
|
(pkgs.writeShellScriptBin "steam" ''
|
||||||
mkdir -p "${cfg.dataDir}"
|
mkdir -p "${cfg.dataDir}"
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ in
|
||||||
# Contains the UID/GID map, and other useful state
|
# Contains the UID/GID map, and other useful state
|
||||||
"/var/lib/nixos"
|
"/var/lib/nixos"
|
||||||
# SSH host keys (and public keys for convenience)
|
# SSH host keys (and public keys for convenience)
|
||||||
(map (key: [ key.path "${key.path}.pub" ]) config.services.openssh.hostKeys)
|
(builtins.map (key: [ key.path "${key.path}.pub" ]) config.services.openssh.hostKeys)
|
||||||
];
|
];
|
||||||
|
|
||||||
services.restic.backups.backblaze = {
|
services.restic.backups.backblaze = {
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@
|
||||||
./podgrab
|
./podgrab
|
||||||
./postgresql
|
./postgresql
|
||||||
./postgresql-backup
|
./postgresql-backup
|
||||||
|
./pyload
|
||||||
./quassel
|
./quassel
|
||||||
./rss-bridge
|
./rss-bridge
|
||||||
./sabnzbd
|
./sabnzbd
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ in
|
||||||
|
|
||||||
my.services.backup = {
|
my.services.backup = {
|
||||||
paths = [
|
paths = [
|
||||||
(lib.removePrefix "file://" config.services.homebox.settings.HBOX_STORAGE_CONN_STRING)
|
config.services.homebox.settings.HBOX_STORAGE_DATA
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,6 @@ in
|
||||||
BASE_URL = "https://mealie.${config.networking.domain}";
|
BASE_URL = "https://mealie.${config.networking.domain}";
|
||||||
TZ = config.time.timeZone;
|
TZ = config.time.timeZone;
|
||||||
ALLOw_SIGNUP = "false";
|
ALLOw_SIGNUP = "false";
|
||||||
TOKEN_TIME = 24 * 180; # 180 days
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Automatic PostgreSQL provisioning
|
# Automatic PostgreSQL provisioning
|
||||||
|
|
@ -54,12 +53,6 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
my.services.backup = {
|
|
||||||
paths = [
|
|
||||||
"/var/lib/mealie"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
services.fail2ban.jails = {
|
services.fail2ban.jails = {
|
||||||
mealie = ''
|
mealie = ''
|
||||||
enabled = true
|
enabled = true
|
||||||
|
|
|
||||||
|
|
@ -16,12 +16,6 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
services.nextcloud = {
|
|
||||||
extraApps = {
|
|
||||||
inherit (config.services.nextcloud.package.packages.apps) richdocuments;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.collabora-online = {
|
services.collabora-online = {
|
||||||
enable = true;
|
enable = true;
|
||||||
inherit (cfg) port;
|
inherit (cfg) port;
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ in
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
services.nextcloud = {
|
services.nextcloud = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.nextcloud33;
|
package = pkgs.nextcloud31;
|
||||||
hostName = "nextcloud.${config.networking.domain}";
|
hostName = "nextcloud.${config.networking.domain}";
|
||||||
home = "/var/lib/nextcloud";
|
home = "/var/lib/nextcloud";
|
||||||
maxUploadSize = cfg.maxSize;
|
maxUploadSize = cfg.maxSize;
|
||||||
|
|
@ -62,16 +62,6 @@ in
|
||||||
# Allow using the push service without hard-coding my IP in the configuration
|
# Allow using the push service without hard-coding my IP in the configuration
|
||||||
bendDomainToLocalhost = true;
|
bendDomainToLocalhost = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
extraApps = {
|
|
||||||
inherit (config.services.nextcloud.package.packages.apps)
|
|
||||||
calendar
|
|
||||||
contacts
|
|
||||||
deck
|
|
||||||
tasks
|
|
||||||
;
|
|
||||||
# notify_push is automatically installed by the module
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# The service above configures the domain, no need for my wrapper
|
# The service above configures the domain, no need for my wrapper
|
||||||
|
|
|
||||||
|
|
@ -188,14 +188,14 @@ in
|
||||||
++ (lib.flip lib.mapAttrsToList cfg.virtualHosts (_: { subdomain, ... } @ args:
|
++ (lib.flip lib.mapAttrsToList cfg.virtualHosts (_: { subdomain, ... } @ args:
|
||||||
let
|
let
|
||||||
conflicts = [ "port" "root" "socket" "redirect" ];
|
conflicts = [ "port" "root" "socket" "redirect" ];
|
||||||
optionsNotNull = map (v: args.${v} != null) conflicts;
|
optionsNotNull = builtins.map (v: args.${v} != null) conflicts;
|
||||||
optionsSet = lib.filter lib.id optionsNotNull;
|
optionsSet = lib.filter lib.id optionsNotNull;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
assertion = builtins.length optionsSet == 1;
|
assertion = builtins.length optionsSet == 1;
|
||||||
message = ''
|
message = ''
|
||||||
Subdomain '${subdomain}' must have exactly one of ${
|
Subdomain '${subdomain}' must have exactly one of ${
|
||||||
lib.concatStringsSep ", " (map (v: "'${v}'") conflicts)
|
lib.concatStringsSep ", " (builtins.map (v: "'${v}'") conflicts)
|
||||||
} configured.
|
} configured.
|
||||||
'';
|
'';
|
||||||
}))
|
}))
|
||||||
|
|
@ -208,7 +208,7 @@ in
|
||||||
assertion = args.websocketsLocations != [ ] -> proxyPassUsed;
|
assertion = args.websocketsLocations != [ ] -> proxyPassUsed;
|
||||||
message = ''
|
message = ''
|
||||||
Subdomain '${subdomain}' can only use 'websocketsLocations' with one of ${
|
Subdomain '${subdomain}' can only use 'websocketsLocations' with one of ${
|
||||||
lib.concatStringsSep ", " (map (v: "'${v}'") proxyPass)
|
lib.concatStringsSep ", " (builtins.map (v: "'${v}'") proxyPass)
|
||||||
}.
|
}.
|
||||||
'';
|
'';
|
||||||
}))
|
}))
|
||||||
|
|
@ -444,7 +444,7 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services."acme-order-renew-${domain}" = {
|
systemd.services."acme-${domain}" = {
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Environment = [
|
Environment = [
|
||||||
# Since I do a "weird" setup with a wildcard CNAME
|
# Since I do a "weird" setup with a wildcard CNAME
|
||||||
|
|
|
||||||
|
|
@ -33,16 +33,14 @@ in
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
services.harmonia = {
|
services.harmonia = {
|
||||||
cache = {
|
enable = true;
|
||||||
enable = true;
|
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
bind = "127.0.0.1:${toString cfg.port}";
|
bind = "127.0.0.1:${toString cfg.port}";
|
||||||
inherit (cfg) priority;
|
inherit (cfg) priority;
|
||||||
};
|
|
||||||
|
|
||||||
signKeyPaths = [ cfg.secretKeyFile ];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
signKeyPaths = [ cfg.secretKeyFile ];
|
||||||
};
|
};
|
||||||
|
|
||||||
my.services.nginx.virtualHosts = {
|
my.services.nginx.virtualHosts = {
|
||||||
|
|
|
||||||
72
modules/nixos/services/pyload/default.nix
Normal file
72
modules/nixos/services/pyload/default.nix
Normal file
|
|
@ -0,0 +1,72 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.services.pyload;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.services.pyload = with lib; {
|
||||||
|
enable = mkEnableOption "pyload download manager";
|
||||||
|
|
||||||
|
credentialsFile = mkOption {
|
||||||
|
type = types.path;
|
||||||
|
example = "/run/secrets/pyload-credentials.env";
|
||||||
|
description = "pyload credentials";
|
||||||
|
};
|
||||||
|
|
||||||
|
downloadDirectory = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "/data/downloads/pyload";
|
||||||
|
example = "/var/lib/pyload/download";
|
||||||
|
description = "Download directory";
|
||||||
|
};
|
||||||
|
|
||||||
|
port = mkOption {
|
||||||
|
type = types.port;
|
||||||
|
default = 9093;
|
||||||
|
example = 8080;
|
||||||
|
description = "Internal port for webui";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
services.pyload = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
# Listening on `localhost` leads to 502 with the reverse proxy...
|
||||||
|
listenAddress = "127.0.0.1";
|
||||||
|
|
||||||
|
inherit (cfg)
|
||||||
|
credentialsFile
|
||||||
|
downloadDirectory
|
||||||
|
port
|
||||||
|
;
|
||||||
|
|
||||||
|
# Use media group when downloading files
|
||||||
|
group = "media";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Set-up media group
|
||||||
|
users.groups.media = { };
|
||||||
|
|
||||||
|
my.services.nginx.virtualHosts = {
|
||||||
|
pyload = {
|
||||||
|
inherit (cfg) port;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.fail2ban.jails = {
|
||||||
|
pyload = ''
|
||||||
|
enabled = true
|
||||||
|
filter = pyload
|
||||||
|
port = http,https
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.etc = {
|
||||||
|
"fail2ban/filter.d/pyload.conf".text = ''
|
||||||
|
[Definition]
|
||||||
|
failregex = ^.*Login failed for user '<F-USER>.*</F-USER>' \[CLIENT: <HOST>\]$
|
||||||
|
journalmatch = _SYSTEMD_UNIT=pyload.service
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -2,35 +2,17 @@
|
||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
let
|
let
|
||||||
cfg = config.my.services.sabnzbd;
|
cfg = config.my.services.sabnzbd;
|
||||||
|
port = 9090; # NOTE: not declaratively set...
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.my.services.sabnzbd = with lib; {
|
options.my.services.sabnzbd = with lib; {
|
||||||
enable = mkEnableOption "SABnzbd binary news reader";
|
enable = mkEnableOption "SABnzbd binary news reader";
|
||||||
|
|
||||||
port = mkOption {
|
|
||||||
type = types.port;
|
|
||||||
default = 9090;
|
|
||||||
example = 4242;
|
|
||||||
description = "The port on which SABnzbd will listen for incoming HTTP traffic";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
services.sabnzbd = {
|
services.sabnzbd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
group = "media";
|
group = "media";
|
||||||
|
|
||||||
# Don't warn about the config file
|
|
||||||
configFile = null;
|
|
||||||
# I want to configure servers outside of Nix
|
|
||||||
allowConfigWrite = true;
|
|
||||||
|
|
||||||
settings = {
|
|
||||||
misc = {
|
|
||||||
host = "127.0.0.1";
|
|
||||||
inherit (cfg) port;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Set-up media group
|
# Set-up media group
|
||||||
|
|
@ -38,7 +20,7 @@ in
|
||||||
|
|
||||||
my.services.nginx.virtualHosts = {
|
my.services.nginx.virtualHosts = {
|
||||||
sabnzbd = {
|
sabnzbd = {
|
||||||
inherit (cfg) port;
|
inherit port;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.my.services.servarr.bazarr = with lib; {
|
options.my.services.servarr.bazarr = with lib; {
|
||||||
enable = mkEnableOption "Bazarr" // {
|
enable = lib.mkEnableOption "Bazarr" // {
|
||||||
default = config.my.services.servarr.enableAll;
|
default = config.my.services.servarr.enableAll;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.my.services.servarr.jackett = with lib; {
|
options.my.services.servarr.jackett = with lib; {
|
||||||
enable = mkEnableOption "Jackett" // {
|
enable = lib.mkEnableOption "Jackett" // {
|
||||||
default = config.my.services.servarr.enableAll;
|
default = config.my.services.servarr.enableAll;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.my.services.servarr.nzbhydra = with lib; {
|
options.my.services.servarr.nzbhydra = with lib; {
|
||||||
enable = mkEnableOption "NZBHydra2" // {
|
enable = lib.mkEnableOption "NZBHydra2" // {
|
||||||
default = config.my.services.servarr.enableAll;
|
default = config.my.services.servarr.enableAll;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.my.services.servarr.prowlarr = with lib; {
|
options.my.services.servarr.prowlarr = with lib; {
|
||||||
enable = mkEnableOption "Prowlarr" // {
|
enable = lib.mkEnableOption "Prowlarr" // {
|
||||||
default = config.my.services.servarr.enableAll;
|
default = config.my.services.servarr.enableAll;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ let
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.my.services.servarr.${starr} = with lib; {
|
options.my.services.servarr.${starr} = with lib; {
|
||||||
enable = mkEnableOption (lib.toSentenceCase starr) // {
|
enable = lib.mkEnableOption (lib.toSentenceCase starr) // {
|
||||||
default = config.my.services.servarr.enableAll;
|
default = config.my.services.servarr.enableAll;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,14 +71,10 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Transmission wants to eat *all* my RAM if left to its own devices
|
||||||
systemd.services.transmission = {
|
systemd.services.transmission = {
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
# Transmission wants to eat *all* my RAM if left to its own devices
|
|
||||||
MemoryMax = "33%";
|
MemoryMax = "33%";
|
||||||
# Avoid errors due to high number of open files.
|
|
||||||
LimitNOFILE = 1048576;
|
|
||||||
# Longer stop timeout to finish all torrents
|
|
||||||
TimeoutStopSec = "5m";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,10 +29,7 @@ in
|
||||||
|
|
||||||
man = {
|
man = {
|
||||||
enable = cfg.man.enable;
|
enable = cfg.man.enable;
|
||||||
|
generateCaches = true;
|
||||||
cache = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
nixos.enable = cfg.nixos.enable;
|
nixos.enable = cfg.nixos.enable;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# Automatically import all overlays in the directory
|
# Automatically import all overlays in the directory
|
||||||
let
|
let
|
||||||
files = builtins.readDir ./.;
|
files = builtins.readDir ./.;
|
||||||
overlays = removeAttrs files [ "default.nix" ];
|
overlays = builtins.removeAttrs files [ "default.nix" ];
|
||||||
in
|
in
|
||||||
builtins.mapAttrs (name: _: import "${./.}/${name}") overlays
|
builtins.mapAttrs (name: _: import "${./.}/${name}") overlays
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,14 @@
|
||||||
self: _prev:
|
self: prev:
|
||||||
{
|
{
|
||||||
transmission_4 = self.callPackage ./transmission_4.nix {
|
transmission_4 = prev.transmission_4.overrideAttrs (_: {
|
||||||
fmt = self.fmt_9;
|
version = "4.0.5";
|
||||||
libutp = self.libutp_3_4;
|
|
||||||
};
|
src = self.fetchFromGitHub {
|
||||||
|
owner = "transmission";
|
||||||
|
repo = "transmission";
|
||||||
|
rev = "4.0.5";
|
||||||
|
hash = "sha256-gd1LGAhMuSyC/19wxkoE2mqVozjGPfupIPGojKY0Hn4=";
|
||||||
|
fetchSubmodules = true;
|
||||||
|
};
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,232 +0,0 @@
|
||||||
{ stdenv
|
|
||||||
, lib
|
|
||||||
, fetchFromGitHub
|
|
||||||
, fetchpatch2
|
|
||||||
, cmake
|
|
||||||
, pkg-config
|
|
||||||
, python3
|
|
||||||
, openssl
|
|
||||||
, curl
|
|
||||||
, libevent
|
|
||||||
, inotify-tools
|
|
||||||
, systemd
|
|
||||||
, zlib
|
|
||||||
, pcre
|
|
||||||
, libb64
|
|
||||||
, libutp
|
|
||||||
, libdeflate
|
|
||||||
, utf8cpp
|
|
||||||
, fast-float
|
|
||||||
, fmt
|
|
||||||
, libpsl
|
|
||||||
, miniupnpc
|
|
||||||
, dht
|
|
||||||
, libnatpmp
|
|
||||||
, # Build options
|
|
||||||
enableGTK3 ? false
|
|
||||||
, gtkmm3
|
|
||||||
, libpthread-stubs
|
|
||||||
, wrapGAppsHook3
|
|
||||||
, enableQt5 ? false
|
|
||||||
, enableQt6 ? false
|
|
||||||
, qt5
|
|
||||||
, qt6Packages
|
|
||||||
, nixosTests
|
|
||||||
, enableSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
|
|
||||||
, enableDaemon ? true
|
|
||||||
, enableCli ? true
|
|
||||||
, installLib ? false
|
|
||||||
, apparmorRulesFromClosure
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
inherit (lib) cmakeBool optionals;
|
|
||||||
|
|
||||||
apparmorRules = apparmorRulesFromClosure { name = "transmission-daemon"; } (
|
|
||||||
[
|
|
||||||
curl
|
|
||||||
libdeflate
|
|
||||||
libevent
|
|
||||||
libnatpmp
|
|
||||||
libpsl
|
|
||||||
miniupnpc
|
|
||||||
openssl
|
|
||||||
pcre
|
|
||||||
zlib
|
|
||||||
]
|
|
||||||
++ optionals enableSystemd [ systemd ]
|
|
||||||
++ optionals stdenv.hostPlatform.isLinux [ inotify-tools ]
|
|
||||||
);
|
|
||||||
|
|
||||||
in
|
|
||||||
stdenv.mkDerivation (finalAttrs: {
|
|
||||||
pname = "transmission";
|
|
||||||
version = "4.0.5";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
owner = "transmission";
|
|
||||||
repo = "transmission";
|
|
||||||
rev = finalAttrs.version;
|
|
||||||
hash = "sha256-gd1LGAhMuSyC/19wxkoE2mqVozjGPfupIPGojKY0Hn4=";
|
|
||||||
fetchSubmodules = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
patches = [
|
|
||||||
(fetchpatch2 {
|
|
||||||
url = "https://github.com/transmission/transmission/commit/febfe49ca3ecab1a7142ecb34012c1f0b2bcdee8.patch?full_index=1";
|
|
||||||
hash = "sha256-Ge0+AXf/ilfMieGBAdvvImY7JOb0gGIdeKprC37AROs=";
|
|
||||||
excludes = [
|
|
||||||
# The submodule that we don't use (we use our miniupnp)
|
|
||||||
"third-party/miniupnp"
|
|
||||||
# Hunk fails for this one, but we don't care because we don't rely upon
|
|
||||||
# xcode definitions even for the Darwin build.
|
|
||||||
"Transmission.xcodeproj/project.pbxproj"
|
|
||||||
];
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
outputs = [
|
|
||||||
"out"
|
|
||||||
"apparmor"
|
|
||||||
];
|
|
||||||
|
|
||||||
cmakeFlags = [
|
|
||||||
(cmakeBool "ENABLE_CLI" enableCli)
|
|
||||||
(cmakeBool "ENABLE_DAEMON" enableDaemon)
|
|
||||||
(cmakeBool "ENABLE_GTK" enableGTK3)
|
|
||||||
(cmakeBool "ENABLE_MAC" false) # requires xcodebuild
|
|
||||||
(cmakeBool "ENABLE_QT" (enableQt5 || enableQt6))
|
|
||||||
(cmakeBool "INSTALL_LIB" installLib)
|
|
||||||
]
|
|
||||||
++ optionals stdenv.hostPlatform.isDarwin [
|
|
||||||
# Transmission sets this to 10.13 if not explicitly specified, see https://github.com/transmission/transmission/blob/0be7091eb12f4eb55f6690f313ef70a66795ee72/CMakeLists.txt#L7-L16.
|
|
||||||
"-DCMAKE_OSX_DEPLOYMENT_TARGET=${stdenv.hostPlatform.darwinMinVersion}"
|
|
||||||
];
|
|
||||||
|
|
||||||
postPatch = ''
|
|
||||||
# Clean third-party libraries to ensure system ones are used.
|
|
||||||
# Excluding gtest since it is hardcoded to vendored version. The rest of the listed libraries are not packaged.
|
|
||||||
pushd third-party
|
|
||||||
for f in *; do
|
|
||||||
if [[ ! $f =~ googletest|wildmat|wide-integer|jsonsl ]]; then
|
|
||||||
rm -r "$f"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
popd
|
|
||||||
rm \
|
|
||||||
cmake/FindFastFloat.cmake \
|
|
||||||
cmake/FindFmt.cmake \
|
|
||||||
cmake/FindUtfCpp.cmake
|
|
||||||
# Upstream uses different config file name.
|
|
||||||
substituteInPlace CMakeLists.txt --replace 'find_package(UtfCpp)' 'find_package(utf8cpp)'
|
|
||||||
|
|
||||||
# Use gettext even on Darwin
|
|
||||||
substituteInPlace libtransmission/utils.h \
|
|
||||||
--replace-fail '#if defined(HAVE_GETTEXT) && !defined(__APPLE__)' '#if defined(HAVE_GETTEXT)'
|
|
||||||
'';
|
|
||||||
|
|
||||||
nativeBuildInputs = [
|
|
||||||
pkg-config
|
|
||||||
cmake
|
|
||||||
python3
|
|
||||||
]
|
|
||||||
++ optionals enableGTK3 [ wrapGAppsHook3 ]
|
|
||||||
++ optionals enableQt5 [ qt5.wrapQtAppsHook ]
|
|
||||||
++ optionals enableQt6 [ qt6Packages.wrapQtAppsHook ];
|
|
||||||
|
|
||||||
buildInputs = [
|
|
||||||
curl
|
|
||||||
dht
|
|
||||||
fast-float
|
|
||||||
fmt
|
|
||||||
libb64
|
|
||||||
libdeflate
|
|
||||||
libevent
|
|
||||||
libnatpmp
|
|
||||||
libpsl
|
|
||||||
libutp
|
|
||||||
miniupnpc
|
|
||||||
openssl
|
|
||||||
pcre
|
|
||||||
utf8cpp
|
|
||||||
zlib
|
|
||||||
]
|
|
||||||
++ optionals enableQt5 (
|
|
||||||
with qt5;
|
|
||||||
[
|
|
||||||
qttools
|
|
||||||
qtbase
|
|
||||||
]
|
|
||||||
)
|
|
||||||
++ optionals enableQt6 (
|
|
||||||
with qt6Packages;
|
|
||||||
[
|
|
||||||
qttools
|
|
||||||
qtbase
|
|
||||||
qtsvg
|
|
||||||
]
|
|
||||||
)
|
|
||||||
++ optionals enableGTK3 [
|
|
||||||
gtkmm3
|
|
||||||
libpthread-stubs
|
|
||||||
]
|
|
||||||
++ optionals enableSystemd [ systemd ]
|
|
||||||
++ optionals stdenv.hostPlatform.isLinux [ inotify-tools ];
|
|
||||||
|
|
||||||
postInstall = ''
|
|
||||||
mkdir $apparmor
|
|
||||||
cat >$apparmor/bin.transmission-daemon <<EOF
|
|
||||||
abi <abi/4.0>,
|
|
||||||
include <tunables/global>
|
|
||||||
profile $out/bin/transmission-daemon {
|
|
||||||
include <abstractions/base>
|
|
||||||
include <abstractions/nameservice>
|
|
||||||
include <abstractions/ssl_certs>
|
|
||||||
include "${apparmorRules}"
|
|
||||||
@{PROC}/sys/kernel/random/uuid r,
|
|
||||||
@{PROC}/sys/vm/overcommit_memory r,
|
|
||||||
@{PROC}/@{pid}/environ r,
|
|
||||||
@{PROC}/@{pid}/mounts r,
|
|
||||||
/tmp/tr_session_id_* rwk,
|
|
||||||
|
|
||||||
$out/share/transmission/public_html/** r,
|
|
||||||
|
|
||||||
include if exists <local/bin.transmission-daemon>
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
install -Dm0444 -t $out/share/icons ../qt/icons/transmission.svg
|
|
||||||
'';
|
|
||||||
|
|
||||||
passthru.tests = {
|
|
||||||
apparmor = nixosTests.transmission_4; # starts the service with apparmor enabled
|
|
||||||
smoke-test = nixosTests.bittorrent;
|
|
||||||
};
|
|
||||||
|
|
||||||
meta = {
|
|
||||||
description = "Fast, easy and free BitTorrent client";
|
|
||||||
mainProgram =
|
|
||||||
if (enableQt5 || enableQt6) then
|
|
||||||
"transmission-qt"
|
|
||||||
else if enableGTK3 then
|
|
||||||
"transmission-gtk"
|
|
||||||
else
|
|
||||||
"transmission-cli";
|
|
||||||
longDescription = ''
|
|
||||||
Transmission is a BitTorrent client which features a simple interface
|
|
||||||
on top of a cross-platform back-end.
|
|
||||||
Feature spotlight:
|
|
||||||
* Uses fewer resources than other clients
|
|
||||||
* Native Mac, GTK and Qt GUI clients
|
|
||||||
* Daemon ideal for servers, embedded systems, and headless use
|
|
||||||
* All these can be remote controlled by Web and Terminal clients
|
|
||||||
* Bluetack (PeerGuardian) blocklists with automatic updates
|
|
||||||
* Full encryption, DHT, and PEX support
|
|
||||||
'';
|
|
||||||
homepage = "https://www.transmissionbt.com/";
|
|
||||||
license = with lib.licenses; [
|
|
||||||
gpl2Plus
|
|
||||||
mit
|
|
||||||
];
|
|
||||||
platforms = lib.platforms.unix;
|
|
||||||
};
|
|
||||||
})
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{ lib, coreutils, gnused, makeWrapper, stdenvNoCC, xprop, xwininfo }:
|
{ lib, coreutils, gnused, makeWrapper, stdenvNoCC, xorg }:
|
||||||
stdenvNoCC.mkDerivation rec {
|
stdenvNoCC.mkDerivation rec {
|
||||||
pname = "i3-get-window-criteria";
|
pname = "i3-get-window-criteria";
|
||||||
version = "0.1.0";
|
version = "0.1.0";
|
||||||
|
|
@ -22,8 +22,8 @@ stdenvNoCC.mkDerivation rec {
|
||||||
wrapperPath = lib.makeBinPath [
|
wrapperPath = lib.makeBinPath [
|
||||||
coreutils
|
coreutils
|
||||||
gnused
|
gnused
|
||||||
xprop
|
xorg.xprop
|
||||||
xwininfo
|
xorg.xwininfo
|
||||||
];
|
];
|
||||||
|
|
||||||
fixupPhase = ''
|
fixupPhase = ''
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@
|
||||||
self.packages.${system}.project
|
self.packages.${system}.project
|
||||||
];
|
];
|
||||||
|
|
||||||
packages = [
|
packages = with pkgs; [
|
||||||
self.checks.${system}.pre-commit.enabledPackages
|
self.checks.${system}.pre-commit.enabledPackages
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@
|
||||||
self.packages.${system}.project
|
self.packages.${system}.project
|
||||||
];
|
];
|
||||||
|
|
||||||
packages = [
|
packages = with pkgs; [
|
||||||
self.checks.${system}.pre-commit.enabledPackages
|
self.checks.${system}.pre-commit.enabledPackages
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue