Compare commits

...

46 commits

Author SHA1 Message Date
0d37843140 WIP: add notes for missing persistence/backup
Some checks failed
ci/woodpecker/push/check Pipeline failed
TODO:
* Look at for more inspiration https://github.com/nix-community/impermanence/pull/108
* Do home-manager
* Common files https://github.com/nix-community/impermanence/issues/10
2023-11-11 18:30:28 +00:00
be62fe7e4d nixos: services: quassel: persist data 2023-11-11 18:30:28 +00:00
7b9263f9ed nixos: services: pirate: persist data 2023-11-11 18:30:28 +00:00
8febd2fdbe nixos: services: monitoring: persist data 2023-11-11 18:30:28 +00:00
1c746cd2bb nixos: services: nginx: persist SSL certificates 2023-11-11 18:30:28 +00:00
da72154eb8 nixos: services: transmission: persist data 2023-11-11 18:30:28 +00:00
94ead402cc nixos: services: sabnzbd: persist data 2023-11-11 18:30:28 +00:00
8d63a2276e nixos: services: rss-bridge: persist data 2023-11-11 18:30:28 +00:00
eab7092f5d nixos: services: podgrab: persist data 2023-11-11 18:30:28 +00:00
256feb9e2f nixos: services: nextcloud: persist data 2023-11-11 18:30:28 +00:00
d245a1423b nixos: services: navidrome: persist data 2023-11-11 18:30:28 +00:00
8056ca5ad5 nixos: services: lohr: persist data 2023-11-11 18:30:28 +00:00
fbaf6ea860 nixos: services: jellyfin: persist data 2023-11-11 18:30:28 +00:00
d450f77e21 nixos: services: indexers: persist data 2023-11-11 18:30:28 +00:00
6f05315dda nixos: services: postgresql: persist data 2023-11-11 18:30:28 +00:00
605abffcc8 nixos: services: postgresql-backup: persist data 2023-11-11 18:30:28 +00:00
c4289b480c nixos: services: paperless: persist data 2023-11-11 18:30:28 +00:00
e1c037e393 nixos: services: matrix: persist data 2023-11-11 18:30:28 +00:00
f8487b23dc nixos: services: gitea: persist repositories 2023-11-11 18:30:28 +00:00
b8ac79e845 nixos: services: flood: persist data 2023-11-11 18:30:28 +00:00
56da44d85b nixos: services: calibre-web: persist library 2023-11-11 18:30:28 +00:00
54dc2a97fc nixos: services: blog: persist website data 2023-11-11 18:30:28 +00:00
20bf05ccb8 nixos: hardware: bluetooth: persist connections 2023-11-11 18:30:28 +00:00
b8d1fc917b nixos: hardware: netowrking persist connections 2023-11-11 18:30:28 +00:00
8bafea77f5 nixos: services: ssh-server: persist host keys 2023-11-11 18:30:28 +00:00
c8d0e2ad97 WIP: nixos: systems: add persist
This is the module that takes care of configuring impermanence at the
system level.

WIP:
    * address FIXMEs
    * activate home-manager persistence?
        * set `programs.fuse.userAllowOther = true;` ?
    * point `age` to persisted paths [1] ?
    * make sure all services and modules are persisted correctly...

[1]: b1d18d25b8
2023-11-11 18:30:28 +00:00
570349e80f nixos: profiles: move from top-level
All checks were successful
ci/woodpecker/push/check Pipeline was successful
My profiles are actually just "special" NixOS modules in that they
orchestrate settings that usually span the NixOS/home-manager boundary,
or otherwise set up configurations from multiple modules at once.
2023-11-11 18:12:05 +00:00
65a8f7c481 home: create 'modules/home' folder
Consolidating all modules under the same path, to clear out the
top-level directory.
2023-11-11 18:12:05 +00:00
c856933803 nixos: create 'modules/nixos' folder
Let's consolidate all modules under one path, so that NixOS,
home-manager, and nix-darwin (if I ever end up using it down the line)
would go under the same folder.
2023-11-11 18:11:52 +00:00
b52e56ed08 modules: home: use 'self'-relative import 2023-11-11 18:07:31 +00:00
27564cad42 modules: system: printing: move from 'profiles'
All checks were successful
ci/woodpecker/push/check Pipeline was successful
This isn't really a cross-cutting module, it should be a module rather
than a profile.
2023-11-11 17:59:49 +00:00
32ec402ad0 pkgs: remove volantes-cursors
All checks were successful
ci/woodpecker/push/check Pipeline was successful
It has been packaged upstream.
2023-11-07 16:52:13 +00:00
cc331b73c7 treewide: fix postgres service dependencies
All checks were successful
ci/woodpecker/push/check Pipeline was successful
Some were missing a `requires` even though they had `after`, and
woodpecker was missing it entirely.
2023-11-06 20:55:53 +00:00
830e7bb865 modules: services: woodpecker: fix interpolation 2023-11-06 20:54:42 +00:00
7f857ab661 hosts: homes: mousqueton: fix formatting
All checks were successful
ci/woodpecker/push/check Pipeline was successful
2023-10-31 14:56:21 +00:00
8ad02dd74d hosts: nixos: porthos: system: disable cache
All checks were successful
ci/woodpecker/push/check Pipeline was successful
We're never going to get a cache hit, since this is the host for that
cache.
2023-10-31 14:00:47 +00:00
249ee14d39 overlays: add 'tandoor-recipes-bump-allauth'
All checks were successful
ci/woodpecker/push/check Pipeline was successful
This should only be temporary until they release a new version which
_does_ support the middleware (see [1]).

[1]: https://github.com/TandoorRecipes/recipes/pull/2706
2023-10-31 12:20:47 +00:00
9b71708e3a flake: bump inputs 2023-10-31 11:56:39 +00:00
ca4fac3c54 hosts: nixos: porthos: fix tmux 24-bit color
All checks were successful
ci/woodpecker/push/check Pipeline was successful
Well at least this fixes it for the usual client (my laptop).
2023-10-30 13:33:27 +00:00
6a8f93df1f modules: services: nginx: fix obsolete doc
All checks were successful
ci/woodpecker/push/check Pipeline was successful
It's annoying to keep it in sync when adding a new incompatible option.
2023-10-28 12:14:45 +01:00
42ab12179e hosts: homes: mousqueton: use 'trueColorTerminals'
All checks were successful
ci/woodpecker/push/check Pipeline was successful
Ah, much better with an actual option for this :-).
2023-10-26 19:39:44 +01:00
3a1ccea142 home: tmux: add 'trueColorTerminals'
This uses the recommended way of enabling true-color [1].

[1]: https://github.com/tmux/tmux/wiki/FAQ#how-do-i-use-rgb-colour
2023-10-26 19:37:04 +01:00
c01f657e8d lib: lists: add 'nullableToList' 2023-10-26 19:36:32 +01:00
bd69e28143 home: firefox: migrate deprecated option
All checks were successful
ci/woodpecker/push/check Pipeline was successful
2023-10-26 15:19:55 +00:00
516df86b3f home: vim: migrate to 'none-ls-nvim'
This is the community-maintained fork of the plug-in.
2023-10-26 15:19:55 +00:00
28187c3b8f overlays: add 'gruvbox-nvim-better-diff'
I dislike the new style of diff [1].

After somebody wrote a patch [2] I finally started experimenting with
what looked best to me.

This is using the old vibrant colours, which I like better. And avoids
using `reverse = true` to not break high-lighting during visual
selection.

This is using an overlay as it is _much_ easier to refer to the internal
colours in a `dark`/`light` agnostic way that way instead of the
intended "use the palette way" (due to breaking changes in [3] which,
incidentally, is the MR which changed diff high-lighting).

[1]: https://github.com/ellisonleao/gruvbox.nvim/issues/290
[2]: https://github.com/ellisonleao/gruvbox.nvim/pull/291
[3]: https://github.com/ellisonleao/gruvbox.nvim/pull/280
2023-10-26 15:19:50 +00:00
217 changed files with 482 additions and 165 deletions

24
flake.lock generated
View file

@ -70,11 +70,11 @@
]
},
"locked": {
"lastModified": 1696343447,
"narHash": "sha256-B2xAZKLkkeRFG5XcHHSXXcP7To9Xzr59KXeZiRf4vdQ=",
"lastModified": 1698579227,
"narHash": "sha256-KVWjFZky+gRuWennKsbo6cWyo7c/z/VgCte5pR9pEKg=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4",
"rev": "f76e870d64779109e41370848074ac4eaa1606ec",
"type": "github"
},
"original": {
@ -131,11 +131,11 @@
]
},
"locked": {
"lastModified": 1698250431,
"narHash": "sha256-qs2gTeH4wpnWPO6Oi6sOhp2IhG0i0DzcnrJxIY3/CP8=",
"lastModified": 1698670511,
"narHash": "sha256-jQIu3UhBMPHXzVkHQO1O2gg8SVo5lqAVoC6mOaLQcLQ=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "09587fbbc6a669f7725613e044c2577dc5d43ab5",
"rev": "8e5416b478e465985eec274bc3a018024435c106",
"type": "github"
},
"original": {
@ -147,11 +147,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1698134075,
"narHash": "sha256-foCD+nuKzfh49bIoiCBur4+Fx1nozo+4C/6k8BYk4sg=",
"lastModified": 1698611440,
"narHash": "sha256-jPjHjrerhYDy3q9+s5EAsuhyhuknNfowY6yt6pjn9pc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8efd5d1e283604f75a808a20e6cde0ef313d07d4",
"rev": "0cbe9f69c234a7700596e943bfae7ef27a31b735",
"type": "github"
},
"original": {
@ -163,11 +163,11 @@
},
"nur": {
"locked": {
"lastModified": 1698317227,
"narHash": "sha256-jzSJjjxJr/IPvoPSWB1ZobmlAKku6eeggh9ffGV7Sig=",
"lastModified": 1698745553,
"narHash": "sha256-Fdip7ewCtZTjOu7ATDFUAy3OqrgcyvzDElLXhr4YmmI=",
"owner": "nix-community",
"repo": "NUR",
"rev": "32a38be31067b0a2f4919fd9e7a49bbefc34d25f",
"rev": "dfbf198236d40e9741db76936088f05107e19013",
"type": "github"
},
"original": {

View file

@ -2,7 +2,7 @@
let
defaultModules = [
# Include generic settings
"${self}/home"
"${self}/modules/home"
{
# Basic user information defaults
home.username = lib.mkDefault "ambroisie";

View file

@ -13,9 +13,7 @@ let
];
}
# Include generic settings
"${self}/modules"
# Include bundles of settings
"${self}/profiles"
"${self}/modules/nixos"
];
buildHost = name: system: lib.nixosSystem {

View file

@ -1,56 +0,0 @@
{ ... }:
{
imports = [
./aliases
./atuin
./bat
./bitwarden
./bluetooth
./calibre
./comma
./dircolors
./direnv
./discord
./documentation
./feh
./firefox
./flameshot
./fzf
./gammastep
./gdb
./git
./gpg
./gtk
./htop
./jq
./mail
./mpv
./nix
./nix-index
./nixpkgs
./nm-applet
./packages
./pager
./power-alert
./secrets
./ssh
./terminal
./tmux
./udiskie
./vim
./wm
./x
./xdg
./zathura
./zsh
];
# First sane reproducible version
home.stateVersion = "20.09";
# Who am I?
home.username = "ambroisie";
# Start services automatically
systemd.user.startServices = "sd-switch";
}

View file

@ -17,11 +17,13 @@
services.gpg-agent.enable = lib.mkForce false;
# I use scripts that use the passthrough sequence often on this host
my.home.tmux.enablePassthrough = true;
my.home = {
tmux = {
# I use scripts that use the passthrough sequence often on this host
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"
'';
# HTerm uses `xterm-256color` as its `$TERM`, so use that here
trueColorTerminals = [ "xterm-256color" ];
};
};
}

View file

@ -15,6 +15,7 @@
./secrets
./services.nix
./sound.nix
./system.nix
];
# Set your time zone.

View file

@ -9,8 +9,6 @@
gtk.enable = true;
# Laptop specific configuration
laptop.enable = true;
# Printers are hell, but so is the unability to print
printing.enable = true;
# i3 configuration
wm.windowManager = "i3";
# X configuration

View file

@ -0,0 +1,10 @@
# Core system configuration
{ ... }:
{
my.system = {
# Printers are hell, but so is the unability to print
printing = {
enable = true;
};
};
}

View file

@ -9,6 +9,7 @@
./networking.nix
./secrets
./services.nix
./system.nix
./users.nix
];

View file

@ -1,6 +1,12 @@
{ ... }:
{
my.home = {
# Allow using 24bit color when SSH-ing from various clients
tmux.trueColorTerminals = [
# My usual terminal, e.g: on laptop
"alacritty"
];
# Always start a tmux session when opening a shell session
zsh.launchTmux = true;
};

View file

@ -0,0 +1,12 @@
# Core system configuration
{ ... }:
{
my.system = {
nix = {
cache = {
# This server is the one serving the cache, don't try to query it
selfHosted = false;
};
};
};
}

View file

@ -24,4 +24,10 @@ in
# (any -> value)
# [ any ]
mapFilter = pred: f: attrs: filter pred (map f attrs);
# Transform a nullable value into a list of zero/one element.
#
# nullableToList ::
# (nullable a) -> [ a ]
nullableToList = x: if x != null then [ x ] else [ ];
}

View file

@ -1,29 +1,56 @@
{ config, inputs, lib, ... }:
let
actualPath = [ "home-manager" "users" config.my.user.name "my" "home" ];
aliasPath = [ "my" "home" ];
cfg = config.my.user.home;
in
{ ... }:
{
imports = [
inputs.home-manager.nixosModules.home-manager # enable home-manager options
(lib.mkAliasOptionModule aliasPath actualPath) # simplify setting home options
./aliases
./atuin
./bat
./bitwarden
./bluetooth
./calibre
./comma
./dircolors
./direnv
./discord
./documentation
./feh
./firefox
./flameshot
./fzf
./gammastep
./gdb
./git
./gpg
./gtk
./htop
./jq
./mail
./mpv
./nix
./nix-index
./nixpkgs
./nm-applet
./packages
./pager
./power-alert
./secrets
./ssh
./terminal
./tmux
./udiskie
./vim
./wm
./x
./xdg
./zathura
./zsh
];
config = lib.mkIf cfg.enable {
home-manager = {
# Not a fan of out-of-directory imports, but this is a good exception
users.${config.my.user.name} = import ../../home;
# First sane reproducible version
home.stateVersion = "20.09";
# Nix Flakes compatibility
useGlobalPkgs = true;
useUserPackages = true;
# Who am I?
home.username = "ambroisie";
# Forward inputs to home-manager configuration
extraSpecialArgs = {
inherit inputs;
};
};
};
# Start services automatically
systemd.user.startServices = "sd-switch";
}

View file

@ -33,13 +33,10 @@ in
enable = true;
package = pkgs.firefox.override {
cfg = {
enableTridactylNative = cfg.tridactyl.enable;
};
extraNativeMessagingHosts = with pkgs; ([ ]
nativeMessagingHosts = ([ ]
++ lib.optional cfg.tridactyl.enable pkgs.tridactyl-native
# Watch videos using mpv
++ lib.optional cfg.ff2mpv.enable ambroisie.ff2mpv-go
++ lib.optional cfg.ff2mpv.enable pkgs.ambroisie.ff2mpv-go
);
};

View file

@ -11,6 +11,19 @@ in
enable = my.mkDisableOption "tmux terminal multiplexer";
enablePassthrough = mkEnableOption "tmux DCS passthrough sequence";
trueColorTerminals = mkOption {
type = with types; listOf str;
default = lib.my.nullableToList config.my.home.terminal.program;
defaultText = ''
`[ config.my.home.terminal.program ]` if it is non-null, otherwise an
empty list.
'';
example = [ "xterm-256color" ];
description = ''
$TERM values which should be considered to always support 24-bit color.
'';
};
};
config.programs.tmux = lib.mkIf cfg.enable {
@ -75,6 +88,14 @@ in
set -g allow-passthrough on
''
}
# Force 24-bit color for each relevant $TERM
${
let
mkTcFlag = term: ''set -as terminal-features ",${term}:RGB"'';
in
lib.concatMapStringsSep "\n" mkTcFlag cfg.trueColorTerminals
}
'';
};
}

View file

@ -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

Some files were not shown because too many files have changed in this diff Show more