Add home manager and reorganize modules
This commit is contained in:
50
modules/nixos/backup.nix
Normal file
50
modules/nixos/backup.nix
Normal 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
modules/nixos/boot.nix
Normal file
27
modules/nixos/boot.nix
Normal 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;
|
||||
};
|
||||
}
|
8
modules/nixos/chat.nix
Normal file
8
modules/nixos/chat.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
discord
|
||||
element-desktop
|
||||
telegram-desktop
|
||||
];
|
||||
}
|
36
modules/nixos/coding.nix
Normal file
36
modules/nixos/coding.nix
Normal file
@@ -0,0 +1,36 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
cargo
|
||||
rustc
|
||||
rustfmt
|
||||
gcc
|
||||
(vscode-with-extensions.override {
|
||||
vscodeExtensions = import ./vscode-extensions.nix { inherit pkgs; };
|
||||
})
|
||||
];
|
||||
|
||||
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
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
fonts.packages = [pkgs.fira-code];
|
||||
}
|
19
modules/nixos/default.nix
Normal file
19
modules/nixos/default.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./backup.nix
|
||||
./boot.nix
|
||||
./chat.nix
|
||||
./coding.nix
|
||||
./gaming.nix
|
||||
./hardware.nix
|
||||
./illustration.nix
|
||||
./interface.nix
|
||||
./media.nix
|
||||
./modelling.nix
|
||||
./networking.nix
|
||||
./productivity.nix
|
||||
./users.nix
|
||||
./web.nix
|
||||
];
|
||||
}
|
8
modules/nixos/gaming.nix
Normal file
8
modules/nixos/gaming.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{ ... }:
|
||||
{
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
remotePlay.openFirewall = true;
|
||||
dedicatedServer.openFirewall = true;
|
||||
};
|
||||
}
|
38
modules/nixos/hardware.nix
Normal file
38
modules/nixos/hardware.nix
Normal 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;
|
||||
};
|
||||
}
|
4
modules/nixos/illustration.nix
Normal file
4
modules/nixos/illustration.nix
Normal file
@@ -0,0 +1,4 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = [pkgs.inkscape];
|
||||
}
|
13
modules/nixos/interface.nix
Normal file
13
modules/nixos/interface.nix
Normal file
@@ -0,0 +1,13 @@
|
||||
{ ... }:
|
||||
{
|
||||
services = {
|
||||
xserver = {
|
||||
enable = true;
|
||||
desktopManager = {
|
||||
cinnamon.enable = true;
|
||||
xterm.enable = false;
|
||||
};
|
||||
};
|
||||
displayManager.defaultSession = "cinnamon";
|
||||
};
|
||||
}
|
4
modules/nixos/media.nix
Normal file
4
modules/nixos/media.nix
Normal file
@@ -0,0 +1,4 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = [pkgs.vlc];
|
||||
}
|
7
modules/nixos/modelling.nix
Normal file
7
modules/nixos/modelling.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
openscad-unstable
|
||||
bambu-studio
|
||||
];
|
||||
}
|
7
modules/nixos/networking.nix
Normal file
7
modules/nixos/networking.nix
Normal file
@@ -0,0 +1,7 @@
|
||||
{ ... }:
|
||||
{
|
||||
networking = {
|
||||
hostName = "marauder";
|
||||
networkmanager.enable = true;
|
||||
};
|
||||
}
|
4
modules/nixos/productivity.nix
Normal file
4
modules/nixos/productivity.nix
Normal file
@@ -0,0 +1,4 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = [pkgs.obsidian];
|
||||
}
|
9
modules/nixos/users.nix
Normal file
9
modules/nixos/users.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
{ ... }:
|
||||
{
|
||||
users.users = {
|
||||
nettika = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" "networkmanager" ];
|
||||
};
|
||||
};
|
||||
}
|
18
modules/nixos/vscode-extensions.nix
Normal file
18
modules/nixos/vscode-extensions.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
packagedExtensions = with pkgs.vscode-extensions; [
|
||||
bbenoist.nix
|
||||
ms-python.python
|
||||
ms-python.vscode-pylance
|
||||
rust-lang.rust-analyzer
|
||||
];
|
||||
marketplaceExtensions = (pkgs.vscode-utils.extensionsFromVscodeMarketplace [
|
||||
{
|
||||
name = "openscad-language-support";
|
||||
publisher = "Leathong";
|
||||
version = "1.2.3";
|
||||
sha256 = "2wvlvjHRayf9FmaDZMpiReZ99fvdtANGFst9WfMRCLQ=";
|
||||
}
|
||||
]);
|
||||
in
|
||||
packagedExtensions ++ marketplaceExtensions
|
4
modules/nixos/web.nix
Normal file
4
modules/nixos/web.nix
Normal file
@@ -0,0 +1,4 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
environment.systemPackages = [pkgs.firefox];
|
||||
}
|
Reference in New Issue
Block a user