Compare commits

..

2 Commits

Author SHA1 Message Date
4182e1e771
hosts: nasbak: add initial 2023-10-28 11:39:27 +02:00
efbb07a9a4
flake update 2023-10-28 11:39:08 +02:00
9 changed files with 391 additions and 62 deletions

36
flake.lock generated
View File

@ -90,11 +90,11 @@
]
},
"locked": {
"lastModified": 1697688028,
"narHash": "sha256-d9CAOd9W2iTrgB31a8Dvyp6Vgn/gxASCNrD4Z9yzUOY=",
"lastModified": 1698479159,
"narHash": "sha256-rJHBDwW4LbADEfhkgGHjKGfL2dF44NrlyXdXeZrQahs=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "c5c1ea85181d2bb44e46e8a944a8a3f56ad88f19",
"rev": "f92a54fef4eacdbe86b0a2054054dd58b0e2a2a4",
"type": "github"
},
"original": {
@ -106,11 +106,11 @@
"jovian-nixos": {
"flake": false,
"locked": {
"lastModified": 1697700248,
"narHash": "sha256-z45M6Fna2mR9zEK9fe9ng1XN+T7CvpmKBn/SaK9zwO4=",
"lastModified": 1698438847,
"narHash": "sha256-QguDrNEu5pRxzh4l1dRsbi5wPiSqRPdY1vYY5qHuaR4=",
"owner": "Jovian-Experiments",
"repo": "Jovian-NixOS",
"rev": "2965d86926177af95af615a09138e0aaaaec56fa",
"rev": "cfddf9e15b756c6cb454baca8cf06312023f2db9",
"type": "github"
},
"original": {
@ -143,11 +143,11 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1697748412,
"narHash": "sha256-5VSB63UE/O191cuZiGHbCJ9ipc7cGKB8cHp0cfusuyo=",
"lastModified": 1698053470,
"narHash": "sha256-sP8D/41UiwC2qn0X40oi+DfuVzNHMROqIWdSdCI/AYA=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "72d53d51704295f1645d20384cd13aecc182f624",
"rev": "80d98a7d55c6e27954a166cb583a41325e9512d7",
"type": "github"
},
"original": {
@ -159,11 +159,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1697456312,
"narHash": "sha256-roiSnrqb5r+ehnKCauPLugoU8S36KgmWraHgRqVYndo=",
"lastModified": 1698318101,
"narHash": "sha256-gUihHt3yPD7bVqg+k/UVHgngyaJ3DMEBchbymBMvK1E=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "ca012a02bf8327be9e488546faecae5e05d7d749",
"rev": "63678e9f3d3afecfeafa0acead6239cdb447574c",
"type": "github"
},
"original": {
@ -175,11 +175,11 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1697655685,
"narHash": "sha256-79Kuv+QdgsVc+rkibuAgWHnh8IXrLBTOKg5nM0Qvux0=",
"lastModified": 1698288402,
"narHash": "sha256-jIIjApPdm+4yt8PglX8pUOexAdEiAax/DXW3S/Mb21E=",
"owner": "NixOS",
"repo": "nIxpkgs",
"rev": "80c1aab725151632ddc2a20caeb914e76dd0673c",
"rev": "60b9db998f71ea49e1a9c41824d09aa274be1344",
"type": "github"
},
"original": {
@ -191,11 +191,11 @@
},
"nur": {
"locked": {
"lastModified": 1697824384,
"narHash": "sha256-CVtPGCWLz8VhqViW8AT7ivP7+/6YWJRwd5VbwKb6Oy0=",
"lastModified": 1698479881,
"narHash": "sha256-1tECyhfEe7KPs47DjP2vLD4uqkq5iIPGo2elpyrecPs=",
"owner": "nix-community",
"repo": "NUR",
"rev": "f5c11de6afaad87dc9922df25dfbd73201f6c75f",
"rev": "9700207021a6611091001f53cfed2435cf2f48b9",
"type": "github"
},
"original": {

View File

@ -159,14 +159,14 @@ in
];
};
nas = lib.nixosSystem { # Desktop profile
nasbackup = lib.nixosSystem { # Desktop profile
inherit system;
#user = "dmz-user";
specialArgs = { inherit inputs user location nixos-hardware nur agenix; };
modules = [
agenix.nixosModules.default
nur.nixosModules.nur
./nas
./nasbackup
./configuration_desktop.nix
../modules/hardware/remoteClient.nix
nixos-hardware.nixosModules.common-cpu-intel
@ -180,7 +180,7 @@ in
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = { inherit user; };
home-manager.users.${user} = {
imports = [(import ./home_server.nix)] ++ [(import ./nas/home.nix)];
imports = [(import ./home_server.nix)] ++ [(import ./nasbackup/home.nix)];
};
}
];

View File

@ -24,7 +24,7 @@
home = { # Specific packages for laptop
packages = with pkgs; [
# Applications
freecad # Office packages
#freecad # Office packages
#firefox
chromium
thunderbird

View File

@ -31,52 +31,52 @@
packages = with pkgs; [
# Terminal
btop # Resource Manager
pfetch # Minimal fetch
ranger # File Manager
gnupg # sign and authorize 2nd Fac
btop # Resource Manager
pfetch # Minimal fetch
ranger # File Manager
gnupg # sign and authorize 2nd Fac
xdg-utils
steam
xdg-utils
steam
# dev tools
gcc
gnumake
gnupatch
gnulib
yubioath-flutter
nitrokey-app
# dev ols
gcc
gnumake
gnupatch
gnulib
yubioath-flutter
nitrokey-app
tailscale
wireguard-tools
tailscale
wireguard-tools
# Video/Audio
mpv # Media Player
youtube-dl
# VideAudio
mpv # Media Player
youtube-dl
# Apps
galculator
tdesktop
hdparm
python3Full
android-tools
calibre
mtpfs
vimiv-qt
#freecad
galculator
tdesktop
hdparm
python3Full
android-tools
calibre
mtpfs
vimiv-qt
#freecad
# File Management
#okular # PDF viewer
#gnome.file-roller # Archive Manager
pcmanfm # File Manager
rsync # Syncer $ rsync -r dir1/ dir2/
unzip # Zip files
unrar # Rar files
papirus-icon-theme
# Fileanagement
#okular # PDF viewer
#gnome.file-roller # Archive Manager
pcmanfm # File Manager
rsync # Syncer $ rsync -r dir1/ dir2/
unzip # Zip files
unrar # Rar files
papirus-icon-theme
# General configuration
keepassxc
libreoffice
# Genel configuration
keepassxc
libreoffice
# Flatpak
super-slicer-latest
@ -86,7 +86,7 @@
vscodeExtensions = with vscode-extensions; [
vscodevim.vim
github.copilot
ms-python.python
#ms-python.python
ms-vscode.cpptools
dracula-theme.theme-dracula
catppuccin.catppuccin-vsc

View File

@ -51,7 +51,7 @@
#unrar # Rar files
];
stateVersion = "22.05";
stateVersion = "23.11";
};
programs = {

View File

@ -0,0 +1,66 @@
#
# Specific system configuration settings for desktop
#
# flake.nix
# ├─ ./hosts
# │ └─ ./laptop
# │ ├─ default.nix *
# │ └─ hardware-configuration.nix
# └─ ./modules
# ├─ ./desktop
# │ └─ ./hyprland
# │ └─ hyprland.nix
# ├─ ./modules
# │ └─ ./programs
# │ └─ waybar.nix
# └─ ./hardware
# └─ default.nix
#
{ config, pkgs, user, ... }:
{
imports = # For now, if applying to other system, swap files
[(import ./hardware-configuration.nix)] ++ # Current system hardware config @ /etc/nixos/hardware-configuration.nix
(import ../../modules/desktop/virtualisation) ++ # Docker
(import ../../modules/services/nasbackup) ++ # Server Services
(import ../../modules/hardware); # Hardware devices
boot = { # Boot options
kernelPackages = pkgs.linuxPackages_latest;
loader = { # EFI Boot
systemd-boot.enable = true;
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot";
};
timeout = 1; # Grub auto select time
};
};
programs = { # No xbacklight, this is the alterantive
zsh.enable = true;
ssh.startAgent = false;
gnupg.agent = {
enable = false;
enableSSHSupport = true;
pinentryFlavor = "curses";
};
};
services = {
#auto-cpufreq.enable = true;
avahi = { # Needed to find wireless printer
enable = true;
nssmdns = true;
publish = { # Needed for detecting the scanner
enable = true;
addresses = true;
userServices = true;
};
};
};
}

View File

@ -0,0 +1,206 @@
#
# Hardware settings for Teclast F5 10" Laptop
# NixOS @ sda2
#
# flake.nix
# └─ ./hosts
# └─ ./laptop
# └─ hardware-configuration.nix *
#
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ "vfio_pci" "vfio" "vfio_iommu_type1" ];
# boot.initrd.secrets = {
# "/root/NASKeyfile" =
# /root/NASKeyfile;
# };
# boot.initrd.luks.devices = {
# NAS-RAID1 = {
# device = "/dev/disk/by-uuid/57e6446d-faca-4b67-9063-e8d9afb80088";
# keyFile = "/root/NASKeyfile";
# };
# NAS-RAID2 = {
# device = "/dev/disk/by-uuid/b9edc489-ac37-4b28-981d-442722df7ae2";
# keyFile = "/root/NASKeyfile";
# };
# };
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
boot.tmp.useTmpfs = false;
boot.tmp.cleanOnBoot = true;
zramSwap.enable = true;
services.btrfs.autoScrub = {
enable = true;
interval = "monthly";
fileSystems = [
"/"
# "/mnt/Pluto"
];
};
services.btrbk = {
instances = {
hf = {
onCalendar = "hourly";
settings = {
incremental = "yes";
snapshot_create = "ondemand";
snapshot_dir = "@snapshots";
timestamp_format = "long";
snapshot_preserve = "2m 2w 5d 5h";
snapshot_preserve_min = "latest";
volume = {
"/mnt/snapshots/root" = {
snapshot_create = "always";
subvolume = {
"@" = {};
"@home" = {};
};
};
};
};
};
# lf = {
# onCalendar = "daily";
# settings = {
# incremental = "yes";
# snapshot_create = "ondemand";
# snapshot_dir = "@snapshots";
# timestamp_format = "long";
#
# snapshot_preserve = "2m 2w 5d";
# snapshot_preserve_min = "latest";
#
# volume = {
# "/mnt/snapshots/Pluto" = {
# snapshot_create = "always";
# subvolume = {
# "@" = {};
# "@/Backups" = {};
# "@/Games" = {};
# "@/IT" = {};
# "@/Media" = {};
# "@/Pictures" = {};
# "@/Rest" = {};
# };
# };
# };
# };
# };
# };
# };
fileSystems."/" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@,discard=async" ];
};
fileSystems."/home" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@home,discard=async" ];
};
fileSystems."/srv" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@srv,discard=async" ];
};
fileSystems."/nix" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@nix,discard=async" ];
};
fileSystems."/swap" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@swap,discard=async" ];
};
# fileSystems."/mnt/snapshots/root" =
# { device = "/dev/disk/by-label/NIXROOT";
# fsType = "btrfs";
# options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvolid=5,discard=async" ];
# };
#
# fileSystems."/mnt/snapshots/Pluto" =
# { device = "/dev/disk/by-label/NAS-RAID";
# fsType = "btrfs";
# options = [ "compress=zstd,space_cache=v2,noatime,subvolid=5" ];
# };
#
# fileSystems."/mnt/Pluto" =
# { device = "/dev/disk/by-label/NAS-RAID";
# fsType = "btrfs";
# options = [ "compress=zstd,space_cache=v2,noatime,subvol=@" ];
# };
#
fileSystems."/boot" =
{ device = "/dev/disk/by-label/NIXBOOT";
fsType = "vfat";
};
swapDevices = [ { device = "/swap/swapfile"; } ];
networking = {
hostName = "nasbak";
domain = "home.opel-online.de";
networkmanager = {
enable = false;
};
timeServers = [
"192.168.2.1"
];
interfaces = {
enp6s18 = {
useDHCP = true; # For versatility sake, manually edit IP on nm-applet.
# ipv4.addresses = [ {
# address = "45.142.114.153";
# prefixLength = 24;
# } ];
# ipv6.addresses = [ {
# address = "2a00:ccc1:101:19D::2";
# prefixLength = 64;
# } ];
# };
};
};
# defaultGateway = "45.142.114.1";
defaultGateway6 = {
address = "fe80::1";
interface = "enp6s18";
};
# nameservers = [ "9.9.9.9" "2620:fe::fe" ];
#firewall = {
# enable = false;
# #allowedUDPPorts = [ 53 67 ];
# #allowedTCPPorts = [ 53 80 443 9443 ];
#};
};
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
powerManagement = {
cpuFreqGovernor = lib.mkDefault "powersave";
powertop.enable = true;
# powerUpCommands = ''
# ${pkgs.hdparm}/sbin/hdparm -S 150 /dev/disk/by-uuid/57e6446d-faca-4b67-9063-e8d9afb80088
# ${pkgs.hdparm}/sbin/hdparm -S 150 /dev/disk/by-uuid/b9edc489-ac37-4b28-981d-442722df7ae2
# '';
};
}

39
hosts/nasbackup/home.nix Normal file
View File

@ -0,0 +1,39 @@
#
# Home-manager configuration for laptop
#
# flake.nix
# ├─ ./hosts
# │ └─ ./laptop
# │ └─ home.nix *
# └─ ./modules
# └─ ./desktop
# └─ ./hyprland
# └─ hyprland.nix
#
{ pkgs, ... }:
{
imports =
[
../../modules/home.nix # Window Manager
];
home = { # Specific packages for laptop
packages = with pkgs; [
# Applications
# Display
#light # xorg.xbacklight not supported. Other option is just use xrandr.
# Power Management
#auto-cpufreq # Power management
#tlp # Power management
];
};
programs = {
alacritty.settings.font.size = 11;
};
}

View File

@ -0,0 +1,18 @@
#
# Services
#
# flake.nix
# ├─ ./hosts
# │ └─ home.nix
# └─ ./modules
# └─ ./services
# └─ default.nix *
# └─ ...
#
[
# ./nfs.nix
]
# picom, polybar and sxhkd are pulled from desktop module
# redshift temporarely disables