Reorganize configs

This commit is contained in:
2024-07-11 12:21:43 -07:00
parent f23f4f7746
commit f7872964ec
19 changed files with 98 additions and 94 deletions

59
hosts/marauder/apps.nix Normal file
View File

@@ -0,0 +1,59 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
# Chat clients
discord
element-desktop
telegram-desktop
# Browsers
firefox
# Coding
(vscode-with-extensions.override {
vscodeExtensions = with pkgs.vscode-extensions; [
bbenoist.nix
github.copilot
arrterian.nix-env-selector
];
})
# Art and 3D
inkscape
openscad-unstable
bambu-studio
# Multimedia
vlc
# Productivity
obsidian
];
programs = {
git = {
enable = true;
lfs.enable = true;
config = {
init.defaultBranch = "master";
user = {
email = "git@nettika.cat";
name = "Nettika";
};
credential.helper = "store";
};
};
nano = {
enable = true;
nanorc = ''
set autoindent
set linenumbers
'';
};
steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
};
};
}

50
hosts/marauder/backup.nix Normal file
View File

@@ -0,0 +1,50 @@
{ pkgs, config, ... }:
{
environment.systemPackages = with pkgs; [
restic
libnotify
backblaze-b2
];
systemd.services = {
notify-backup-b2-failed = {
description = "Notify on failed backup to B2";
serviceConfig = {
Type = "oneshot";
User = "nettika";
};
environment = {
DBUS_SESSION_BUS_ADDRESS = "unix:path=/run/user/1000/bus";
};
path = [ pkgs.libnotify ];
script = "notify-send -u critical \"Backup to B2 failed\" \"$(journalctl -u restic-backups-b2 -n 5 -o cat)\"";
};
restic-backups-b2 = {
onFailure = ["notify-backup-b2-failed.service"];
};
};
services.restic.backups = {
b2 = {
initialize = true;
environmentFile = "/etc/restic-env";
repository = "b2:marauder-backup";
passwordFile = "/etc/restic-password";
paths = [
"${config.users.users.nettika.home}/Desktop"
"${config.users.users.nettika.home}/Documents"
"${config.users.users.nettika.home}/Music"
"${config.users.users.nettika.home}/Pictures"
"${config.users.users.nettika.home}/Projects"
"${config.users.users.nettika.home}/Public"
"${config.users.users.nettika.home}/Templates"
"${config.users.users.nettika.home}/Videos"
];
pruneOpts = [
"--keep-daily 7"
"--keep-weekly 5"
"--keep-monthly 12"
];
};
};
}

27
hosts/marauder/boot.nix Normal file
View File

@@ -0,0 +1,27 @@
{ ... }:
{
boot = {
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
initrd = {
systemd.enable = true;
availableKernelModules = [
"nvme"
"xhci_pci"
"usbhid"
"usb_storage"
"sd_mod"
];
};
kernelModules = ["kvm-amd"];
kernelParams = [
"amd_pstate=active"
"quiet"
"loglevel=3"
"udev.log-priority=3"
];
plymouth.enable = true;
};
}

View File

@@ -1,6 +1,10 @@
{ config, lib, pkgs, inputs, ... }:
{
imports = [
./apps.nix
./backup.nix
./boot.nix
./hardware.nix
../../modules/nixos
];
@@ -13,5 +17,16 @@
"flakes"
];
services = {
xserver = {
enable = true;
desktopManager = {
cinnamon.enable = true;
xterm.enable = false;
};
};
displayManager.defaultSession = "cinnamon";
};
system.stateVersion = "24.05";
}

View File

@@ -0,0 +1,38 @@
{ pkgs, ... }:
{
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/648c6539-892c-40d7-8b07-23fe760df02a";
fsType = "ext4";
};
"/boot" = {
device = "/dev/disk/by-uuid/1D62-C30E";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
};
hardware = {
enableRedistributableFirmware = true;
cpu.amd.updateMicrocode = true;
opengl = {
enable = true;
driSupport32Bit = true;
extraPackages = [pkgs.vaapiVdpau];
};
nvidia.prime = {
offload = {
enable = true;
enableOffloadCmd = true;
};
amdgpuBusId = "PCI:05:00:0";
nvidiaBusId = "PCI:01:00:0";
};
};
services = {
xserver.videoDrivers = ["nvidia"];
tlp.enable = true;
fstrim.enable = true;
};
}

View File

@@ -1,5 +1,9 @@
{ config, lib, pkgs, inputs, ... }:
{ config, lib, pkgs, inputs, outputs, ... }:
{
imports = [
outputs.nixosModules
];
time.timeZone = "America/Los_Angeles";
nix.settings.experimental-features = [
@@ -7,5 +11,10 @@
"flakes"
];
networking = {
hostName = "monolith";
networkmanager.enable = true;
};
system.stateVersion = "24.05";
}