Compare commits
46 commits
65962b3a43
...
1d61c985de
| Author | SHA1 | Date | |
|---|---|---|---|
| 1d61c985de | |||
| 3491fd5f58 | |||
| 52ed16ece6 | |||
| 05cc22af2a | |||
| 989f694611 | |||
| bd55ecc016 | |||
| 1dd1dbb917 | |||
| 439a6bc930 | |||
| e5bf5a3ba1 | |||
| a1cab7f606 | |||
| 0152907536 | |||
| 08f7c2bd79 | |||
| b8c649d5bf | |||
| 979814e9de | |||
| 215eb4c91a | |||
| 3510264186 | |||
| ec965800e4 | |||
| b1ade72383 | |||
| c823edf584 | |||
| 950cf4dd05 | |||
| f825d047b5 | |||
| d783b5f5ee | |||
| 8e6be43817 | |||
| 1f876d3e21 | |||
| 860c13ab1f | |||
| 7791ad0907 | |||
| ca98b8367c | |||
| 62ddec5c23 | |||
| 418494004b | |||
| 53569f17a6 | |||
| d48d5c45e0 | |||
| 36aa641ec0 | |||
| 2583cc6c12 | |||
| 262dc48425 | |||
| c1efc4316d | |||
| 4ef1b08f4e | |||
| 274d143031 | |||
| dfb3c353ec | |||
| 37e88c2707 | |||
| 1841ff391d | |||
| 458ea144c4 | |||
| abec0dd226 | |||
| b2758839e8 | |||
| 6fc81e45e9 | |||
| 9156a8211d | |||
| 5ae2eacd49 |
46 changed files with 842 additions and 352 deletions
68
flake.lock
generated
68
flake.lock
generated
|
|
@ -73,11 +73,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1741352980,
|
"lastModified": 1743550720,
|
||||||
"narHash": "sha256-+u2UunDA4Cl5Fci3m7S643HzKmIDAe+fiXrLqYsR2fs=",
|
"narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=",
|
||||||
"owner": "hercules-ci",
|
"owner": "hercules-ci",
|
||||||
"repo": "flake-parts",
|
"repo": "flake-parts",
|
||||||
"rev": "f4330d22f1c5d2ba72d3d22df5597d123fdb60a9",
|
"rev": "c621e8422220273271f52058f618c94e405bb0f5",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -108,10 +108,33 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"git-hooks": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": "flake-compat",
|
||||||
|
"gitignore": "gitignore",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1742649964,
|
||||||
|
"narHash": "sha256-DwOTp7nvfi8mRfuL1escHDXabVXFGT1VlPD1JHrtrco=",
|
||||||
|
"owner": "cachix",
|
||||||
|
"repo": "git-hooks.nix",
|
||||||
|
"rev": "dcf5072734cb576d2b0c59b2ac44f5050b5eac82",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "cachix",
|
||||||
|
"ref": "master",
|
||||||
|
"repo": "git-hooks.nix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"gitignore": {
|
"gitignore": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"pre-commit-hooks",
|
"git-hooks",
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
@ -136,11 +159,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1741955947,
|
"lastModified": 1743869639,
|
||||||
"narHash": "sha256-2lbURKclgKqBNm7hVRtWh0A7NrdsibD0EaWhahUVhhY=",
|
"narHash": "sha256-Xhe3whfRW/Ay05z9m1EZ1/AkbV1yo0tm1CbgjtCi4rQ=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "4e12151c9e014e2449e0beca2c0e9534b96a26b4",
|
"rev": "d094c6763c6ddb860580e7d3b4201f8f496a6836",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -152,11 +175,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1742069588,
|
"lastModified": 1744174375,
|
||||||
"narHash": "sha256-C7jVfohcGzdZRF6DO+ybyG/sqpo1h6bZi9T56sxLy+k=",
|
"narHash": "sha256-oxI9TLgnQbQ/WL0tIwVSIooLbXq4PW1QUhf5aQmXFgk=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "c80f6a7e10b39afcc1894e02ef785b1ad0b0d7e5",
|
"rev": "ef3a956f697525883b77192cbe208233ea0f8f79",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -191,38 +214,15 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"pre-commit-hooks": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-compat": "flake-compat",
|
|
||||||
"gitignore": "gitignore",
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1742058297,
|
|
||||||
"narHash": "sha256-b4SZc6TkKw8WQQssbN5O2DaCEzmFfvSTPYHlx/SFW9Y=",
|
|
||||||
"owner": "cachix",
|
|
||||||
"repo": "pre-commit-hooks.nix",
|
|
||||||
"rev": "59f17850021620cd348ad2e9c0c64f4e6325ce2a",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "cachix",
|
|
||||||
"ref": "master",
|
|
||||||
"repo": "pre-commit-hooks.nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"agenix": "agenix",
|
"agenix": "agenix",
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
"futils": "futils",
|
"futils": "futils",
|
||||||
|
"git-hooks": "git-hooks",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"nur": "nur",
|
"nur": "nur",
|
||||||
"pre-commit-hooks": "pre-commit-hooks",
|
|
||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -61,10 +61,10 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
pre-commit-hooks = {
|
git-hooks = {
|
||||||
type = "github";
|
type = "github";
|
||||||
owner = "cachix";
|
owner = "cachix";
|
||||||
repo = "pre-commit-hooks.nix";
|
repo = "git-hooks.nix";
|
||||||
ref = "master";
|
ref = "master";
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.follows = "nixpkgs";
|
nixpkgs.follows = "nixpkgs";
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{ inputs, ... }:
|
{ inputs, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
inputs.pre-commit-hooks.flakeModule
|
inputs.git-hooks.flakeModule
|
||||||
];
|
];
|
||||||
|
|
||||||
perSystem = { ... }: {
|
perSystem = { ... }: {
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
name = "NixOS-config";
|
name = "NixOS-config";
|
||||||
|
|
||||||
nativeBuildInputs = with pkgs; [
|
nativeBuildInputs = with pkgs; [
|
||||||
gitAndTools.pre-commit
|
|
||||||
nixpkgs-fmt
|
nixpkgs-fmt
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,11 @@ let
|
||||||
defaultModules = [
|
defaultModules = [
|
||||||
# Include generic settings
|
# Include generic settings
|
||||||
"${self}/modules/home"
|
"${self}/modules/home"
|
||||||
|
{
|
||||||
|
nixpkgs.overlays = (lib.attrValues self.overlays) ++ [
|
||||||
|
inputs.nur.overlays.default
|
||||||
|
];
|
||||||
|
}
|
||||||
{
|
{
|
||||||
# Basic user information defaults
|
# Basic user information defaults
|
||||||
home.username = lib.mkDefault "ambroisie";
|
home.username = lib.mkDefault "ambroisie";
|
||||||
|
|
@ -21,18 +26,15 @@ let
|
||||||
# * not letting me set `lib` as an extraSpecialArgs
|
# * not letting me set `lib` as an extraSpecialArgs
|
||||||
# * not respecting `nixpkgs.overlays` [1]
|
# * not respecting `nixpkgs.overlays` [1]
|
||||||
# [1]: https://github.com/nix-community/home-manager/issues/2954
|
# [1]: https://github.com/nix-community/home-manager/issues/2954
|
||||||
pkgs = import inputs.nixpkgs {
|
pkgs = inputs.nixpkgs.legacyPackages.${system};
|
||||||
inherit system;
|
|
||||||
|
|
||||||
overlays = (lib.attrValues self.overlays) ++ [
|
|
||||||
inputs.nur.overlays.default
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
modules = defaultModules ++ [
|
modules = defaultModules ++ [
|
||||||
"${self}/hosts/homes/${name}"
|
"${self}/hosts/homes/${name}"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# Use my extended lib in NixOS configuration
|
||||||
|
inherit (self) lib;
|
||||||
|
|
||||||
extraSpecialArgs = {
|
extraSpecialArgs = {
|
||||||
# Inject inputs to use them in global registry
|
# Inject inputs to use them in global registry
|
||||||
inherit inputs;
|
inherit inputs;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ let
|
||||||
defaultModules = [
|
defaultModules = [
|
||||||
{
|
{
|
||||||
# Let 'nixos-version --json' know about the Git revision
|
# Let 'nixos-version --json' know about the Git revision
|
||||||
system.configurationRevision = self.rev or "dirty";
|
system.configurationRevision = self.rev or self.dirtyRev or "dirty";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
nixpkgs.overlays = (lib.attrValues self.overlays) ++ [
|
nixpkgs.overlays = (lib.attrValues self.overlays) ++ [
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,8 @@ in
|
||||||
|
|
||||||
"pyload/credentials.age".publicKeys = all;
|
"pyload/credentials.age".publicKeys = all;
|
||||||
|
|
||||||
|
"servarr/autobrr/session-secret.age".publicKeys = all;
|
||||||
|
|
||||||
"sso/auth-key.age" = {
|
"sso/auth-key.age" = {
|
||||||
owner = "nginx-sso";
|
owner = "nginx-sso";
|
||||||
publicKeys = all;
|
publicKeys = all;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
age-encryption.org/v1
|
||||||
|
-> ssh-ed25519 cKojmg bu09lB+fjaPP31cUQZP6EqSPuseucgNK7k9vAS08iS0
|
||||||
|
+NGL+b2QD/qGo6hqHvosAXzHZtDvfodmPdcgnrKlD1o
|
||||||
|
-> ssh-ed25519 jPowng QDCdRBGWhtdvvMCiDH52cZHz1/W7aomhTatZ4+9IKwI
|
||||||
|
Ou3jjV/O55G1CPgGS33l3eWhhYWrVdwVNPSiE14d5rE
|
||||||
|
--- q0ssmpG50OX1WaNSInc2hbtH3DbTwQGDU74VGEoMh94
|
||||||
|
¯mCùº<C3B9>Æ‘'hK.Ðì/™Xu(€«Õ×g$½'¼šM{fK˜”!ÛMZ²oR÷®ˆüÎÕ<C38E>ÍŸö;yb
|
||||||
|
|
@ -51,9 +51,9 @@ in
|
||||||
passwordFile = secrets."forgejo/mail-password".path;
|
passwordFile = secrets."forgejo/mail-password".path;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
# Meta-indexers
|
# Home inventory
|
||||||
indexers = {
|
homebox = {
|
||||||
prowlarr.enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
# Jellyfin media server
|
# Jellyfin media server
|
||||||
jellyfin.enable = true;
|
jellyfin.enable = true;
|
||||||
|
|
@ -144,11 +144,21 @@ in
|
||||||
sabnzbd.enable = true;
|
sabnzbd.enable = true;
|
||||||
# The whole *arr software suite
|
# The whole *arr software suite
|
||||||
servarr = {
|
servarr = {
|
||||||
enable = true;
|
enableAll = true;
|
||||||
|
autobrr = {
|
||||||
|
sessionSecretFile = secrets."servarr/autobrr/session-secret".path;
|
||||||
|
};
|
||||||
# ... But not Lidarr because I don't care for music that much
|
# ... But not Lidarr because I don't care for music that much
|
||||||
lidarr = {
|
lidarr = {
|
||||||
enable = false;
|
enable = false;
|
||||||
};
|
};
|
||||||
|
# I only use Prowlarr nowadays
|
||||||
|
jackett = {
|
||||||
|
enable = false;
|
||||||
|
};
|
||||||
|
nzbhydra = {
|
||||||
|
enable = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
# Because I still need to play sysadmin
|
# Because I still need to play sysadmin
|
||||||
ssh-server.enable = true;
|
ssh-server.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
./bluetooth
|
./bluetooth
|
||||||
./calibre
|
./calibre
|
||||||
./comma
|
./comma
|
||||||
|
./delta
|
||||||
./dircolors
|
./dircolors
|
||||||
./direnv
|
./direnv
|
||||||
./discord
|
./discord
|
||||||
|
|
@ -23,6 +24,7 @@
|
||||||
./gtk
|
./gtk
|
||||||
./htop
|
./htop
|
||||||
./jq
|
./jq
|
||||||
|
./jujutsu
|
||||||
./keyboard
|
./keyboard
|
||||||
./mail
|
./mail
|
||||||
./mpv
|
./mpv
|
||||||
|
|
|
||||||
85
modules/home/delta/default.nix
Normal file
85
modules/home/delta/default.nix
Normal file
|
|
@ -0,0 +1,85 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.home.delta;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.home.delta = with lib; {
|
||||||
|
enable = my.mkDisableOption "delta configuration";
|
||||||
|
|
||||||
|
package = mkPackageOption pkgs "delta" { };
|
||||||
|
|
||||||
|
git = {
|
||||||
|
enable = my.mkDisableOption "git integration";
|
||||||
|
};
|
||||||
|
|
||||||
|
jujutsu = {
|
||||||
|
enable = my.mkDisableOption "jujutsu integration";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
assertions = [
|
||||||
|
{
|
||||||
|
# For its configuration
|
||||||
|
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 ];
|
||||||
|
|
||||||
|
programs.git = lib.mkIf cfg.git.enable {
|
||||||
|
delta = {
|
||||||
|
enable = true;
|
||||||
|
inherit (cfg) package;
|
||||||
|
|
||||||
|
options = {
|
||||||
|
features = "diff-highlight decorations";
|
||||||
|
|
||||||
|
# Less jarring style for `diff-highlight` emulation
|
||||||
|
diff-highlight = {
|
||||||
|
minus-style = "red";
|
||||||
|
minus-non-emph-style = "red";
|
||||||
|
minus-emph-style = "bold red 52";
|
||||||
|
|
||||||
|
plus-style = "green";
|
||||||
|
plus-non-emph-style = "green";
|
||||||
|
plus-emph-style = "bold green 22";
|
||||||
|
|
||||||
|
whitespace-error-style = "reverse red";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Personal preference for easier reading
|
||||||
|
decorations = {
|
||||||
|
commit-style = "raw"; # Do not recolor meta information
|
||||||
|
keep-plus-minus-markers = true;
|
||||||
|
paging = "always";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
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 = "delta";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -42,34 +42,6 @@ in
|
||||||
|
|
||||||
lfs.enable = true;
|
lfs.enable = true;
|
||||||
|
|
||||||
delta = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
options = {
|
|
||||||
features = "diff-highlight decorations";
|
|
||||||
|
|
||||||
# Less jarring style for `diff-highlight` emulation
|
|
||||||
diff-highlight = {
|
|
||||||
minus-style = "red";
|
|
||||||
minus-non-emph-style = "red";
|
|
||||||
minus-emph-style = "bold red 52";
|
|
||||||
|
|
||||||
plus-style = "green";
|
|
||||||
plus-non-emph-style = "green";
|
|
||||||
plus-emph-style = "bold green 22";
|
|
||||||
|
|
||||||
whitespace-error-style = "reverse red";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Personal preference for easier reading
|
|
||||||
decorations = {
|
|
||||||
commit-style = "raw"; # Do not recolor meta information
|
|
||||||
keep-plus-minus-markers = true;
|
|
||||||
paging = "always";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# There's more
|
# There's more
|
||||||
extraConfig = {
|
extraConfig = {
|
||||||
# Makes it a bit more readable
|
# Makes it a bit more readable
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ in
|
||||||
strings = "0;32";
|
strings = "0;32";
|
||||||
arrays = "1;39";
|
arrays = "1;39";
|
||||||
objects = "1;39";
|
objects = "1;39";
|
||||||
|
objectKeys = "1;34";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
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 = "";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -31,8 +31,6 @@ local keys = {
|
||||||
{ "[u", desc = "URL encode" },
|
{ "[u", desc = "URL encode" },
|
||||||
{ "[x", desc = "XML encode" },
|
{ "[x", desc = "XML encode" },
|
||||||
{ "[y", desc = "C string encode" },
|
{ "[y", desc = "C string encode" },
|
||||||
-- Custom
|
|
||||||
{ "[d", lsp.goto_prev_diagnostic, desc = "Previous diagnostic" },
|
|
||||||
|
|
||||||
-- Next
|
-- Next
|
||||||
{ "]", group = "Next" },
|
{ "]", group = "Next" },
|
||||||
|
|
@ -62,8 +60,6 @@ local keys = {
|
||||||
{ "]u", desc = "URL decode" },
|
{ "]u", desc = "URL decode" },
|
||||||
{ "]x", desc = "XML decode" },
|
{ "]x", desc = "XML decode" },
|
||||||
{ "]y", desc = "C string decode" },
|
{ "]y", desc = "C string decode" },
|
||||||
-- Custom
|
|
||||||
{ "]d", lsp.goto_next_diagnostic, desc = "Next diagnostic" },
|
|
||||||
|
|
||||||
-- Enable option
|
-- Enable option
|
||||||
{ "[o", group = "Enable option" },
|
{ "[o", group = "Enable option" },
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,6 @@ in
|
||||||
# LSP and linting
|
# LSP and linting
|
||||||
nvim-lspconfig # Easy LSP configuration
|
nvim-lspconfig # Easy LSP configuration
|
||||||
lsp-format-nvim # Simplified formatting configuration
|
lsp-format-nvim # Simplified formatting configuration
|
||||||
lsp_lines-nvim # Show diagnostics *over* regions
|
|
||||||
none-ls-nvim # LSP integration for linters and formatters
|
none-ls-nvim # LSP integration for linters and formatters
|
||||||
nvim-treesitter.withAllGrammars # Better highlighting
|
nvim-treesitter.withAllGrammars # Better highlighting
|
||||||
nvim-treesitter-textobjects # More textobjects
|
nvim-treesitter-textobjects # More textobjects
|
||||||
|
|
@ -67,7 +66,6 @@ in
|
||||||
|
|
||||||
# Completion
|
# Completion
|
||||||
luasnip # Snippet manager compatible with LSP
|
luasnip # Snippet manager compatible with LSP
|
||||||
friendly-snippets # LSP snippets collection
|
|
||||||
nvim-cmp # Completion engine
|
nvim-cmp # Completion engine
|
||||||
cmp-async-path # More responsive path completion
|
cmp-async-path # More responsive path completion
|
||||||
cmp-buffer # Words from open buffers
|
cmp-buffer # Words from open buffers
|
||||||
|
|
|
||||||
|
|
@ -68,8 +68,6 @@ set listchars=tab:>─,trail:·,nbsp:¤
|
||||||
|
|
||||||
" Use patience diff
|
" Use patience diff
|
||||||
set diffopt+=algorithm:patience
|
set diffopt+=algorithm:patience
|
||||||
" Align similar lines in each hunk
|
|
||||||
set diffopt+=linematch:50
|
|
||||||
|
|
||||||
" Don't redraw when executing macros
|
" Don't redraw when executing macros
|
||||||
set lazyredraw
|
set lazyredraw
|
||||||
|
|
|
||||||
|
|
@ -3,43 +3,6 @@ local M = {}
|
||||||
-- Simplified LSP formatting configuration
|
-- Simplified LSP formatting configuration
|
||||||
local lsp_format = require("lsp-format")
|
local lsp_format = require("lsp-format")
|
||||||
|
|
||||||
--- Move to the next/previous diagnostic, automatically showing the diagnostics
|
|
||||||
--- float if necessary.
|
|
||||||
--- @param forward bool whether to go forward or backwards
|
|
||||||
local function goto_diagnostic(forward)
|
|
||||||
vim.validate({
|
|
||||||
forward = { forward, "boolean" },
|
|
||||||
})
|
|
||||||
|
|
||||||
local opts = {
|
|
||||||
float = false,
|
|
||||||
}
|
|
||||||
|
|
||||||
-- Only show floating diagnostics if they are otherwise not displayed
|
|
||||||
local config = vim.diagnostic.config()
|
|
||||||
if not (config.virtual_text or config.virtual_lines) then
|
|
||||||
opts.float = true
|
|
||||||
end
|
|
||||||
|
|
||||||
if forward then
|
|
||||||
vim.diagnostic.goto_next(opts)
|
|
||||||
else
|
|
||||||
vim.diagnostic.goto_prev(opts)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Move to the next diagnostic, automatically showing the diagnostics float if
|
|
||||||
--- necessary.
|
|
||||||
M.goto_next_diagnostic = function()
|
|
||||||
goto_diagnostic(true)
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Move to the previous diagnostic, automatically showing the diagnostics float
|
|
||||||
--- if necessary.
|
|
||||||
M.goto_prev_diagnostic = function()
|
|
||||||
goto_diagnostic(false)
|
|
||||||
end
|
|
||||||
|
|
||||||
--- shared LSP configuration callback
|
--- shared LSP configuration callback
|
||||||
--- @param client native client configuration
|
--- @param client native client configuration
|
||||||
--- @param bufnr int? buffer number of the attached client
|
--- @param bufnr int? buffer number of the attached client
|
||||||
|
|
@ -79,6 +42,10 @@ M.on_attach = function(client, bufnr)
|
||||||
vim.diagnostic.config({
|
vim.diagnostic.config({
|
||||||
virtual_text = text,
|
virtual_text = text,
|
||||||
virtual_lines = lines,
|
virtual_lines = lines,
|
||||||
|
jump = {
|
||||||
|
-- Show float on jump if no diagnostic text is otherwise shown
|
||||||
|
float = not (text or lines),
|
||||||
|
},
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ end
|
||||||
--- @param bufnr int? buffer number
|
--- @param bufnr int? buffer number
|
||||||
--- @return table all active LSP client names
|
--- @return table all active LSP client names
|
||||||
M.list_lsp_clients = function(bufnr)
|
M.list_lsp_clients = function(bufnr)
|
||||||
local clients = vim.lsp.get_active_clients({ bufnr = bufnr })
|
local clients = vim.lsp.get_clients({ bufnr = bufnr })
|
||||||
local names = {}
|
local names = {}
|
||||||
|
|
||||||
for _, client in ipairs(clients) do
|
for _, client in ipairs(clients) do
|
||||||
|
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
-- Intercept all fold commands
|
|
||||||
-- stylua: ignore
|
|
||||||
vim.g.fastfold_fold_command_suffixes = {
|
|
||||||
"x", "X", "a", "A", "o", "O", "c", "C", "r", "R", "m", "M", "i", "n", "N",
|
|
||||||
}
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
local lsp_lines = require("lsp_lines")
|
|
||||||
|
|
||||||
lsp_lines.setup()
|
|
||||||
|
|
@ -16,6 +16,10 @@ vim.diagnostic.config({
|
||||||
update_in_insert = false,
|
update_in_insert = false,
|
||||||
-- Show highest severity first
|
-- Show highest severity first
|
||||||
severity_sort = true,
|
severity_sort = true,
|
||||||
|
jump = {
|
||||||
|
-- Show float on diagnostic jumps
|
||||||
|
float = true,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Inform servers we are able to do completion, snippets, etc...
|
-- Inform servers we are able to do completion, snippets, etc...
|
||||||
|
|
@ -96,6 +100,13 @@ if utils.is_executable("starpls") then
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Generic
|
-- Generic
|
||||||
|
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
|
if utils.is_executable("typos-lsp") then
|
||||||
lspconfig.typos_lsp.setup({
|
lspconfig.typos_lsp.setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
local lualine = require("lualine")
|
local lualine = require("lualine")
|
||||||
|
local oil = require("oil")
|
||||||
local utils = require("ambroisie.utils")
|
local utils = require("ambroisie.utils")
|
||||||
|
|
||||||
local function list_spell_languages()
|
local function list_spell_languages()
|
||||||
|
|
@ -30,7 +31,7 @@ lualine.setup({
|
||||||
{ "mode" },
|
{ "mode" },
|
||||||
},
|
},
|
||||||
lualine_b = {
|
lualine_b = {
|
||||||
{ "FugitiveHead" },
|
{ "branch" },
|
||||||
{ "filename", symbols = { readonly = "🔒" } },
|
{ "filename", symbols = { readonly = "🔒" } },
|
||||||
},
|
},
|
||||||
lualine_c = {
|
lualine_c = {
|
||||||
|
|
@ -57,5 +58,21 @@ lualine.setup({
|
||||||
extensions = {
|
extensions = {
|
||||||
"fugitive",
|
"fugitive",
|
||||||
"quickfix",
|
"quickfix",
|
||||||
|
{
|
||||||
|
sections = {
|
||||||
|
lualine_a = {
|
||||||
|
{ "mode" },
|
||||||
|
},
|
||||||
|
lualine_b = {
|
||||||
|
{ "branch" },
|
||||||
|
},
|
||||||
|
lualine_c = {
|
||||||
|
function()
|
||||||
|
return vim.fn.fnamemodify(oil.get_current_dir(), ":~")
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
filetypes = { "oil" },
|
||||||
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
require("luasnip.loaders.from_vscode").lazy_load()
|
|
||||||
|
|
@ -87,19 +87,16 @@ in
|
||||||
# Modal editing is life, but CLI benefits from emacs gymnastics
|
# Modal editing is life, but CLI benefits from emacs gymnastics
|
||||||
defaultKeymap = "emacs";
|
defaultKeymap = "emacs";
|
||||||
|
|
||||||
|
initContent = lib.mkMerge [
|
||||||
# Make those happen early to avoid doing double the work
|
# Make those happen early to avoid doing double the work
|
||||||
initExtraFirst = lib.mkBefore ''
|
(lib.mkBefore (lib.optionalString cfg.launchTmux ''
|
||||||
${
|
|
||||||
lib.optionalString cfg.launchTmux ''
|
|
||||||
# Launch tmux unless already inside one
|
# Launch tmux unless already inside one
|
||||||
if [ -z "$TMUX" ]; then
|
if [ -z "$TMUX" ]; then
|
||||||
exec tmux new-session
|
exec tmux new-session
|
||||||
fi
|
fi
|
||||||
''
|
''))
|
||||||
}
|
|
||||||
'';
|
|
||||||
|
|
||||||
initExtra = lib.mkAfter ''
|
(lib.mkAfter ''
|
||||||
source ${./completion-styles.zsh}
|
source ${./completion-styles.zsh}
|
||||||
source ${./extra-mappings.zsh}
|
source ${./extra-mappings.zsh}
|
||||||
source ${./options.zsh}
|
source ${./options.zsh}
|
||||||
|
|
@ -108,7 +105,8 @@ in
|
||||||
if [ -f "$ZDOTDIR/zshrc.local" ]; then
|
if [ -f "$ZDOTDIR/zshrc.local" ]; then
|
||||||
source "$ZDOTDIR/zshrc.local"
|
source "$ZDOTDIR/zshrc.local"
|
||||||
fi
|
fi
|
||||||
'';
|
'')
|
||||||
|
];
|
||||||
|
|
||||||
localVariables = {
|
localVariables = {
|
||||||
# I like having the full path
|
# I like having the full path
|
||||||
|
|
@ -151,7 +149,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
# Use OSC-777 to send the notification through SSH
|
# Use OSC-777 to send the notification through SSH
|
||||||
initExtra = lib.mkIf cfg.notify.ssh.useOsc777 ''
|
initContent = lib.mkIf cfg.notify.ssh.useOsc777 ''
|
||||||
done_send_notification() {
|
done_send_notification() {
|
||||||
local exit_status="$1"
|
local exit_status="$1"
|
||||||
local title="$2"
|
local title="$2"
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@
|
||||||
./gitea
|
./gitea
|
||||||
./grocy
|
./grocy
|
||||||
./homebox
|
./homebox
|
||||||
./indexers
|
|
||||||
./jellyfin
|
./jellyfin
|
||||||
./komga
|
./komga
|
||||||
./lohr
|
./lohr
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,11 @@ in
|
||||||
services.homebox = {
|
services.homebox = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
# Automatic PostgreSQL provisioning
|
||||||
|
database = {
|
||||||
|
createLocally = true;
|
||||||
|
};
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
# FIXME: mailer?
|
# FIXME: mailer?
|
||||||
HBOX_WEB_PORT = toString cfg.port;
|
HBOX_WEB_PORT = toString cfg.port;
|
||||||
|
|
@ -28,6 +33,7 @@ in
|
||||||
my.services.nginx.virtualHosts = {
|
my.services.nginx.virtualHosts = {
|
||||||
homebox = {
|
homebox = {
|
||||||
inherit (cfg) port;
|
inherit (cfg) port;
|
||||||
|
websocketsLocations = [ "/api" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,78 +0,0 @@
|
||||||
# Torrent and usenet meta-indexers
|
|
||||||
{ config, lib, ... }:
|
|
||||||
let
|
|
||||||
cfg = config.my.services.indexers;
|
|
||||||
|
|
||||||
jackettPort = 9117;
|
|
||||||
nzbhydraPort = 5076;
|
|
||||||
prowlarrPort = 9696;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.my.services.indexers = with lib; {
|
|
||||||
jackett.enable = mkEnableOption "Jackett torrent meta-indexer";
|
|
||||||
nzbhydra.enable = mkEnableOption "NZBHydra2 usenet meta-indexer";
|
|
||||||
prowlarr.enable = mkEnableOption "Prowlarr torrent & usenet meta-indexer";
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkMerge [
|
|
||||||
(lib.mkIf cfg.jackett.enable {
|
|
||||||
services.jackett = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Jackett wants to eat *all* my RAM if left to its own devices
|
|
||||||
systemd.services.jackett = {
|
|
||||||
serviceConfig = {
|
|
||||||
MemoryHigh = "15%";
|
|
||||||
MemoryMax = "25%";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
my.services.nginx.virtualHosts = {
|
|
||||||
jackett = {
|
|
||||||
port = jackettPort;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
})
|
|
||||||
|
|
||||||
(lib.mkIf cfg.nzbhydra.enable {
|
|
||||||
services.nzbhydra2 = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
my.services.nginx.virtualHosts = {
|
|
||||||
nzbhydra = {
|
|
||||||
port = nzbhydraPort;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
})
|
|
||||||
|
|
||||||
(lib.mkIf cfg.prowlarr.enable {
|
|
||||||
services.prowlarr = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
my.services.nginx.virtualHosts = {
|
|
||||||
prowlarr = {
|
|
||||||
port = prowlarrPort;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
services.fail2ban.jails = {
|
|
||||||
prowlarr = ''
|
|
||||||
enabled = true
|
|
||||||
filter = prowlarr
|
|
||||||
action = iptables-allports
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.etc = {
|
|
||||||
"fail2ban/filter.d/prowlarr.conf".text = ''
|
|
||||||
[Definition]
|
|
||||||
failregex = ^.*\|Warn\|Auth\|Auth-Failure ip <HOST> username .*$
|
|
||||||
journalmatch = _SYSTEMD_UNIT=prowlarr.service
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
})
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -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.nextcloud30;
|
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
modules/nixos/services/servarr/autobrr.nix
Normal file
62
modules/nixos/services/servarr/autobrr.nix
Normal file
|
|
@ -0,0 +1,62 @@
|
||||||
|
# IRC-based
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.services.servarr.autobrr;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.services.servarr.autobrr = with lib; {
|
||||||
|
enable = mkEnableOption "autobrr IRC announce tracker" // {
|
||||||
|
default = config.my.services.servarr.enableAll;
|
||||||
|
};
|
||||||
|
|
||||||
|
port = mkOption {
|
||||||
|
type = types.port;
|
||||||
|
default = 7474;
|
||||||
|
example = 8080;
|
||||||
|
description = "Internal port for webui";
|
||||||
|
};
|
||||||
|
|
||||||
|
sessionSecretFile = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
example = "/run/secrets/autobrr-secret.txt";
|
||||||
|
description = ''
|
||||||
|
File containing the session secret.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
services.autobrr = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
inherit (cfg) port;
|
||||||
|
checkForUpdates = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
secretFile = cfg.sessionSecretFile;
|
||||||
|
};
|
||||||
|
|
||||||
|
my.services.nginx.virtualHosts = {
|
||||||
|
autobrr = {
|
||||||
|
inherit (cfg) port;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.fail2ban.jails = {
|
||||||
|
autobrr = ''
|
||||||
|
enabled = true
|
||||||
|
filter = autobrr
|
||||||
|
action = iptables-allports
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.etc = {
|
||||||
|
"fail2ban/filter.d/autobrr.conf".text = ''
|
||||||
|
[Definition]
|
||||||
|
failregex = ^.*Auth: invalid login \[.*\] from: <HOST>$
|
||||||
|
journalmatch = _SYSTEMD_UNIT=autobrr.service
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
37
modules/nixos/services/servarr/bazarr.nix
Normal file
37
modules/nixos/services/servarr/bazarr.nix
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.services.servarr.bazarr;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.services.servarr.bazarr = with lib; {
|
||||||
|
enable = lib.mkEnableOption "Bazarr" // {
|
||||||
|
default = config.my.services.servarr.enableAll;
|
||||||
|
};
|
||||||
|
|
||||||
|
port = mkOption {
|
||||||
|
type = types.port;
|
||||||
|
default = 6767;
|
||||||
|
example = 8080;
|
||||||
|
description = "Internal port for webui";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
services.bazarr = {
|
||||||
|
enable = true;
|
||||||
|
group = "media";
|
||||||
|
listenPort = cfg.port;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Set-up media group
|
||||||
|
users.groups.media = { };
|
||||||
|
|
||||||
|
my.services.nginx.virtualHosts = {
|
||||||
|
bazarr = {
|
||||||
|
inherit (cfg) port;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Bazarr does not log authentication failures...
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -2,99 +2,21 @@
|
||||||
# Relevant link [1].
|
# Relevant link [1].
|
||||||
#
|
#
|
||||||
# [1]: https://youtu.be/I26Ql-uX6AM
|
# [1]: https://youtu.be/I26Ql-uX6AM
|
||||||
{ config, lib, ... }:
|
{ lib, ... }:
|
||||||
let
|
|
||||||
cfg = config.my.services.servarr;
|
|
||||||
|
|
||||||
ports = {
|
|
||||||
bazarr = 6767;
|
|
||||||
lidarr = 8686;
|
|
||||||
radarr = 7878;
|
|
||||||
readarr = 8787;
|
|
||||||
sonarr = 8989;
|
|
||||||
};
|
|
||||||
|
|
||||||
mkService = service: {
|
|
||||||
services.${service} = {
|
|
||||||
enable = true;
|
|
||||||
group = "media";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
mkRedirection = service: {
|
|
||||||
my.services.nginx.virtualHosts = {
|
|
||||||
${service} = {
|
|
||||||
port = ports.${service};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
mkFail2Ban = service: lib.mkIf cfg.${service}.enable {
|
|
||||||
services.fail2ban.jails = {
|
|
||||||
${service} = ''
|
|
||||||
enabled = true
|
|
||||||
filter = ${service}
|
|
||||||
action = iptables-allports
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.etc = {
|
|
||||||
"fail2ban/filter.d/${service}.conf".text = ''
|
|
||||||
[Definition]
|
|
||||||
failregex = ^.*\|Warn\|Auth\|Auth-Failure ip <HOST> username .*$
|
|
||||||
journalmatch = _SYSTEMD_UNIT=${service}.service
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
mkFullConfig = service: lib.mkIf cfg.${service}.enable (lib.mkMerge [
|
|
||||||
(mkService service)
|
|
||||||
(mkRedirection service)
|
|
||||||
]);
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
|
imports = [
|
||||||
|
./autobrr.nix
|
||||||
|
./bazarr.nix
|
||||||
|
./jackett.nix
|
||||||
|
./nzbhydra.nix
|
||||||
|
./prowlarr.nix
|
||||||
|
(import ./starr.nix "lidarr")
|
||||||
|
(import ./starr.nix "radarr")
|
||||||
|
(import ./starr.nix "readarr")
|
||||||
|
(import ./starr.nix "sonarr")
|
||||||
|
];
|
||||||
|
|
||||||
options.my.services.servarr = {
|
options.my.services.servarr = {
|
||||||
enable = lib.mkEnableOption "Media automation";
|
enableAll = lib.mkEnableOption "media automation suite";
|
||||||
|
|
||||||
bazarr = {
|
|
||||||
enable = lib.my.mkDisableOption "Bazarr";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
lidarr = {
|
|
||||||
enable = lib.my.mkDisableOption "Lidarr";
|
|
||||||
};
|
|
||||||
|
|
||||||
radarr = {
|
|
||||||
enable = lib.my.mkDisableOption "Radarr";
|
|
||||||
};
|
|
||||||
|
|
||||||
readarr = {
|
|
||||||
enable = lib.my.mkDisableOption "Readarr";
|
|
||||||
};
|
|
||||||
|
|
||||||
sonarr = {
|
|
||||||
enable = lib.my.mkDisableOption "Sonarr";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable (lib.mkMerge [
|
|
||||||
{
|
|
||||||
# Set-up media group
|
|
||||||
users.groups.media = { };
|
|
||||||
}
|
|
||||||
# Bazarr does not log authentication failures...
|
|
||||||
(mkFullConfig "bazarr")
|
|
||||||
# Lidarr for music
|
|
||||||
(mkFullConfig "lidarr")
|
|
||||||
(mkFail2Ban "lidarr")
|
|
||||||
# Radarr for movies
|
|
||||||
(mkFullConfig "radarr")
|
|
||||||
(mkFail2Ban "radarr")
|
|
||||||
# Readarr for books
|
|
||||||
(mkFullConfig "readarr")
|
|
||||||
(mkFail2Ban "readarr")
|
|
||||||
# Sonarr for shows
|
|
||||||
(mkFullConfig "sonarr")
|
|
||||||
(mkFail2Ban "sonarr")
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
41
modules/nixos/services/servarr/jackett.nix
Normal file
41
modules/nixos/services/servarr/jackett.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.services.servarr.jackett;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.services.servarr.jackett = with lib; {
|
||||||
|
enable = lib.mkEnableOption "Jackett" // {
|
||||||
|
default = config.my.services.servarr.enableAll;
|
||||||
|
};
|
||||||
|
|
||||||
|
port = mkOption {
|
||||||
|
type = types.port;
|
||||||
|
default = 9117;
|
||||||
|
example = 8080;
|
||||||
|
description = "Internal port for webui";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
services.jackett = {
|
||||||
|
enable = true;
|
||||||
|
inherit (cfg) port;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Jackett wants to eat *all* my RAM if left to its own devices
|
||||||
|
systemd.services.jackett = {
|
||||||
|
serviceConfig = {
|
||||||
|
MemoryHigh = "15%";
|
||||||
|
MemoryMax = "25%";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
my.services.nginx.virtualHosts = {
|
||||||
|
jackett = {
|
||||||
|
inherit (cfg) port;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Jackett does not log authentication failures...
|
||||||
|
};
|
||||||
|
}
|
||||||
26
modules/nixos/services/servarr/nzbhydra.nix
Normal file
26
modules/nixos/services/servarr/nzbhydra.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.services.servarr.nzbhydra;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.services.servarr.nzbhydra = with lib; {
|
||||||
|
enable = lib.mkEnableOption "NZBHydra2" // {
|
||||||
|
default = config.my.services.servarr.enableAll;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
services.nzbhydra2 = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
my.services.nginx.virtualHosts = {
|
||||||
|
nzbhydra = {
|
||||||
|
port = 5076;
|
||||||
|
websocketsLocations = [ "/" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# NZBHydra2 does not log authentication failures...
|
||||||
|
};
|
||||||
|
}
|
||||||
53
modules/nixos/services/servarr/prowlarr.nix
Normal file
53
modules/nixos/services/servarr/prowlarr.nix
Normal file
|
|
@ -0,0 +1,53 @@
|
||||||
|
# Torrent and NZB indexer
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.services.servarr.prowlarr;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.services.servarr.prowlarr = with lib; {
|
||||||
|
enable = lib.mkEnableOption "Prowlarr" // {
|
||||||
|
default = config.my.services.servarr.enableAll;
|
||||||
|
};
|
||||||
|
|
||||||
|
port = mkOption {
|
||||||
|
type = types.port;
|
||||||
|
default = 9696;
|
||||||
|
example = 8080;
|
||||||
|
description = "Internal port for webui";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
services.prowlarr = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
server = {
|
||||||
|
port = cfg.port;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
my.services.nginx.virtualHosts = {
|
||||||
|
prowlarr = {
|
||||||
|
inherit (cfg) port;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.fail2ban.jails = {
|
||||||
|
prowlarr = ''
|
||||||
|
enabled = true
|
||||||
|
filter = prowlarr
|
||||||
|
action = iptables-allports
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.etc = {
|
||||||
|
"fail2ban/filter.d/prowlarr.conf".text = ''
|
||||||
|
[Definition]
|
||||||
|
failregex = ^.*\|Warn\|Auth\|Auth-Failure ip <HOST> username .*$
|
||||||
|
journalmatch = _SYSTEMD_UNIT=prowlarr.service
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
64
modules/nixos/services/servarr/starr.nix
Normal file
64
modules/nixos/services/servarr/starr.nix
Normal file
|
|
@ -0,0 +1,64 @@
|
||||||
|
# Templated *arr configuration
|
||||||
|
starr:
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.services.servarr.${starr};
|
||||||
|
ports = {
|
||||||
|
lidarr = 8686;
|
||||||
|
radarr = 7878;
|
||||||
|
readarr = 8787;
|
||||||
|
sonarr = 8989;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.services.servarr.${starr} = with lib; {
|
||||||
|
enable = lib.mkEnableOption (lib.toSentenceCase starr) // {
|
||||||
|
default = config.my.services.servarr.enableAll;
|
||||||
|
};
|
||||||
|
|
||||||
|
port = mkOption {
|
||||||
|
type = types.port;
|
||||||
|
default = ports.${starr};
|
||||||
|
example = 8080;
|
||||||
|
description = "Internal port for webui";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
services.${starr} = {
|
||||||
|
enable = true;
|
||||||
|
group = "media";
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
server = {
|
||||||
|
port = cfg.port;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Set-up media group
|
||||||
|
users.groups.media = { };
|
||||||
|
|
||||||
|
my.services.nginx.virtualHosts = {
|
||||||
|
${starr} = {
|
||||||
|
port = cfg.port;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.fail2ban.jails = {
|
||||||
|
${starr} = ''
|
||||||
|
enabled = true
|
||||||
|
filter = ${starr}
|
||||||
|
action = iptables-allports
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.etc = {
|
||||||
|
"fail2ban/filter.d/${starr}.conf".text = ''
|
||||||
|
[Definition]
|
||||||
|
failregex = ^.*\|Warn\|Auth\|Auth-Failure ip <HOST> username .*$
|
||||||
|
journalmatch = _SYSTEMD_UNIT=${starr}.service
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -16,19 +16,18 @@
|
||||||
ref = "nixos-unstable";
|
ref = "nixos-unstable";
|
||||||
};
|
};
|
||||||
|
|
||||||
pre-commit-hooks = {
|
git-hooks = {
|
||||||
type = "github";
|
type = "github";
|
||||||
owner = "cachix";
|
owner = "cachix";
|
||||||
repo = "pre-commit-hooks.nix";
|
repo = "git-hooks.nix";
|
||||||
ref = "master";
|
ref = "master";
|
||||||
inputs = {
|
inputs = {
|
||||||
flake-utils.follows = "futils";
|
|
||||||
nixpkgs.follows = "nixpkgs";
|
nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, futils, nixpkgs, pre-commit-hooks }:
|
outputs = { self, futils, nixpkgs, git-hooks }:
|
||||||
{
|
{
|
||||||
overlays = {
|
overlays = {
|
||||||
default = final: _prev: {
|
default = final: _prev: {
|
||||||
|
|
@ -69,7 +68,7 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
pre-commit = pre-commit-hooks.lib.${system}.run {
|
pre-commit = git-hooks.lib.${system}.run {
|
||||||
src = self;
|
src = self;
|
||||||
|
|
||||||
hooks = {
|
hooks = {
|
||||||
|
|
@ -92,12 +91,12 @@
|
||||||
|
|
||||||
devShells = {
|
devShells = {
|
||||||
default = pkgs.mkShell {
|
default = pkgs.mkShell {
|
||||||
inputsFrom = with self.packages.${system}; [
|
inputsFrom = [
|
||||||
project
|
self.packages.${system}.project
|
||||||
];
|
];
|
||||||
|
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
clang-tools
|
self.checks.${system}.pre-commit.enabledPackages
|
||||||
];
|
];
|
||||||
|
|
||||||
inherit (pre-commit) shellHook;
|
inherit (pre-commit) shellHook;
|
||||||
|
|
|
||||||
|
|
@ -16,19 +16,18 @@
|
||||||
ref = "nixos-unstable";
|
ref = "nixos-unstable";
|
||||||
};
|
};
|
||||||
|
|
||||||
pre-commit-hooks = {
|
git-hooks = {
|
||||||
type = "github";
|
type = "github";
|
||||||
owner = "cachix";
|
owner = "cachix";
|
||||||
repo = "pre-commit-hooks.nix";
|
repo = "git-hooks.nix";
|
||||||
ref = "master";
|
ref = "master";
|
||||||
inputs = {
|
inputs = {
|
||||||
flake-utils.follows = "futils";
|
|
||||||
nixpkgs.follows = "nixpkgs";
|
nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, futils, nixpkgs, pre-commit-hooks }:
|
outputs = { self, futils, nixpkgs, git-hooks }:
|
||||||
{
|
{
|
||||||
overlays = {
|
overlays = {
|
||||||
default = final: _prev: {
|
default = final: _prev: {
|
||||||
|
|
@ -69,7 +68,7 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
pre-commit = pre-commit-hooks.lib.${system}.run {
|
pre-commit = git-hooks.lib.${system}.run {
|
||||||
src = self;
|
src = self;
|
||||||
|
|
||||||
hooks = {
|
hooks = {
|
||||||
|
|
@ -92,12 +91,12 @@
|
||||||
|
|
||||||
devShells = {
|
devShells = {
|
||||||
default = pkgs.mkShell {
|
default = pkgs.mkShell {
|
||||||
inputsFrom = with self.packages.${system}; [
|
inputsFrom = [
|
||||||
project
|
self.packages.${system}.project
|
||||||
];
|
];
|
||||||
|
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
clang-tools
|
self.checks.${system}.pre-commit.enabledPackages
|
||||||
];
|
];
|
||||||
|
|
||||||
inherit (pre-commit) shellHook;
|
inherit (pre-commit) shellHook;
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,10 @@
|
||||||
path = ./c++-meson;
|
path = ./c++-meson;
|
||||||
description = "A C++ project using Meson";
|
description = "A C++ project using Meson";
|
||||||
};
|
};
|
||||||
|
"python-uv" = {
|
||||||
|
path = ./python-uv;
|
||||||
|
description = "A Python project using uv";
|
||||||
|
};
|
||||||
"rust-cargo" = {
|
"rust-cargo" = {
|
||||||
path = ./rust-cargo;
|
path = ./rust-cargo;
|
||||||
description = "A Rust project using Cargo";
|
description = "A Rust project using Cargo";
|
||||||
|
|
|
||||||
6
templates/python-uv/.envrc
Normal file
6
templates/python-uv/.envrc
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
# shellcheck shell=bash
|
||||||
|
if ! has nix_direnv_version || ! nix_direnv_version 3.0.0; then
|
||||||
|
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.0/direnvrc" "sha256-21TMnI2xWX7HkSTjFFri2UaohXVj854mgvWapWrxRXg="
|
||||||
|
fi
|
||||||
|
|
||||||
|
use flake
|
||||||
6
templates/python-uv/.gitignore
vendored
Normal file
6
templates/python-uv/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
# Virtual environments
|
||||||
|
.venv
|
||||||
|
|
||||||
|
# Nix generated files
|
||||||
|
/.pre-commit-config.yaml
|
||||||
|
/result
|
||||||
31
templates/python-uv/.woodpecker/check.yml
Normal file
31
templates/python-uv/.woodpecker/check.yml
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
labels:
|
||||||
|
backend: local
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: pre-commit check
|
||||||
|
image: bash
|
||||||
|
commands:
|
||||||
|
- nix develop --command pre-commit run --all
|
||||||
|
|
||||||
|
- name: nix flake check
|
||||||
|
image: bash
|
||||||
|
commands:
|
||||||
|
- nix flake check
|
||||||
|
|
||||||
|
- name: notify
|
||||||
|
image: bash
|
||||||
|
environment:
|
||||||
|
ADDRESS:
|
||||||
|
from_secret: matrix_homeserver
|
||||||
|
ROOM:
|
||||||
|
from_secret: matrix_roomid
|
||||||
|
USER:
|
||||||
|
from_secret: matrix_username
|
||||||
|
PASS:
|
||||||
|
from_secret: matrix_password
|
||||||
|
commands:
|
||||||
|
- nix run github:ambroisie/matrix-notifier
|
||||||
|
when:
|
||||||
|
status:
|
||||||
|
- failure
|
||||||
|
- success
|
||||||
112
templates/python-uv/flake.nix
Normal file
112
templates/python-uv/flake.nix
Normal file
|
|
@ -0,0 +1,112 @@
|
||||||
|
{
|
||||||
|
description = "A Python project";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
futils = {
|
||||||
|
type = "github";
|
||||||
|
owner = "numtide";
|
||||||
|
repo = "flake-utils";
|
||||||
|
ref = "main";
|
||||||
|
};
|
||||||
|
|
||||||
|
nixpkgs = {
|
||||||
|
type = "github";
|
||||||
|
owner = "NixOS";
|
||||||
|
repo = "nixpkgs";
|
||||||
|
ref = "nixos-unstable";
|
||||||
|
};
|
||||||
|
|
||||||
|
git-hooks = {
|
||||||
|
type = "github";
|
||||||
|
owner = "cachix";
|
||||||
|
repo = "git-hooks.nix";
|
||||||
|
ref = "master";
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { self, futils, nixpkgs, git-hooks }:
|
||||||
|
{
|
||||||
|
overlays = {
|
||||||
|
default = final: _prev: {
|
||||||
|
project = with final; python3.pkgs.buildPythonApplication {
|
||||||
|
pname = "project";
|
||||||
|
version = (final.lib.importTOML ./pyproject.toml).project.version;
|
||||||
|
pyproject = true;
|
||||||
|
|
||||||
|
src = self;
|
||||||
|
|
||||||
|
build-system = with python3.pkgs; [ setuptools ];
|
||||||
|
|
||||||
|
pythonImportsCheck = [ "project" ];
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
description = "A Python project";
|
||||||
|
homepage = "https://git.belanyi.fr/ambroisie/project";
|
||||||
|
license = licenses.mit;
|
||||||
|
maintainers = with maintainers; [ ambroisie ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
} // futils.lib.eachDefaultSystem (system:
|
||||||
|
let
|
||||||
|
pkgs = import nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
overlays = [
|
||||||
|
self.overlays.default
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
pre-commit = git-hooks.lib.${system}.run {
|
||||||
|
src = self;
|
||||||
|
|
||||||
|
hooks = {
|
||||||
|
mypy = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
nixpkgs-fmt = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
ruff = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
ruff-format = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
checks = {
|
||||||
|
inherit (self.packages.${system}) project;
|
||||||
|
|
||||||
|
inherit pre-commit;
|
||||||
|
};
|
||||||
|
|
||||||
|
devShells = {
|
||||||
|
default = pkgs.mkShell {
|
||||||
|
inputsFrom = [
|
||||||
|
self.packages.${system}.project
|
||||||
|
];
|
||||||
|
|
||||||
|
packages = with pkgs; [
|
||||||
|
uv
|
||||||
|
self.checks.${system}.pre-commit.enabledPackages
|
||||||
|
];
|
||||||
|
|
||||||
|
inherit (pre-commit) shellHook;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
packages = futils.lib.flattenTree {
|
||||||
|
default = pkgs.project;
|
||||||
|
inherit (pkgs) project;
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
17
templates/python-uv/pyproject.toml
Normal file
17
templates/python-uv/pyproject.toml
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
[build-system]
|
||||||
|
requires = ["setuptools"]
|
||||||
|
build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
|
|
||||||
|
[project]
|
||||||
|
name = "project"
|
||||||
|
version = "0.0.0"
|
||||||
|
description = "project description"
|
||||||
|
requires-python = ">=3.12"
|
||||||
|
dependencies = []
|
||||||
|
|
||||||
|
[project.scripts]
|
||||||
|
project = "project:main"
|
||||||
|
|
||||||
|
[dependency-groups]
|
||||||
|
dev = []
|
||||||
2
templates/python-uv/src/project/__init__.py
Normal file
2
templates/python-uv/src/project/__init__.py
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
def main() -> None:
|
||||||
|
print("Hello, world!")
|
||||||
|
|
@ -16,19 +16,18 @@
|
||||||
ref = "nixos-unstable";
|
ref = "nixos-unstable";
|
||||||
};
|
};
|
||||||
|
|
||||||
pre-commit-hooks = {
|
git-hooks = {
|
||||||
type = "github";
|
type = "github";
|
||||||
owner = "cachix";
|
owner = "cachix";
|
||||||
repo = "pre-commit-hooks.nix";
|
repo = "git-hooks.nix";
|
||||||
ref = "master";
|
ref = "master";
|
||||||
inputs = {
|
inputs = {
|
||||||
flake-utils.follows = "futils";
|
|
||||||
nixpkgs.follows = "nixpkgs";
|
nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, futils, nixpkgs, pre-commit-hooks }:
|
outputs = { self, futils, nixpkgs, git-hooks }:
|
||||||
{
|
{
|
||||||
overlays = {
|
overlays = {
|
||||||
default = final: _prev: {
|
default = final: _prev: {
|
||||||
|
|
@ -60,7 +59,7 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
pre-commit = pre-commit-hooks.lib.${system}.run {
|
pre-commit = git-hooks.lib.${system}.run {
|
||||||
src = self;
|
src = self;
|
||||||
|
|
||||||
hooks = {
|
hooks = {
|
||||||
|
|
@ -88,14 +87,13 @@
|
||||||
|
|
||||||
devShells = {
|
devShells = {
|
||||||
default = pkgs.mkShell {
|
default = pkgs.mkShell {
|
||||||
inputsFrom = with self.packages.${system}; [
|
inputsFrom = [
|
||||||
project
|
self.packages.${system}.project
|
||||||
];
|
];
|
||||||
|
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
clippy
|
|
||||||
rust-analyzer
|
rust-analyzer
|
||||||
rustfmt
|
self.checks.${system}.pre-commit.enabledPackages
|
||||||
];
|
];
|
||||||
|
|
||||||
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
|
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue