Compare commits

...

13 commits

Author SHA1 Message Date
a629e9f28c configure waybar better 2025-08-01 21:36:11 +02:00
e59d3746c8 hello from the laptop 2025-08-01 18:52:01 +02:00
d1ebe08b26 hm 2025-08-01 18:35:43 +02:00
5874a94a21 hm 2025-08-01 18:35:15 +02:00
09159584f3 prepare laptop 2025-08-01 18:29:38 +02:00
04f8f040bd prepare laptop 2025-08-01 18:26:02 +02:00
7713b11971 move 2025-08-01 18:20:20 +02:00
2e49bff29a prepare laptop 2025-08-01 18:04:43 +02:00
274f681265 kernel magic 2025-08-01 18:03:51 +02:00
9c7e13408a prepare laptop 2025-08-01 18:00:33 +02:00
c7b19e0ec5 fix 2025-08-01 17:45:29 +02:00
71e927f4bc prepare laptop 2025-08-01 17:43:44 +02:00
3125f869af update kernel 2025-08-01 16:07:06 +02:00
10 changed files with 448 additions and 325 deletions

View file

@ -32,13 +32,27 @@
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./nixos/configuration.nix
./nixos/desktop.nix
inputs.minegrub-theme.nixosModules.default
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.nora = import ./home-manager/desktop.nix;
home-manager.users.nora = import ./home-manager/home.nix;
home-manager.extraSpecialArgs = { inherit inputs; };
}
];
};
scrap = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./nixos/laptop.nix
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.nora = import ./home-manager/laptop.nix;
home-manager.extraSpecialArgs = { inherit inputs; };
}
];

7
home-manager/laptop.nix Normal file
View file

@ -0,0 +1,7 @@
{ ... }: {
imports = [
./home.nix
];
is-laptop = true;
}

View file

@ -1,211 +1,255 @@
{ config, pkgs, lib, ... }:
{
home.file."${config.xdg.configHome}/waybar/config.jsonc" = {
text =
builtins.toJSON {
height = 35;
spacing = 4;
options.is-laptop = lib.mkEnableOption "whether the computer is a laptop";
modules-left = [
"systemd-failed-units"
"custom/music-back"
"mpris"
"custom/music-next"
];
modules-center = [
"clock"
];
modules-right = [
"bluetooth"
"privacy"
"pulseaudio"
"cpu"
"memory"
"tray"
"custom/power"
];
config = {
home.file."${config.xdg.configHome}/waybar/config.jsonc" = {
text =
builtins.toJSON {
height = 35;
spacing = 4;
systemd-failed-units = {
hide-on-ok = true; # Hide if there are zero failed units.
format = " {nr_failed}";
format-ok = " systemd is ok but waybar is not";
system = true; # monitor sytem units
user = true; # monitor user units
};
"custom/music-back" = {
format = "";
tooltip = true;
tooltip-format = "Play previous song";
on-click = "${lib.getExe pkgs.playerctl} previous";
};
mpris = {
format = "{status_icon} {dynamic}";
dynamic-order = [ "title" "artist" ];
status-icons = {
paused = "";
modules-left = [
"systemd-failed-units"
"custom/music-back"
"mpris"
"custom/music-next"
];
modules-center = [
"clock"
];
modules-right = [
"bluetooth"
"privacy"
"pulseaudio"
"cpu"
"memory"
"tray"
] ++
(if (config.is-laptop) then
[ "network" "power-profiles-daemon" "battery" ]
else [ ]) ++
[
"custom/power"
];
systemd-failed-units = {
hide-on-ok = true; # Hide if there are zero failed units.
format = " {nr_failed}";
format-ok = " systemd is ok but waybar is not";
system = true; # monitor sytem units
user = true; # monitor user units
};
};
"custom/music-next" = {
format = "";
tooltip = true;
tooltip-format = "Play next song";
on-click = "${lib.getExe pkgs.playerctl} next";
};
clock = {
interval = 1;
format = "{:%a %F %H:%M:%S}";
tooltip-format = "<tt><small>{calendar}</small></tt>";
calendar = {
mode = "year";
mode-mon-col = 3;
weeks-pos = "right";
on-scroll = 1;
format = {
months = "<span color='#ffead3'><b>{}</b></span>";
days = "<span color='#ecc6d9'><b>{}</b></span>";
weeks = "<span color='#99ffdd'><b>W{}</b></span>";
weekdays = "<span color='#ffcc66'><b>{}</b></span>";
today = "<span color='#ff6699'><b><u>{}</u></b></span>";
"custom/music-back" = {
format = "";
tooltip = true;
tooltip-format = "Play previous song";
on-click = "${lib.getExe pkgs.playerctl} previous";
};
mpris = {
format = "{status_icon} {dynamic}";
dynamic-order = [ "title" "artist" ];
status-icons = {
paused = "";
};
};
actions = {
on-click-right = "mode";
on-scroll-up = "shift_up";
on-scroll-down = "shift_down";
"custom/music-next" = {
format = "";
tooltip = true;
tooltip-format = "Play next song";
on-click = "${lib.getExe pkgs.playerctl} next";
};
};
bluetooth = {
format = " {status}";
format-disabled = ""; # an empty format will hide the module
format-connected = " {num_connections} connected";
on-click = lib.getExe pkgs.overskride;
};
pulseaudio = {
# "scroll-step": 1, // %, can be a float
"format" = "{volume}% {icon} {format_source}";
"format-bluetooth" = "{volume}% {icon} {format_source}";
"format-bluetooth-muted" = " {icon} {format_source}";
"format-muted" = " {format_source}";
"format-source" = "{volume}% ";
"format-source-muted" = "";
"format-icons" = {
"headphone" = "";
"hands-free" = "";
"headset" = "";
"phone" = "";
"portable" = "";
"car" = "";
"default" = [ "" "" "" ];
};
"on-click" = lib.getExe pkgs.pavucontrol;
};
cpu = {
format = "{usage}% ";
tooltip = false;
};
memory = {
format = "{}% ";
};
tray = {
spacing = 10;
};
"custom/power" =
let
power-menu = pkgs.writeText "power_menu.xml" ''
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkMenu" id="menu">
<child>
<object class="GtkMenuItem" id="lock">
<property name="label">Lock 🔒</property>
</object>
</child>
<child>
<object class="GtkSeparatorMenuItem" id="delimiter1"/>
</child>
<child>
<object class="GtkMenuItem" id="reboot">
<property name="label">Reboot </property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="poweroff">
<property name="label">Poweroff 💤</property>
</object>
</child>
</object>
</interface>
'';
in
{
"format" = "";
"tooltip" = false;
"menu" = "on-click";
"menu-file" = power-menu;
"menu-actions" = {
"lock" = "${lib.getExe pkgs.swaylock}";
"reboot" = "reboot";
"poweroff" = "poweroff";
clock = {
interval = 1;
format = "{:%a %F %H:%M:%S}";
tooltip-format = "<tt><small>{calendar}</small></tt>";
calendar = {
mode = "year";
mode-mon-col = 3;
weeks-pos = "right";
on-scroll = 1;
format = {
months = "<span color='#ffead3'><b>{}</b></span>";
days = "<span color='#ecc6d9'><b>{}</b></span>";
weeks = "<span color='#99ffdd'><b>W{}</b></span>";
weekdays = "<span color='#ffcc66'><b>{}</b></span>";
today = "<span color='#ff6699'><b><u>{}</u></b></span>";
};
};
actions = {
on-click-right = "mode";
on-scroll-up = "shift_up";
on-scroll-down = "shift_down";
};
};
};
};
home.file."${config.xdg.configHome}/waybar/style.css" = {
text = ''
${builtins.readFile ./default-waybar-style.css}
window#waybar {
background: linear-gradient(
to right,
rgb(131, 80, 117) 15%,
rgb(158, 103, 143) 30%,
rgb(131, 80, 117) 45%,
#db88c5
);
color: black;
}
bluetooth = {
format = " {status}";
format-disabled = ""; # an empty format will hide the module
format-connected = " {num_connections} connected";
on-click = lib.getExe pkgs.overskride;
};
pulseaudio = {
# "scroll-step": 1, // %, can be a float
"format" = "{volume}% {icon} {format_source}";
"format-bluetooth" = "{volume}% {icon} {format_source}";
"format-bluetooth-muted" = " {icon} {format_source}";
"format-muted" = " {format_source}";
"format-source" = "{volume}% ";
"format-source-muted" = "";
"format-icons" = {
"headphone" = "";
"hands-free" = "";
"headset" = "";
"phone" = "";
"portable" = "";
"car" = "";
"default" = [ "" "" "" ];
};
"on-click" = lib.getExe pkgs.pavucontrol;
};
cpu = {
format = "{usage}% ";
tooltip = false;
};
memory = {
format = "{}% ";
};
tray = {
spacing = 10;
};
"network" = {
# "interface": "wlp2*", // (Optional) To force the use of this interface
"format-wifi" = " ({signalStrength}%)";
"format-ethernet" = "{ipaddr}/{cidr} ";
"tooltip-format" = "{ifname} via {gwaddr} ({ipaddr}/{cidr})";
"format-linked" = "{ifname} (No IP) ";
"format-disconnected" = "Disconnected ";
"format-alt" = "{ifname}: {ipaddr}/{cidr}";
};
"power-profiles-daemon" = {
"format" = "{icon}";
"tooltip-format" = "Power profile: {profile}\nDriver: {driver}";
"tooltip" = true;
"format-icons" = {
"default" = "";
"performance" = "";
"balanced" = "";
"power-saver" = "";
};
};
"battery" = {
"states" = {
# "good": 95,
"warning" = 30;
"critical" = 5;
};
"format" = "{capacity}% {icon}";
"format-full" = "{capacity}% {icon}";
"format-charging" = "{capacity}% ";
"format-plugged" = "{capacity}% ";
"format-alt" = "{time} {icon}";
# "format-good": "", // An empty format will hide the module
# "format-full": "",
"format-icons" = [ "" "" "" "" "" ];
};
"custom/power" =
let
power-menu = pkgs.writeText "power_menu.xml" ''
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<object class="GtkMenu" id="menu">
<child>
<object class="GtkMenuItem" id="lock">
<property name="label">Lock 🔒</property>
</object>
</child>
<child>
<object class="GtkSeparatorMenuItem" id="delimiter1"/>
</child>
<child>
<object class="GtkMenuItem" id="reboot">
<property name="label">Reboot </property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="poweroff">
<property name="label">Poweroff 💤</property>
</object>
</child>
</object>
</interface>
'';
in
{
"format" = "";
"tooltip" = false;
"menu" = "on-click";
"menu-file" = power-menu;
"menu-actions" = {
"lock" = "${lib.getExe pkgs.swaylock}";
"reboot" = "reboot";
"poweroff" = "poweroff";
};
};
};
};
home.file."${config.xdg.configHome}/waybar/style.css" = {
text = ''
${builtins.readFile ./default-waybar-style.css}
#systemd-failed-units {
padding-left: 30px;
padding-right: 30px;
background-color: red;
}
window#waybar {
background: linear-gradient(
to right,
rgb(131, 80, 117) 15%,
rgb(158, 103, 143) 30%,
rgb(131, 80, 117) 45%,
#db88c5
);
color: black;
}
#mpris {
color: white;
}
#systemd-failed-units {
padding-left: 30px;
padding-right: 30px;
background-color: red;
}
#custom-music-back, #custom-music-next {
font-size: 20px;
color: white;
}
#mpris {
color: white;
}
#custom-music-back {
padding: 0 10px 0 15px;
}
#custom-music-next {
padding: 0 10px;
}
#custom-music-back, #custom-music-next {
font-size: 20px;
color: white;
}
#clock {
background: unset;
color: white;
}
#custom-music-back {
padding: 0 10px 0 15px;
}
#custom-music-next {
padding: 0 10px;
}
#privacy *, #pulseaudio, #cpu, #memory, #tray {
background-color: unset;
color: black;
}
#clock {
background: unset;
color: white;
}
#custom-power {
padding-left: 15px;
padding-right: 15px;
font-size: 30px;
background-color: rebeccapurple;
color: white;
}
'';
#privacy *, #pulseaudio, #cpu, #memory, #tray, #network, #power-profiles-daemon, #battery {
background-color: unset;
color: black;
}
#custom-power {
padding-left: 15px;
padding-right: 15px;
font-size: 30px;
background-color: rebeccapurple;
color: white;
}
'';
};
};
}

View file

@ -12,17 +12,10 @@ in
# inputs.hardware.nixosModules.common-cpu-amd
# inputs.hardware.nixosModules.common-ssd
# You can also split up your configuration and import pieces of it here:
# ./users.nix
inputs.niri.nixosModules.niri
# Import your generated (nixos-generate-config) hardware configuration
./hardware-configuration.nix
];
nixpkgs = {
# You can add overlays here
overlays = [
# If you want to use overlays exported from other flakes:
# neovim-nightly-overlay.overlays.default
@ -35,14 +28,9 @@ in
# };
# )
];
# Configure your nixpkgs instance
config = {
# Disable if you don't want unfree packages
allowUnfree = true;
nvidia.acceptLicense = true;
permittedInsecurePackages = [
"electron-25.9.0" # Temporary fix until the next obsidian release: https://github.com/NixOS/nixpkgs/issues/273611
];
};
};
@ -63,41 +51,21 @@ in
};
};
networking = {
hostName = "nixos";
networkmanager.enable = true;
extraHosts =
''
192.168.122.44 illumos-vm
'';
};
networking.networkmanager.enable = true;
time.timeZone = "Europe/Zurich";
# Windows sets the hardware clock in local time by default.
time.hardwareClockInLocalTime = true;
i18n.defaultLocale = "en_US.UTF-8";
# Bootloader.
# boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.efi.efiSysMountPoint = "/boot/efi";
boot.loader.grub = {
enable = true;
device = "nodev";
efiSupport = true;
useOSProber = true;
minegrub-theme = {
enable = true;
};
};
boot.binfmt = {
emulatedSystems = [ "wasm32-wasi" "aarch64-linux" ];
preferStaticEmulators = true; # required to work with podman (apparently)
};
boot.kernelPackages = pkgs.linuxPackages_6_6;
boot.kernelPackages = pkgs.linuxPackages_latest;
boot.kernel.sysctl = {
"net.ipv4.ip_forward" = 1;
@ -116,13 +84,6 @@ in
"kernel.sysrq" = 340;
};
boot.supportedFilesystems = [ "ntfs" ];
fileSystems."/mnt/nas" = {
device = "192.168.178.47:/volume1/homes";
fsType = "nfs";
};
# Enable the Wayland windowing system.
services.displayManager.gdm.enable = true;
services.desktopManager = {
@ -145,11 +106,6 @@ in
variant = "";
};
# ndivia drivers
# long story short night light mode is currently broken with nvidia drivers. LMAO
# - https://forums.developer.nvidia.com/t/screen-freezes-at-random-intervals-with-rtx-4060-max-q-mobile-multiple-driver-versions-tested/295811/6?u=mirao
videoDrivers = [ "nvidia" ];
# mouse settings
# https://unix.stackexchange.com/questions/58900/how-to-scroll-the-screen-using-the-middle-click
#libinput.mouse = {
@ -159,12 +115,6 @@ in
#};
};
hardware.nvidia = {
# https://github.com/NixOS/nixpkgs/issues/299944#issuecomment-2027246826
modesetting.enable = true;
open = true;
};
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
@ -184,8 +134,6 @@ in
};
programs.waybar.enable = true;
programs.coolercontrol.enable = true;
programs.coolercontrol.nvidiaSupport = true;
services.flatpak.enable = true;
console.keyMap = "sg";
@ -224,11 +172,6 @@ in
services.nixseparatedebuginfod.enable = true;
services.tailscale = {
enable = true;
useRoutingFeatures = "both";
};
users = {
users = {
nora = {
@ -273,29 +216,6 @@ in
};
};
systemd.services.paperless-ngx-backup = {
description = "paperless-ngx data backup to NAS";
serviceConfig = {
Type = "oneshot";
User = "nora";
ExecStart = ''
${lib.getExe pkgs.rsync} -a -v --delete --exclude=redis /home/nora/.local/share/paperless-ngx/ /mnt/nas/HEY/_Nora/paperless/backup
'';
};
};
systemd.timers.paperless-ngx-backup = {
description = "paperless-ngx data backup to NAS";
wantedBy = [ "timers.target" ];
timerConfig = {
Unit = "paperless-ngx-backup.service";
OnCalendar = "daily UTC";
RandomizedDelaySec = 1800;
FixedRandomDelay = true;
Persistent = true; # ensure it still runs if the computer was down at the timer of trigger
};
};
xdg.mime.defaultApplications = {
"text/html" = "firefox.desktop";
"x-scheme-handler/http" = "firefox.desktop";
@ -304,28 +224,6 @@ in
# This is apparently used by Electron? Maybe not anymore.
environment.sessionVariables.DEFAULT_BROWSER = lib.getExe pkgs.firefox;
services.openssh = {
enable = true;
hostKeys = [
{
path = "/etc/ssh/ssh_host_ed25519_key";
type = "ed25519";
}
{
# P256
path = "/etc/ssh/ssh_host_ecdsa_key";
type = "ecdsa";
}
{
bits = 4096;
path = "/etc/ssh/ssh_host_rsa_key";
type = "rsa";
}
];
settings.PermitRootLogin = "no";
settings.PasswordAuthentication = false;
};
environment.enableDebugInfo = true;
environment.systemPackages = with pkgs; [
vim
@ -334,14 +232,8 @@ in
# for firefox-nightly
# inputs.firefox.packages.${pkgs.system}.firefox-nightly-bin
firefox
os-prober
git
(linuxKernel.packagesFor
(linuxKernel.kernels.linux_6_6.override {
stdenv = gcc12Stdenv;
buildPackages = pkgs.buildPackages // { stdenv = gcc12Stdenv; };
})
).perf
(linuxKernel.packagesFor linuxKernel.kernels.linux_latest).perf
fish
unzip
(steam.override {
@ -357,7 +249,6 @@ in
man-pages
man-pages-posix
bpftrace
tailscale
file
comma
alacritty
@ -403,32 +294,12 @@ in
};
};
# TODO: ENABLE NVIDIA DRIVERS WHEN THEY STOP BEING READY
#hardware.nvidia-container-toolkit.enable = true;
hardware.enableAllFirmware = true;
# Open ports in the firewall.
networking.firewall = {
enable = true;
trustedInterfaces = [ "tailscale0" ];
allowedUDPPorts = [ config.services.tailscale.port ];
allowedTCPPorts = [ /*SSH*/ 22 ];
# https://github.com/tailscale/tailscale/issues/4432#issuecomment-1112819111
checkReversePath = "loose";
};
networking.interfaces.enp39s0.wakeOnLan.enable = true;
system.nixos.distroName = "🏳";
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "22.11";
}

View file

@ -1,7 +1,7 @@
# 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, ... }:
{ config, lib, modulesPath, ... }:
{
imports =

109
nixos/desktop.nix Normal file
View file

@ -0,0 +1,109 @@
{ pkgs, config, ... }: {
imports = [
./desktop-hardware-configuration.nix
./paperless.nix
./configuration.nix
];
networking = {
hostName = "nixos";
extraHosts =
''
192.168.122.44 illumos-vm
'';
};
# Windows sets the hardware clock in local time by default.
time.hardwareClockInLocalTime = true;
boot.loader.grub = {
enable = true;
device = "nodev";
efiSupport = true;
useOSProber = true;
minegrub-theme = {
enable = true;
};
};
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.efi.efiSysMountPoint = "/boot/efi";
boot.supportedFilesystems = [ "ntfs" ];
fileSystems."/mnt/nas" = {
device = "192.168.178.47:/volume1/homes";
fsType = "nfs";
};
services.xserver = {
# ndivia drivers
# long story short night light mode is currently broken with nvidia drivers. LMAO
# - https://forums.developer.nvidia.com/t/screen-freezes-at-random-intervals-with-rtx-4060-max-q-mobile-multiple-driver-versions-tested/295811/6?u=mirao
videoDrivers = [ "nvidia" ];
};
hardware.nvidia = {
# https://github.com/NixOS/nixpkgs/issues/299944#issuecomment-2027246826
modesetting.enable = true;
open = true;
};
programs.coolercontrol.enable = true;
programs.coolercontrol.nvidiaSupport = true;
services.tailscale = {
enable = true;
useRoutingFeatures = "both";
};
services.openssh = {
enable = true;
hostKeys = [
{
path = "/etc/ssh/ssh_host_ed25519_key";
type = "ed25519";
}
{
# P256
path = "/etc/ssh/ssh_host_ecdsa_key";
type = "ecdsa";
}
{
bits = 4096;
path = "/etc/ssh/ssh_host_rsa_key";
type = "rsa";
}
];
settings.PermitRootLogin = "no";
settings.PasswordAuthentication = false;
};
environment.systemPackages = with pkgs; [
tailscale
os-prober
];
networking.firewall = {
trustedInterfaces = [ "tailscale0" ];
allowedUDPPorts = [ config.services.tailscale.port ];
allowedTCPPorts = [ /*SSH*/ 22 ];
# https://github.com/tailscale/tailscale/issues/4432#issuecomment-1112819111
checkReversePath = "loose";
};
# TODO: ENABLE NVIDIA DRIVERS WHEN THEY STOP BEING READY
#hardware.nvidia-container-toolkit.enable = true;
networking.interfaces.enp39s0.wakeOnLan.enable = true;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "22.11";
}

View file

@ -0,0 +1,40 @@
# 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 + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/646dc4c1-53aa-4fce-9328-f7c42a5b5ea8";
fsType = "ext4";
};
boot.initrd.luks.devices."luks-c16da30d-5953-4ce9-995a-f4acd77dcaf7".device = "/dev/disk/by-uuid/c16da30d-5953-4ce9-995a-f4acd77dcaf7";
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/E494-B917";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

15
nixos/laptop.nix Normal file
View file

@ -0,0 +1,15 @@
{ ... }: {
imports = [
./laptop-hardware-configuration.nix
./configuration.nix
];
networking = {
hostName = "scrap";
};
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
system.stateVersion = "25.11";
}

23
nixos/paperless.nix Normal file
View file

@ -0,0 +1,23 @@
{ lib, pkgs, ... }: {
systemd.services.paperless-ngx-backup = {
description = "paperless-ngx data backup to NAS";
serviceConfig = {
Type = "oneshot";
User = "nora";
ExecStart = ''
${lib.getExe pkgs.rsync} -a -v --delete --exclude=redis /home/nora/.local/share/paperless-ngx/ /mnt/nas/HEY/_Nora/paperless/backup
'';
};
};
systemd.timers.paperless-ngx-backup = {
description = "paperless-ngx data backup to NAS";
wantedBy = [ "timers.target" ];
timerConfig = {
Unit = "paperless-ngx-backup.service";
OnCalendar = "daily UTC";
RandomizedDelaySec = 1800;
FixedRandomDelay = true;
Persistent = true; # ensure it still runs if the computer was down at the timer of trigger
};
};
}