Compare commits
36 commits
534cda6d91
...
17a20af6cf
| Author | SHA1 | Date | |
|---|---|---|---|
| 17a20af6cf | |||
| b0edbd1ecc | |||
| 3f2aedc64e | |||
| c3881ff7e7 | |||
| 2570ac273c | |||
| 4ceb9ab5b2 | |||
| 6fcba8d0ee | |||
| 9d40d2bd0f | |||
| acdd19c76e | |||
| bfbcee8c5d | |||
| e273dacb96 | |||
| 59248dadf4 | |||
| da5779ba6a | |||
| d56d29ed4a | |||
| e0859d5c0e | |||
| 6a20598cba | |||
| 9e223ec943 | |||
| c132b68722 | |||
| 3d90b8c429 | |||
| f29083c26f | |||
| 5d189eb15b | |||
| 8b5a59e6bb | |||
| 660fd9f12c | |||
| 2889244609 | |||
| 175f799dd0 | |||
| ed6fc4948f | |||
| 903bf4724f | |||
| 14be4c2a6b | |||
| 67f8ef538e | |||
| 8055636faf | |||
| 5248eb59f8 | |||
| b4c2cc581b | |||
| b4b9b54f75 | |||
| 52413dcaf7 | |||
| 1425c42489 | |||
| 085c563d75 |
40 changed files with 382 additions and 25 deletions
51
flake.lock
generated
51
flake.lock
generated
|
|
@ -11,11 +11,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1695384796,
|
||||
"lastModified": 1696775529,
|
||||
"narHash": "sha256-TYlE4B0ktPtlJJF9IFxTWrEeq+XKG8Ny0gc2FGEAdj0=",
|
||||
"owner": "ryantm",
|
||||
"repo": "agenix",
|
||||
"rev": "1f677b3e161d3bdbfd08a939e8f25de2568e0ef4",
|
||||
"rev": "daf42cb35b2dc614d1551e37f96406e4c4a2d3e4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -70,11 +70,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1693611461,
|
||||
"narHash": "sha256-aPODl8vAgGQ0ZYFIRisxYG5MOGSkIczvu2Cd8Gb9+1Y=",
|
||||
"lastModified": 1696343447,
|
||||
"narHash": "sha256-B2xAZKLkkeRFG5XcHHSXXcP7To9Xzr59KXeZiRf4vdQ=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "7f53fdb7bdc5bb237da7fefef12d099e4fd611ca",
|
||||
"rev": "c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -131,11 +131,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1695738267,
|
||||
"narHash": "sha256-LTNAbTQ96xSj17xBfsFrFS9i56U2BMLpD0BduhrsVkU=",
|
||||
"lastModified": 1698250431,
|
||||
"narHash": "sha256-qs2gTeH4wpnWPO6Oi6sOhp2IhG0i0DzcnrJxIY3/CP8=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "0f4e5b4999fd6a42ece5da8a3a2439a50e48e486",
|
||||
"rev": "09587fbbc6a669f7725613e044c2577dc5d43ab5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -145,13 +145,29 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"impermanence": {
|
||||
"locked": {
|
||||
"lastModified": 1694622745,
|
||||
"narHash": "sha256-z397+eDhKx9c2qNafL1xv75lC0Q4nOaFlhaU1TINqb8=",
|
||||
"owner": "nix-community",
|
||||
"repo": "impermanence",
|
||||
"rev": "e9643d08d0d193a2e074a19d4d90c67a874d932e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"ref": "master",
|
||||
"repo": "impermanence",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1695644571,
|
||||
"narHash": "sha256-asS9dCCdlt1lPq0DLwkVBbVoEKuEuz+Zi3DG7pR/RxA=",
|
||||
"lastModified": 1698134075,
|
||||
"narHash": "sha256-foCD+nuKzfh49bIoiCBur4+Fx1nozo+4C/6k8BYk4sg=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "6500b4580c2a1f3d0f980d32d285739d8e156d92",
|
||||
"rev": "8efd5d1e283604f75a808a20e6cde0ef313d07d4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -163,11 +179,11 @@
|
|||
},
|
||||
"nur": {
|
||||
"locked": {
|
||||
"lastModified": 1695824843,
|
||||
"narHash": "sha256-c1Z+y9oUXOkcU8gVBCyaujUqYLpYoI2b6L9Cq4ywOcA=",
|
||||
"lastModified": 1698317227,
|
||||
"narHash": "sha256-jzSJjjxJr/IPvoPSWB1ZobmlAKku6eeggh9ffGV7Sig=",
|
||||
"owner": "nix-community",
|
||||
"repo": "NUR",
|
||||
"rev": "8349f3e37cf21a9da032a2fdb8e7ac45366d01f3",
|
||||
"rev": "32a38be31067b0a2f4919fd9e7a49bbefc34d25f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -192,11 +208,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1695576016,
|
||||
"narHash": "sha256-71KxwRhTfVuh7kNrg3/edNjYVg9DCyKZl2QIKbhRggg=",
|
||||
"lastModified": 1698227354,
|
||||
"narHash": "sha256-Fi5H9jbaQLmLw9qBi/mkR33CoFjNbobo5xWdX4tKz1Q=",
|
||||
"owner": "cachix",
|
||||
"repo": "pre-commit-hooks.nix",
|
||||
"rev": "cb770e93516a1609652fa8e945a0f310e98f10c0",
|
||||
"rev": "bd38df3d508dfcdff52cd243d297f218ed2257bf",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
@ -212,6 +228,7 @@
|
|||
"flake-parts": "flake-parts",
|
||||
"futils": "futils",
|
||||
"home-manager": "home-manager",
|
||||
"impermanence": "impermanence",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nur": "nur",
|
||||
"pre-commit-hooks": "pre-commit-hooks"
|
||||
|
|
|
|||
|
|
@ -39,6 +39,13 @@
|
|||
};
|
||||
};
|
||||
|
||||
impermanence = {
|
||||
type = "github";
|
||||
owner = "nix-community";
|
||||
repo = "impermanence";
|
||||
ref = "master";
|
||||
};
|
||||
|
||||
nixpkgs = {
|
||||
type = "github";
|
||||
owner = "NixOS";
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ in
|
|||
nvim-lspconfig # Easy LSP configuration
|
||||
lsp-format-nvim # Simplified formatting configuration
|
||||
lsp_lines-nvim # Show diagnostics *over* regions
|
||||
null-ls-nvim # LSP integration for linters and formatters
|
||||
none-ls-nvim # LSP integration for linters and formatters
|
||||
nvim-treesitter.withAllGrammars # Better highlighting
|
||||
nvim-treesitter-textobjects # More textobjects
|
||||
nvim-ts-context-commentstring # Comment string in nested language blocks
|
||||
|
|
|
|||
|
|
@ -15,6 +15,13 @@
|
|||
|
||||
programs.git.package = lib.mkForce pkgs.emptyDirectory;
|
||||
|
||||
services.gpg-agent.enable = lib.mkForce false;
|
||||
|
||||
# I use scripts that use the passthrough sequence often on this host
|
||||
my.home.tmux.enablePassthrough = true;
|
||||
|
||||
programs.tmux.extraConfig = ''
|
||||
# Setup 24-bit color explicitly, as the default terminfo entry does not
|
||||
set-option -sa terminal-overrides ",xterm-256color:Tc"
|
||||
'';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
age-encryption.org/v1
|
||||
-> ssh-ed25519 cKojmg N182xey8TWRVUWTRP16rT0zlhYZNr/pOZVR7YRnlIkk
|
||||
HVqAag55z1cKLgjR3WsUj2wvaVjxm169JcDRJGRvCVU
|
||||
-> ssh-ed25519 jPowng Dc+aaUTxDsMTY+oOst0SC3ldq1e6zX8F5A5uBL5RHhc
|
||||
JWZou6+VaFc5f2OLRIrmFFWg3Er6WSY+TloXU0mP1K8
|
||||
-> |9_9Aqh%-grease $ X8Mn|5 aKnl' fl<D{T-
|
||||
+fAc0cajqxhYWu55HCY
|
||||
--- SrmtWXQXGYxNTabSrb5tBRXHnK1F22Qoiy7hKYrrF+0
|
||||
ñD·û²:,õn0i<>½Àß^ÆŠ`üÔ2Æ#y'ý9ÖñÓÒŽéÿæ<C3BF>r]ÀØ›¹x“³S=ú°ˆôuJéEÛóc€lH Ê~eÅ‚›ŸKtévo'êv+
|
||||
|
|
@ -35,6 +35,9 @@ in
|
|||
owner = "matrix-synapse";
|
||||
publicKeys = all;
|
||||
};
|
||||
"matrix/sliding-sync-secret.age" = {
|
||||
publicKeys = all;
|
||||
};
|
||||
|
||||
"miniflux/credentials.age".publicKeys = all;
|
||||
|
||||
|
|
|
|||
|
|
@ -64,6 +64,9 @@ in
|
|||
mailConfigFile = secrets."matrix/mail".path;
|
||||
# Only necessary when doing the initial registration
|
||||
secretFile = secrets."matrix/secret".path;
|
||||
slidingSync = {
|
||||
secretFile = secrets."matrix/sliding-sync-secret".path;
|
||||
};
|
||||
};
|
||||
miniflux = {
|
||||
enable = true;
|
||||
|
|
|
|||
|
|
@ -18,6 +18,13 @@ in
|
|||
services.blueman.enable = true;
|
||||
}
|
||||
|
||||
# Persist bluetooth files
|
||||
{
|
||||
my.system.persist.directories = [
|
||||
"/var/lib/bluetooth"
|
||||
];
|
||||
}
|
||||
|
||||
# Support for additional bluetooth codecs
|
||||
(lib.mkIf cfg.loadExtraCodecs {
|
||||
hardware.pulseaudio = {
|
||||
|
|
|
|||
|
|
@ -22,6 +22,11 @@ in
|
|||
config = lib.mkMerge [
|
||||
(lib.mkIf cfg.wireless.enable {
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
# Persist NetworkManager files
|
||||
my.system.persist.directories = [
|
||||
"/etc/NetworkManager/system-connections"
|
||||
];
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,5 +42,12 @@ in
|
|||
|
||||
# Those are all subdomains, no problem
|
||||
my.services.nginx.virtualHosts = hostsInfo;
|
||||
|
||||
my.system.persist.directories = [
|
||||
"/var/www/blog"
|
||||
"/var/www/cv"
|
||||
"/var/www/dev"
|
||||
"/var/www/key"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,6 +54,11 @@ in
|
|||
];
|
||||
};
|
||||
|
||||
my.system.persist.directories = [
|
||||
"/var/lib/${config.services.calibre-web.dataDir}"
|
||||
cfg.libraryPath
|
||||
];
|
||||
|
||||
services.fail2ban.jails = {
|
||||
calibre-web = ''
|
||||
enabled = true
|
||||
|
|
|
|||
|
|
@ -46,5 +46,9 @@ in
|
|||
inherit (cfg) port;
|
||||
}
|
||||
];
|
||||
|
||||
my.system.persist.directories = [
|
||||
"/var/lib/${cfg.stateDir}"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -135,6 +135,11 @@ in
|
|||
];
|
||||
};
|
||||
|
||||
my.system.persist.directories = [
|
||||
config.services.gitea.lfs.contentDir
|
||||
config.services.gitea.repositoryRoot
|
||||
];
|
||||
|
||||
services.fail2ban.jails = {
|
||||
gitea = ''
|
||||
enabled = true
|
||||
|
|
|
|||
|
|
@ -36,5 +36,8 @@ in
|
|||
forceSSL = true;
|
||||
useACMEHost = config.networking.domain;
|
||||
};
|
||||
|
||||
# FIXME: backup
|
||||
# FIXME: persistence
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,10 @@ in
|
|||
port = jackettPort;
|
||||
}
|
||||
];
|
||||
|
||||
my.system.persist.directories = [
|
||||
config.services.jackett.dataDir
|
||||
];
|
||||
})
|
||||
|
||||
(lib.mkIf cfg.nzbhydra.enable {
|
||||
|
|
@ -47,6 +51,10 @@ in
|
|||
port = nzbhydraPort;
|
||||
}
|
||||
];
|
||||
|
||||
my.system.persist.directories = [
|
||||
config.services.nzbhydra2.dataDir
|
||||
];
|
||||
})
|
||||
|
||||
(lib.mkIf cfg.prowlarr.enable {
|
||||
|
|
@ -61,6 +69,10 @@ in
|
|||
}
|
||||
];
|
||||
|
||||
my.system.persist.directories = [
|
||||
"/var/lib/${config.systemd.services.prowlarr.serviceConfig.StateDirectory}"
|
||||
];
|
||||
|
||||
services.fail2ban.jails = {
|
||||
prowlarr = ''
|
||||
enabled = true
|
||||
|
|
|
|||
|
|
@ -35,5 +35,9 @@ in
|
|||
};
|
||||
}
|
||||
];
|
||||
|
||||
my.system.persist.directories = [
|
||||
"/var/lib/${config.systemd.services.jellyfin.serviceConfig.StateDirectory}"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,5 +104,9 @@ in
|
|||
inherit (cfg) port;
|
||||
}
|
||||
];
|
||||
|
||||
my.system.persist.directories = [
|
||||
"/var/lib/${config.systemd.services.lohr.serviceConfig.StateDirectory}"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ let
|
|||
federationPort = { public = 8448; private = 11338; };
|
||||
clientPort = { public = 443; private = 11339; };
|
||||
domain = config.networking.domain;
|
||||
matrixDomain = "matrix.${domain}";
|
||||
in
|
||||
{
|
||||
options.my.services.matrix = with lib; {
|
||||
|
|
@ -25,6 +26,21 @@ in
|
|||
description = "Shared secret to register users";
|
||||
};
|
||||
|
||||
slidingSync = {
|
||||
port = mkOption {
|
||||
type = types.port;
|
||||
default = 8009;
|
||||
example = 8084;
|
||||
description = "Port used by sliding sync server";
|
||||
};
|
||||
|
||||
secretFile = mkOption {
|
||||
type = types.str;
|
||||
example = "/var/lib/matrix/sliding-sync-secret-file.env";
|
||||
description = "Secret file which contains SYNCV3_SECRET definition";
|
||||
};
|
||||
};
|
||||
|
||||
mailConfigFile = mkOption {
|
||||
type = types.str;
|
||||
example = "/var/lib/matrix/email-config.yaml";
|
||||
|
|
@ -52,7 +68,7 @@ in
|
|||
|
||||
settings = {
|
||||
server_name = domain;
|
||||
public_baseurl = "https://matrix.${domain}";
|
||||
public_baseurl = "https://${matrixDomain}";
|
||||
|
||||
enable_registration = false;
|
||||
|
||||
|
|
@ -88,6 +104,17 @@ in
|
|||
extraConfigFiles = [
|
||||
cfg.mailConfigFile
|
||||
] ++ lib.optional (cfg.secretFile != null) cfg.secretFile;
|
||||
|
||||
sliding-sync = {
|
||||
enable = true;
|
||||
|
||||
settings = {
|
||||
SYNCV3_SERVER = "https://${matrixDomain}";
|
||||
SYNCV3_BINDADDR = "127.0.0.1:${toString cfg.slidingSync.port}";
|
||||
};
|
||||
|
||||
environmentFile = cfg.slidingSync.secretFile;
|
||||
};
|
||||
};
|
||||
|
||||
my.services.nginx.virtualHosts = [
|
||||
|
|
@ -98,12 +125,15 @@ in
|
|||
conf = {
|
||||
default_server_config = {
|
||||
"m.homeserver" = {
|
||||
"base_url" = "https://matrix.${domain}";
|
||||
"base_url" = "https://${matrixDomain}";
|
||||
"server_name" = domain;
|
||||
};
|
||||
"m.identity_server" = {
|
||||
"base_url" = "https://vector.im";
|
||||
};
|
||||
"org.matrix.msc3575.proxy" = {
|
||||
"url" = "https://matrix-sync.${domain}";
|
||||
};
|
||||
};
|
||||
showLabsSettings = true;
|
||||
defaultCountryCode = "FR"; # cocorico
|
||||
|
|
@ -116,11 +146,25 @@ in
|
|||
};
|
||||
};
|
||||
}
|
||||
# Dummy VHosts for port collision detection
|
||||
{
|
||||
subdomain = "matrix-federation";
|
||||
port = federationPort.private;
|
||||
}
|
||||
{
|
||||
subdomain = "matrix-client";
|
||||
port = clientPort.private;
|
||||
}
|
||||
# Sliding sync
|
||||
{
|
||||
subdomain = "matrix-sync";
|
||||
inherit (cfg.slidingSync) port;
|
||||
}
|
||||
];
|
||||
|
||||
# Those are too complicated to use my wrapper...
|
||||
services.nginx.virtualHosts = {
|
||||
"matrix.${domain}" = {
|
||||
${matrixDomain} = {
|
||||
onlySSL = true;
|
||||
useACMEHost = domain;
|
||||
|
||||
|
|
@ -138,6 +182,11 @@ in
|
|||
|
||||
"/_matrix" = proxyToClientPort;
|
||||
"/_synapse/client" = proxyToClientPort;
|
||||
|
||||
# Sliding sync
|
||||
"~ ^/(client/|_matrix/client/unstable/org.matrix.msc3575/sync)" = {
|
||||
proxyPass = "http://${config.services.matrix-synapse.sliding-sync.settings.SYNCV3_BINDADDR}";
|
||||
};
|
||||
};
|
||||
|
||||
listen = [
|
||||
|
|
@ -148,9 +197,9 @@ in
|
|||
};
|
||||
|
||||
# same as above, but listening on the federation port
|
||||
"matrix.${domain}_federation" = {
|
||||
"${matrixDomain}_federation" = {
|
||||
onlySSL = true;
|
||||
serverName = "matrix.${domain}";
|
||||
serverName = matrixDomain;
|
||||
useACMEHost = domain;
|
||||
|
||||
locations."/".return = "404";
|
||||
|
|
@ -171,7 +220,7 @@ in
|
|||
|
||||
locations."= /.well-known/matrix/server".extraConfig =
|
||||
let
|
||||
server = { "m.server" = "matrix.${domain}:${toString federationPort.public}"; };
|
||||
server = { "m.server" = "${matrixDomain}:${toString federationPort.public}"; };
|
||||
in
|
||||
''
|
||||
add_header Content-Type application/json;
|
||||
|
|
@ -181,8 +230,9 @@ in
|
|||
locations."= /.well-known/matrix/client".extraConfig =
|
||||
let
|
||||
client = {
|
||||
"m.homeserver" = { "base_url" = "https://matrix.${domain}"; };
|
||||
"m.homeserver" = { "base_url" = "https://${matrixDomain}"; };
|
||||
"m.identity_server" = { "base_url" = "https://vector.im"; };
|
||||
"org.matrix.msc3575.proxy" = { "url" = "https://matrix-sync.${domain}"; };
|
||||
};
|
||||
# ACAO required to allow element-web on any URL to request this json file
|
||||
in
|
||||
|
|
@ -207,5 +257,9 @@ in
|
|||
config.services.matrix-synapse.dataDir
|
||||
];
|
||||
};
|
||||
|
||||
my.system.persist.directories = [
|
||||
config.services.matrix-synapse.dataDir
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,5 +49,8 @@ in
|
|||
inherit (cfg) port;
|
||||
}
|
||||
];
|
||||
|
||||
# FIXME: backup
|
||||
# FIXME: persistence
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -131,5 +131,10 @@ in
|
|||
inherit (cfg.grafana) port;
|
||||
}
|
||||
];
|
||||
|
||||
my.system.persist.directories = [
|
||||
config.services.grafana.dataDir
|
||||
"/var/lib/${config.services.prometheus.stateDir}"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,5 +53,9 @@ in
|
|||
inherit (cfg) port;
|
||||
}
|
||||
];
|
||||
|
||||
my.system.persist.directories = [
|
||||
"/var/lib/${config.systemd.services.navidrome.serviceConfig.StateDirectory}"
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,5 +83,10 @@ in
|
|||
"${config.services.nextcloud.home}/data/appdata_*/preview"
|
||||
];
|
||||
};
|
||||
|
||||
my.system.persist.directories = [
|
||||
config.services.nextcloud.home
|
||||
config.services.nextcloud.datadir
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -470,5 +470,9 @@ in
|
|||
}
|
||||
];
|
||||
};
|
||||
|
||||
my.system.persist.directories = [
|
||||
config.users.user.acme.home
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -164,5 +164,10 @@ in
|
|||
config.services.paperless.mediaDir
|
||||
];
|
||||
};
|
||||
|
||||
my.system.persist.directories = [
|
||||
config.services.paperless-ng.dataDir
|
||||
config.services.paperless-ng.mediaDir
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,11 @@ let
|
|||
enable = true;
|
||||
group = "media";
|
||||
};
|
||||
|
||||
# Thankfully those old style services all define users with homes
|
||||
my.system.persist.directories = [
|
||||
config.users.user.${service}.home
|
||||
];
|
||||
};
|
||||
|
||||
mkRedirection = service: {
|
||||
|
|
|
|||
|
|
@ -37,5 +37,10 @@ in
|
|||
inherit (cfg) port;
|
||||
}
|
||||
];
|
||||
|
||||
my.system.persist.directories =
|
||||
builtins.map
|
||||
(d: "/var/lib/${d}")
|
||||
config.systemd.services.podgrab.serviceConfig.StateDirectory;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,5 +24,9 @@ in
|
|||
(config.services.postgresqlBackup.location + "/*.prev.sql.gz")
|
||||
];
|
||||
};
|
||||
|
||||
my.system.persist.directories = [
|
||||
config.services.postgresqlBackup.location
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,13 @@ in
|
|||
};
|
||||
})
|
||||
|
||||
# Only persist directory if the actual service is enabled
|
||||
(lib.mkIf config.services.postgresql.enable {
|
||||
my.system.persist.directories = [
|
||||
config.services.postgresql.dataDir
|
||||
];
|
||||
})
|
||||
|
||||
# Taken from the manual
|
||||
(lib.mkIf cfg.upgradeScript {
|
||||
containers.temp-pg.config.services.postgresql = {
|
||||
|
|
|
|||
|
|
@ -46,5 +46,9 @@ in
|
|||
# Because Quassel does not use the socket, I simply trust its connection
|
||||
authentication = "host quassel quassel localhost trust";
|
||||
};
|
||||
|
||||
my.system.persist.directories = [
|
||||
config.services.quassel.dataDir
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,5 +20,9 @@ in
|
|||
forceSSL = true;
|
||||
useACMEHost = config.networking.domain;
|
||||
};
|
||||
|
||||
my.system.persist.directories = [
|
||||
config.services.rss-bridge.dataDir
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,10 @@ in
|
|||
}
|
||||
];
|
||||
|
||||
my.system.persist.files = [
|
||||
config.services.sabnzbd.configFile
|
||||
];
|
||||
|
||||
services.fail2ban.jails = {
|
||||
sabnzbd = ''
|
||||
enabled = true
|
||||
|
|
|
|||
|
|
@ -20,6 +20,14 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
# Persist SSH keys
|
||||
my.system.persist.files = [
|
||||
"/etc/ssh/ssh_host_ed25519_key"
|
||||
"/etc/ssh/ssh_host_ed25519_key.pub"
|
||||
"/etc/ssh/ssh_host_rsa_key"
|
||||
"/etc/ssh/ssh_host_rsa_key.pub"
|
||||
];
|
||||
|
||||
# Opens the relevant UDP ports.
|
||||
programs.mosh.enable = true;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -75,5 +75,8 @@ in
|
|||
inherit (cfg) port;
|
||||
}
|
||||
];
|
||||
|
||||
# FIXME: backup
|
||||
# FIXME: persistence
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,5 +91,9 @@ in
|
|||
allowedTCPPorts = [ cfg.peerPort ];
|
||||
allowedUDPPorts = [ cfg.peerPort ];
|
||||
};
|
||||
|
||||
my.system.persist.directories = [
|
||||
config.services.transmission.home
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -119,5 +119,7 @@ in
|
|||
config.services.vikunja.settings.files.basepath
|
||||
];
|
||||
};
|
||||
|
||||
# FIXME: persistence
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
./language
|
||||
./nix
|
||||
./packages
|
||||
./persist
|
||||
./podman
|
||||
./users
|
||||
];
|
||||
|
|
|
|||
68
modules/system/persist/default.nix
Normal file
68
modules/system/persist/default.nix
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
# Ephemeral root configuration
|
||||
{ config, inputs, lib, ... }:
|
||||
let
|
||||
cfg = config.my.system.persist;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
inputs.impermanence.nixosModules.impermanence
|
||||
];
|
||||
|
||||
options.my.system.persist = with lib; {
|
||||
enable = mkEnableOption "stateless system configuration";
|
||||
|
||||
mountPoint = lib.mkOption {
|
||||
type = types.str;
|
||||
default = "/persistent";
|
||||
example = "/etc/nix/persist";
|
||||
description = ''
|
||||
Which mount point should be used to persist this system's files and
|
||||
directories.
|
||||
'';
|
||||
};
|
||||
|
||||
files = lib.mkOption {
|
||||
type = with types; listOf str;
|
||||
default = [ ];
|
||||
example = [
|
||||
"/etc/nix/id_rsa"
|
||||
];
|
||||
description = ''
|
||||
Additional files in the root to link to persistent storage.
|
||||
'';
|
||||
};
|
||||
|
||||
directories = lib.mkOption {
|
||||
type = with types; listOf str;
|
||||
default = [ ];
|
||||
example = [
|
||||
"/var/lib/libvirt"
|
||||
];
|
||||
description = ''
|
||||
Additional directories in the root to link to persistent storage.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.persistence."${cfg.mountPoint}" = {
|
||||
files = [
|
||||
"/etc/machine-id"
|
||||
]
|
||||
++ cfg.files
|
||||
;
|
||||
|
||||
directories = [
|
||||
"/etc/nixos"
|
||||
"/var/log"
|
||||
"/var/lib/systemd/coredump"
|
||||
]
|
||||
++ (lib.optionals config.virtualisation.docker.enable [
|
||||
"/var/lib/docker"
|
||||
])
|
||||
# FIXME: podman
|
||||
++ cfg.directories
|
||||
;
|
||||
};
|
||||
};
|
||||
}
|
||||
4
overlays/gruvbox-nvim-old-diff/default.nix
Normal file
4
overlays/gruvbox-nvim-old-diff/default.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
self: prev:
|
||||
{
|
||||
vimPlugins = prev.vimPlugins.extend (self.callPackage ./generated.nix { });
|
||||
}
|
||||
24
overlays/gruvbox-nvim-old-diff/generated.nix
Normal file
24
overlays/gruvbox-nvim-old-diff/generated.nix
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{ vimUtils, fetchFromGitHub }:
|
||||
|
||||
_final: _prev: {
|
||||
gruvbox-nvim = vimUtils.buildVimPlugin {
|
||||
pname = "gruvbox.nvim";
|
||||
version = "2023-10-07";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "ellisonleao";
|
||||
repo = "gruvbox.nvim";
|
||||
rev = "477c62493c82684ed510c4f70eaf83802e398898";
|
||||
sha256 = "0250c24c6n6yri48l288irdawhqs16qna3y74rdkgjd2jvh66vdm";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# Inspired by https://github.com/ellisonleao/gruvbox.nvim/pull/291
|
||||
./old-colours.patch
|
||||
];
|
||||
|
||||
meta = {
|
||||
homepage = "https://github.com/ellisonleao/gruvbox.nvim/";
|
||||
};
|
||||
};
|
||||
}
|
||||
28
overlays/gruvbox-nvim-old-diff/old-colours.patch
Normal file
28
overlays/gruvbox-nvim-old-diff/old-colours.patch
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
From 416b3c9c5e783d173ac0fd5310a76c1b144b92c1 Mon Sep 17 00:00:00 2001
|
||||
From: eeeXun <sdes96303@gmail.com>
|
||||
Date: Thu, 19 Oct 2023 02:34:12 +0800
|
||||
Subject: feat: make invert_diff configurable
|
||||
|
||||
---
|
||||
README.md | 3 ++-
|
||||
lua/gruvbox.lua | 7 ++++---
|
||||
2 files changed, 6 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/lua/gruvbox.lua b/lua/gruvbox.lua
|
||||
index ceba0735..a319fc6a 100644
|
||||
--- a/lua/gruvbox.lua
|
||||
+++ b/lua/gruvbox.lua
|
||||
@@ -360,9 +361,9 @@ local function get_groups()
|
||||
PmenuSel = { fg = colors.bg2, bg = colors.blue, bold = config.bold },
|
||||
PmenuSbar = { bg = colors.bg2 },
|
||||
PmenuThumb = { bg = colors.bg4 },
|
||||
- DiffDelete = { bg = colors.dark_red },
|
||||
- DiffAdd = { bg = colors.dark_green },
|
||||
- DiffChange = { bg = colors.dark_aqua },
|
||||
- DiffText = { bg = colors.yellow, fg = colors.bg0 },
|
||||
+ DiffDelete = { fg = colors.bg0, bg = colors.red, reverse = config.inverse },
|
||||
+ DiffAdd = { fg = colors.bg0, bg = colors.green, reverse = config.inverse },
|
||||
+ DiffChange = { fg = colors.bg0, bg = colors.aqua, reverse = config.inverse },
|
||||
+ DiffText = { bg = colors.yellow, fg = colors.bg0, reverse = config.inverse },
|
||||
SpellCap = { link = "GruvboxBlueUnderline" },
|
||||
SpellBad = { link = "GruvboxRedUnderline" },
|
||||
Loading…
Add table
Add a link
Reference in a new issue