split into tower and laptop config
This commit is contained in:
15
flake.lock
generated
15
flake.lock
generated
@@ -7,32 +7,31 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1758463745,
|
||||
"narHash": "sha256-uhzsV0Q0I9j2y/rfweWeGif5AWe0MGrgZ/3TjpDYdGA=",
|
||||
"lastModified": 1762041416,
|
||||
"narHash": "sha256-rmJKABRXnhFjjI6RB/MnEvLTQa569zu684Th9y6UlOI=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "3b955f5f0a942f9f60cdc9cacb7844335d0f21c3",
|
||||
"rev": "c0016dd14773f4ca0b467b74c7cdcc501570df4b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"ref": "release-25.05",
|
||||
"repo": "home-manager",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1760139962,
|
||||
"narHash": "sha256-4xggC56Rub3WInz5eD7EZWXuLXpNvJiUPahGtMkwtuc=",
|
||||
"lastModified": 1761907660,
|
||||
"narHash": "sha256-kJ8lIZsiPOmbkJypG+B5sReDXSD1KGu2VEPNqhRa/ew=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "7e297ddff44a3cc93673bb38d0374df8d0ad73e4",
|
||||
"rev": "2fb006b87f04c4d3bdf08cfdbc7fab9c13d94a15",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-25.05",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
|
||||
28
flake.nix
28
flake.nix
@@ -2,10 +2,10 @@
|
||||
description = "NixOS + Home Manager config";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager/release-25.05";
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
outputs = inputs@{ self, nixpkgs, home-manager, ... }: {
|
||||
|
||||
|
||||
nixosConfigurations = {
|
||||
segfault-machine = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
@@ -26,7 +27,7 @@
|
||||
home-manager.useUserPackages = true;
|
||||
|
||||
home-manager.users.lukas.imports = [
|
||||
./home/lukas/default.nix
|
||||
./home/lukas/laptop/default.nix
|
||||
];
|
||||
|
||||
home-manager.extraSpecialArgs = { inherit inputs; };
|
||||
@@ -34,6 +35,27 @@
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
segfault-tower = nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { inherit inputs; };
|
||||
modules = [
|
||||
./hosts/segfault-tower/configuration.nix
|
||||
|
||||
home-manager.nixosModules.home-manager {
|
||||
home-manager.backupFileExtension = "backup";
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
|
||||
home-manager.users.lukas.imports = [
|
||||
./home/lukas/tower/default.nix
|
||||
];
|
||||
|
||||
home-manager.extraSpecialArgs = { inherit inputs; };
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
{ inputs, ... }:
|
||||
{
|
||||
imports = [ inputs.catppuccin.homeModules.catppuccin ];
|
||||
|
||||
catppuccin = {
|
||||
accent = "mauve";
|
||||
flavor = "mocha";
|
||||
enable = true;
|
||||
|
||||
cursors = {
|
||||
enable = true;
|
||||
flavor = "mocha";
|
||||
accent = "mauve";
|
||||
};
|
||||
|
||||
waybar.enable = false;
|
||||
rofi.enable = false;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
let
|
||||
grammars = pkgs.emacsPackages.treesit-grammars.with-all-grammars;
|
||||
grammars = pkgs.emacs.pkgs.treesit-grammars.with-all-grammars;
|
||||
in
|
||||
{
|
||||
programs.emacs = {
|
||||
@@ -5,9 +5,13 @@ in {
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = "Lukas";
|
||||
userEmail = "mail@lukas.contact";
|
||||
extraConfig = {
|
||||
|
||||
settings = {
|
||||
user = {
|
||||
mail = "mail@lukas.contact";
|
||||
name = "Lukas";
|
||||
};
|
||||
|
||||
commit.gpgsign = true;
|
||||
gpg.format = "ssh";
|
||||
gpg.ssh.allowedSignersFile = "~/.ssh/allowed_signers";
|
||||
@@ -7,7 +7,7 @@
|
||||
syntaxHighlighting.enable = true;
|
||||
autosuggestion.enable = true;
|
||||
|
||||
initContent = "source /etc/nixos/home/lukas/p10k.zsh";
|
||||
initContent = "source /etc/nixos/home/lukas/common/p10k.zsh";
|
||||
sessionVariables = {
|
||||
POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD = "true";
|
||||
};
|
||||
@@ -28,13 +28,8 @@
|
||||
la = "eza --icons -a"; # show all dot-files, short
|
||||
lt = "eza -T --icons --git-ignore --level=4"; # pretty tree, two levels deep
|
||||
|
||||
gs = "git status --short --branch";
|
||||
gl = "git log --oneline --graph --decorate";
|
||||
|
||||
cat ="bat --style=plain --pager=cat"; # pretty ‘cat’
|
||||
less ="bat --style=plain --pager=less"; # pretty ‘less’
|
||||
|
||||
update = "sudo nixos-rebuild switch --flake /etc/nixos/#segfault-machine";
|
||||
};
|
||||
|
||||
};
|
||||
@@ -1,5 +1,3 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
xdg.enable = true;
|
||||
xdg.mimeApps = {
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
imports = [
|
||||
./brave.nix
|
||||
# ./catppuccin.nix
|
||||
./direnv.nix
|
||||
./emacs.nix
|
||||
./git.nix
|
||||
./packages.nix
|
||||
./shell.nix
|
||||
./alacritty.nix
|
||||
./tmux.nix
|
||||
./xgd.nix
|
||||
./hyprland.nix
|
||||
./waybar.nix
|
||||
./rofi.nix
|
||||
./libreoffice.nix
|
||||
];
|
||||
|
||||
home.username = "lukas";
|
||||
home.homeDirectory = "/home/lukas";
|
||||
home.stateVersion = "25.05";
|
||||
}
|
||||
|
||||
22
home/lukas/laptop/default.nix
Normal file
22
home/lukas/laptop/default.nix
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
imports = [
|
||||
../common/brave.nix
|
||||
../common/direnv.nix
|
||||
../common/emacs.nix
|
||||
../common/git.nix
|
||||
../common/shell.nix
|
||||
../common/alacritty.nix
|
||||
../common/tmux.nix
|
||||
../common/xgd.nix
|
||||
../common/libreoffice.nix
|
||||
./packages.nix
|
||||
./hyprland.nix
|
||||
./waybar.nix
|
||||
./rofi.nix
|
||||
];
|
||||
|
||||
home.username = "lukas";
|
||||
home.homeDirectory = "/home/lukas";
|
||||
home.stateVersion = "25.05";
|
||||
}
|
||||
|
||||
20
home/lukas/tower/default.nix
Normal file
20
home/lukas/tower/default.nix
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
imports = [
|
||||
./packages.nix
|
||||
# ./ollama.nix
|
||||
../common/brave.nix
|
||||
../common/direnv.nix
|
||||
../common/emacs.nix
|
||||
../common/git.nix
|
||||
../common/shell.nix
|
||||
../common/alacritty.nix
|
||||
../common/tmux.nix
|
||||
../common/xgd.nix
|
||||
../common/libreoffice.nix
|
||||
];
|
||||
|
||||
home.username = "lukas";
|
||||
home.homeDirectory = "/home/lukas";
|
||||
home.stateVersion = "25.05";
|
||||
}
|
||||
|
||||
8
home/lukas/tower/ollama.nix
Normal file
8
home/lukas/tower/ollama.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
services.ollama = {
|
||||
enable = true;
|
||||
acceleration = "cuda";
|
||||
# Optional: preload models, see https://ollama.com/library
|
||||
# loadModels = [ "qwen3:30b" "gpt-oss:20b" "deepseek-r1:32b" "gemma3:27b"];
|
||||
};
|
||||
}
|
||||
49
home/lukas/tower/packages.nix
Normal file
49
home/lukas/tower/packages.nix
Normal file
@@ -0,0 +1,49 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
fonts.fontconfig.enable = true;
|
||||
|
||||
home.packages = [
|
||||
pkgs.thunderbird
|
||||
pkgs.nextcloud-client
|
||||
pkgs.keepassxc
|
||||
pkgs.telegram-desktop
|
||||
pkgs.element-desktop
|
||||
|
||||
pkgs.tree
|
||||
pkgs.htop
|
||||
pkgs.neovim
|
||||
pkgs.wget
|
||||
pkgs.unzip
|
||||
|
||||
pkgs.feather
|
||||
|
||||
pkgs.firefox
|
||||
|
||||
pkgs.ranger
|
||||
|
||||
pkgs.nerd-fonts.fira-code
|
||||
pkgs.fira-code
|
||||
pkgs.meslo-lgs-nf
|
||||
|
||||
pkgs.eza
|
||||
pkgs.bat
|
||||
pkgs.ripgrep
|
||||
|
||||
pkgs.seahorse
|
||||
|
||||
pkgs.binutils
|
||||
pkgs.gcc
|
||||
|
||||
pkgs.scenebuilder
|
||||
|
||||
pkgs.nil
|
||||
|
||||
pkgs.zotero
|
||||
pkgs.jabref
|
||||
|
||||
(pkgs.aspellWithDicts
|
||||
(dicts: with dicts; [ de en en-computers ]))
|
||||
];
|
||||
}
|
||||
|
||||
45
hosts/segfault-tower/configuration.nix
Normal file
45
hosts/segfault-tower/configuration.nix
Normal file
@@ -0,0 +1,45 @@
|
||||
# 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.nix
|
||||
../../users/lukas.nix
|
||||
../../modules/desktop/gnome.nix
|
||||
../../modules/input/katana.nix
|
||||
../../modules/networking/networkmanager.nix
|
||||
../../modules/networking/bluetooth.nix
|
||||
../../modules/system/locale.nix
|
||||
../../modules/system/suspend-and-hibernate.nix
|
||||
../../modules/system/nvidia.nix
|
||||
../../modules/system/audio.nix
|
||||
../../modules/system/printing.nix
|
||||
../../modules/system/docker.nix
|
||||
../../modules/system/gpg.nix
|
||||
../../modules/system/virtualbox.nix
|
||||
../../modules/system/mullvad.nix
|
||||
];
|
||||
|
||||
# Bootloader.
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||
|
||||
boot.initrd.luks.devices."luks-b10eb0c6-67b8-40b6-bba4-83d38267abad".device = "/dev/disk/by-uuid/b10eb0c6-67b8-40b6-bba4-83d38267abad";
|
||||
|
||||
boot.resumeDevice = "/dev/mapper/luks-b10eb0c6-67b8-40b6-bba4-83d38267abad";
|
||||
|
||||
hardware.enableAllFirmware = true;
|
||||
|
||||
networking.hostName = "segfault-tower";
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# Version festlegen
|
||||
system.stateVersion = "25.11";
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
}
|
||||
38
hosts/segfault-tower/hardware.nix
Normal file
38
hosts/segfault-tower/hardware.nix
Normal file
@@ -0,0 +1,38 @@
|
||||
# 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 = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/70a079c3-a222-473d-ba56-2f9bc60de4b5";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
boot.initrd.luks.devices."luks-947b9aa6-e5dc-4e1e-83a7-7a77a7fe84f5".device = "/dev/disk/by-uuid/947b9aa6-e5dc-4e1e-83a7-7a77a7fe84f5";
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/E034-ADEC";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0077" "dmask=0077" ];
|
||||
};
|
||||
|
||||
swapDevices =
|
||||
[
|
||||
{ device = "/dev/disk/by-uuid/9afed355-7650-43ae-9fae-1d6c1135f6ee"; }
|
||||
];
|
||||
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
@@ -1,21 +1,13 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
# --- GNOME on Wayland --------------------------------------------------
|
||||
services.xserver.enable = true;
|
||||
services.xserver.displayManager.gdm.enable = true;
|
||||
services.xserver.desktopManager.gnome.enable = true;
|
||||
services.displayManager.gdm.enable = true;
|
||||
services.desktopManager.gnome.enable = true;
|
||||
|
||||
# Electron/Chromium apps → Wayland
|
||||
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||
|
||||
# # --- dconf service & keyboard repeat ----------------------------------
|
||||
# programs.dconf.enable = true; # ← brings the `dconf` option into scope!
|
||||
|
||||
# dconf.settings = {
|
||||
# "org/gnome/desktop/peripherals/keyboard" = {
|
||||
# delay = lib.gvariant.mkUint32 200; # ms before first repeat
|
||||
# repeat-interval = lib.gvariant.mkUint32 25; # ms between repeats ≈40 cps
|
||||
# };
|
||||
# };
|
||||
# To disable installing GNOME's suite of applications
|
||||
# and only be left with GNOME shell.
|
||||
services.gnome.core-apps.enable = false;
|
||||
services.gnome.core-developer-tools.enable = false;
|
||||
services.gnome.games.enable = false;
|
||||
environment.gnome.excludePackages = with pkgs; [ gnome-tour gnome-user-docs ];
|
||||
}
|
||||
|
||||
@@ -1,6 +1,13 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
{
|
||||
console = {
|
||||
earlySetup = true;
|
||||
useXkbConfig = true;
|
||||
};
|
||||
|
||||
services.xserver.xkb.layout = "de";
|
||||
|
||||
time.timeZone = "Europe/Berlin";
|
||||
i18n.defaultLocale = "de_DE.UTF-8";
|
||||
i18n.extraLocaleSettings = {
|
||||
|
||||
31
modules/system/nvidia.nix
Normal file
31
modules/system/nvidia.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
{config, pkgs, ...}:
|
||||
{
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
services.xserver.videoDrivers = ["nvidia"];
|
||||
hardware.graphics = {
|
||||
enable = true;
|
||||
enable32Bit = true;
|
||||
};
|
||||
|
||||
hardware.nvidia = {
|
||||
modesetting.enable = true;
|
||||
|
||||
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
|
||||
# Enable this if you have graphical corruption issues or application crashes after waking
|
||||
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
|
||||
# of just the bare essentials.
|
||||
powerManagement.enable = true;
|
||||
|
||||
# Fine-grained power management. Turns off GPU when not in use.
|
||||
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
|
||||
# (requires offloading)
|
||||
powerManagement.finegrained = false;
|
||||
|
||||
open = false;
|
||||
nvidiaSettings = true;
|
||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
};
|
||||
|
||||
}
|
||||
37
modules/system/suspend-and-hibernate.nix
Normal file
37
modules/system/suspend-and-hibernate.nix
Normal file
@@ -0,0 +1,37 @@
|
||||
{ config, pkgs, ... }: let
|
||||
hibernateEnvironment = {
|
||||
HIBERNATE_SECONDS = "3600";
|
||||
HIBERNATE_LOCK = "/var/run/autohibernate.lock";
|
||||
};
|
||||
in {
|
||||
systemd.services."awake-after-suspend-for-a-time" = {
|
||||
description = "Sets up the suspend so that it'll wake for hibernation";
|
||||
wantedBy = [ "suspend.target" ];
|
||||
before = [ "systemd-suspend.service" ];
|
||||
environment = hibernateEnvironment;
|
||||
script = ''
|
||||
curtime=$(date +%s)
|
||||
echo "$curtime $1" >> /tmp/autohibernate.log
|
||||
echo "$curtime" > $HIBERNATE_LOCK
|
||||
${pkgs.util-linux}/bin/rtcwake -m no -s $HIBERNATE_SECONDS
|
||||
'';
|
||||
serviceConfig.Type = "simple";
|
||||
};
|
||||
systemd.services."hibernate-after-recovery" = {
|
||||
description = "Hibernates after a suspend recovery due to timeout";
|
||||
wantedBy = [ "suspend.target" ];
|
||||
after = [ "systemd-suspend.service" ];
|
||||
environment = hibernateEnvironment;
|
||||
script = ''
|
||||
curtime=$(date +%s)
|
||||
sustime=$(cat $HIBERNATE_LOCK)
|
||||
rm $HIBERNATE_LOCK
|
||||
if [ $(($curtime - $sustime)) -ge $HIBERNATE_SECONDS ] ; then
|
||||
systemctl hibernate
|
||||
else
|
||||
${pkgs.util-linux}/bin/rtcwake -m no -s 1
|
||||
fi
|
||||
'';
|
||||
serviceConfig.Type = "simple";
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user