refactor: move to a multi-machine configuration

This commit is contained in:
Khaïs COLIN 2024-08-23 10:20:05 +02:00
parent ded2acef35
commit 7d42651c1c
6 changed files with 123 additions and 62 deletions

48
nixos/t470.nix Normal file
View file

@ -0,0 +1,48 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
{ pkgs, ... }:
{
imports = [
./hardware-configuration-t470.nix
./sourcehut.nix
./snipeit.nix
./borgbackup.nix
];
networking.hostName = "t470"; # Define your hostname.
networking.extraHosts = ''
127.0.0.1 sourcehut.nixos.local
127.0.0.1 meta.sourcehut.nixos.local
127.0.0.1 man.sourcehut.nixos.local
127.0.0.1 git.sourcehut.nixos.local
127.0.0.1 snipe-it.nixos.local
127.0.0.1 inventree.nixos.local
'';
# automount smb music share
fileSystems."/home/khais/Music" = {
device = "//void/Music";
fsType = "cifs";
options = let
# prevent hanging when network is not reachable
automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s";
in [ "${automount_opts},credentials=/etc/nixos/secrets/music.smb" ];
};
fileSystems."/home/khais/Books" = {
device = "//void/Books";
fsType = "cifs";
options = let
# prevent hanging when network is not reachable
automount_opts = "x-systemd.automount,noauto,x-systemd.idle-timeout=60,x-systemd.device-timeout=5s,x-systemd.mount-timeout=5s";
in [ "${automount_opts},credentials=/etc/nixos/secrets/books.smb" ];
};
# fingerprint sensor setup
services.open-fprintd.enable = true;
services.python-validity.enable = true;
}