diff --git a/kuro/configuration.nix b/kuro/configuration.nix deleted file mode 100644 index aaeb0c9..0000000 --- a/kuro/configuration.nix +++ /dev/null @@ -1,34 +0,0 @@ -# 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`). - -{ config, pkgs, ... }: - -{ - imports = - [ - # Include the results of the hardware scan. - ./hardware-configuration.nix - - # Shared config of all machines - /data/nixos/common.nix - ]; - - # amd graphics - hardware.opengl.extraPackages = with pkgs; [ amdvlk rocm-opencl-icd rocm-opencl-runtime ]; - - # use systemd-networkd, fixed IPv4, dynamic IPv6 - networking.hostName = "kuro"; - networking.useDHCP = false; - networking.nameservers = [ "192.168.13.1" ]; - systemd.network = { - enable = true; - networks."10-wan" = { - matchConfig.Name = "enp2s0"; - address = [ "192.168.13.101/24" ]; - routes = [ { routeConfig.Gateway = "192.168.13.1"; } ]; - networkConfig.IPv6AcceptRA = true; - linkConfig.RequiredForOnline = "routable"; - }; - }; -} diff --git a/kuro/hardware-configuration.nix b/kuro/hardware-configuration.nix deleted file mode 100644 index 06c2ddb..0000000 --- a/kuro/hardware-configuration.nix +++ /dev/null @@ -1,66 +0,0 @@ -# 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" "ahci" "usbhid" "sd_mod" ]; - boot.initrd.kernelModules = [ "amdgpu" ]; - boot.kernelModules = [ "kvm-amd" ]; - - fileSystems."/" = - { device = "none"; - fsType = "tmpfs"; - neededForBoot = true; - options = [ "defaults" "size=8G" "mode=755" ]; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-id/ata-Samsung_SSD_870_QVO_4TB_S5STNF0W806802J-part1"; - fsType = "vfat"; - neededForBoot = true; - }; - - fileSystems."/nix" = - { device = "/dev/disk/by-id/ata-Samsung_SSD_870_QVO_4TB_S5STNF0W806802J-part2"; - fsType = "bcachefs"; - neededForBoot = true; - options = [ "noatime" "nodiratime" ]; - }; - - fileSystems."/data" = - { device = "/dev/disk/by-id/ata-Samsung_SSD_870_QVO_4TB_S5STNF0W806802J-part3"; - fsType = "bcachefs"; - neededForBoot = true; - options = [ "noatime" "nodiratime" ]; - }; - - fileSystems."/home" = - { device = "/data/home"; - fsType = "none"; - neededForBoot = true; - options = [ "bind" ]; - depends = [ "/data" ]; - }; - - fileSystems."/root" = - { device = "/data/root"; - fsType = "none"; - neededForBoot = true; - options = [ "bind" ]; - depends = [ "/data" ]; - }; - - fileSystems."/etc/nixos" = - { device = "/data/nixos/kuro"; - fsType = "none"; - neededForBoot = true; - options = [ "bind" ]; - depends = [ "/data" ]; - }; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/kuro/install.txt b/kuro/install.txt deleted file mode 100644 index 2a44b64..0000000 --- a/kuro/install.txt +++ /dev/null @@ -1,98 +0,0 @@ -# -# kill old efi boot stuff -# - -efibootmgr -efibootmgr -b 0 -B -efibootmgr -b 1 -B -efibootmgr -b 2 -B -efibootmgr -b 3 -B -efibootmgr -b 4 -B -efibootmgr - -# -# install script below -# - -# fix unlocking https://nixos.wiki/wiki/Bcachefs -nix-env -iA nixos.keyutils -keyctl link @u @s - -# Defining some helper variables (these will be used in later code -# blocks as well, so make sure to use the same terminal session or -# redefine them later) -DISK=/dev/disk/by-id/ata-Samsung_SSD_870_QVO_4TB_S5STNF0W806802J -HOST=kuro - -# kill old data -sgdisk --zap-all $DISK -blkdiscard -v $DISK -wipefs -a $DISK -gdisk -l $DISK - -# create partitions -parted $DISK -- mklabel gpt -sgdisk -n 1:0:+1024M -c 1:"EFI System Partition" -t 1:EF00 $DISK -sgdisk -n 2:0:+256G -c 2:"nix" -t 2:8e00 $DISK -sgdisk -n 3:0:0 -c 3:"data" -t 3:8e00 $DISK -parted $DISK -- set 1 boot on - -sleep 5 - -# take a look -cat /proc/partitions - -# boot partition -mkfs.fat -F 32 -n EFIBOOT $DISK-part1 - -# create encrypted bcachefs -bcachefs format --block_size=4096 --errors=ro --metadata_checksum=xxhash --data_checksum=xxhash --compression=lz4 --wide_macs --acl --encrypted --fs_label=nix --discard -f $DISK-part2 -bcachefs format --block_size=4096 --errors=ro --metadata_checksum=xxhash --data_checksum=xxhash --compression=lz4 --wide_macs --acl --encrypted --fs_label=data --discard -f $DISK-part3 - -# prepare install -mount -t tmpfs none /mnt - -# Create directories to mount file systems on -mkdir -p /mnt/{data,nix,home,boot,root,etc/nixos} - -# mount the ESP -mount $DISK-part1 /mnt/boot - -# mount bcachefs stuff -mount -o noatime,nodiratime $DISK-part2 /mnt/nix -mount -o noatime,nodiratime $DISK-part3 /mnt/data - -# bind mount persistent stuff to data -mkdir -p /mnt/{data/home,data/root,data/nixos/$HOST} -mount --bind /mnt/data/home /mnt/home -mount --bind /mnt/data/root /mnt/root -mount --bind /mnt/data/nixos/$HOST /mnt/etc/nixos - -# take a look -mount - -# configure -nixos-generate-config --root /mnt - -# save /mnt/etc/nixos/hardware-configuration.nix /mnt/etc/nixos/configuration.nix - -cp /mnt/etc/nixos/hardware-configuration.nix /tmp -cp /mnt/etc/nixos/configuration.nix /tmp - -# copy config data - -# patch some paths there - -sudo scp -r /data/nixos root@192.168.13.101:/mnt/data - -# install - -nixos-install --no-root-passwd --root /mnt - -# unmount all stuff - -umount -Rl /mnt - -# sync all /data after the install - -sudo -E rsync -va --delete --one-file-system /data root@192.168.13.101:/ diff --git a/mio/configuration.nix b/mio/configuration.nix deleted file mode 100644 index 8362c38..0000000 --- a/mio/configuration.nix +++ /dev/null @@ -1,404 +0,0 @@ -# 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`). - -{ config, pkgs, ... }: -let - impermanence = builtins.fetchTarball "https://github.com/nix-community/impermanence/archive/master.tar.gz"; - home-manager = builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/master.tar.gz"; -in -{ - imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - - # manage persistent files - "${impermanence}/nixos.nix" - - # home manager for per user config - "${home-manager}/nixos" - ]; - - # 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. It's 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). - system.stateVersion = "23.05"; # Did you read the comment? - - # use the latest kernel - boot.kernelPackages = pkgs.linuxPackages_latest; - - # Use the systemd-boot EFI boot loader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - # use a high resolution - boot.loader.systemd-boot.consoleMode = "max"; - - # use systemd early - boot.initrd.systemd.enable = true; - - # setup the console stuff early - console.earlySetup = true; - - networking.hostName = "mio"; # Define your hostname. - - # keep some stuff persistent - environment.persistence."/nix/persistent" = { - directories = [ - # NetworkManager connections - { directory = "/etc/NetworkManager"; user = "root"; group = "root"; mode = "u=rwx,g=rx,o=rx"; } - { directory = "/var/lib/NetworkManager"; user = "root"; group = "root"; mode = "u=rwx,g=rx,o=rx"; } - ]; - }; - - # swap to RAM - zramSwap.enable = true; - - # Set your time zone. - time.timeZone = "Europe/Berlin"; - - # default locale is English US - i18n.defaultLocale = "en_US.UTF-8"; - - # use German stuff for sorting/date/.... - i18n.extraLocaleSettings = { - LC_ADDRESS = "de_DE.UTF-8"; - LC_IDENTIFICATION = "de_DE.UTF-8"; - LC_MEASUREMENT = "de_DE.UTF-8"; - LC_MONETARY = "de_DE.UTF-8"; - LC_NAME = "de_DE.UTF-8"; - LC_NUMERIC = "de_DE.UTF-8"; - LC_PAPER = "de_DE.UTF-8"; - LC_TELEPHONE = "de_DE.UTF-8"; - LC_TIME = "de_DE.UTF-8"; - }; - - # ensure we build all needed locales - i18n.supportedLocales = ["en_US.UTF-8/UTF-8" "de_DE.UTF-8/UTF-8"]; - - # keep power consumption and heat in check - powerManagement.enable = true; - powerManagement.cpuFreqGovernor = "powersave"; - services.thermald.enable = true; - - # allow firmware updates - services.fwupd.enable = true; - - # X11 settings - services.xserver = { - libinput.enable = true; - upscaleDefaultCursor = false; - - # Configure keymap in X11 - layout = "de"; - xkbVariant = ""; - - # Enable the KDE Plasma Desktop Environment. - desktopManager.plasma5.enable = true; - desktopManager.plasma5.runUsingSystemd = true; - desktopManager.plasma5.phononBackend = "vlc"; - - # use SDDM and Plasma Wayland - enable = true; - displayManager.sddm.enable = true; - displayManager.defaultSession = "plasmawayland"; - }; - - - # enable sound with PipeWire - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - jack.enable = true; - pulse.enable = true; - }; - - # allow realtime - security.rtkit.enable = true; - - # package manager config - nix = { - # auto optimize the store - settings.auto-optimise-store = true; - - # cleanup the store from time to time - gc = { - automatic = true; - dates = "daily"; - options = "--delete-older-than 7d"; - }; - - # avoid that nix hogs all CPUs - settings = { - max-jobs = 1; - cores = 4; - }; - - # we want some experimental features like nix search - extraOptions = ''experimental-features = nix-command flakes''; - }; - - # avoid suspend ever to be triggered - systemd.targets.sleep.enable = false; - systemd.targets.suspend.enable = false; - systemd.targets.hibernate.enable = false; - systemd.targets.hybrid-sleep.enable = false; - - # let home manager install stuff to /etc/profiles - home-manager.useUserPackages = true; - - # use global pkgs - home-manager.useGlobalPkgs = true; - - # Allow unfree packages - nixpkgs.config.allowUnfree = true; - - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - alacritty - ark - aspellDicts.de - aspellDicts.en - borgbackup - btop - chromium - clamav - clinfo - filelight - firefox - gitFull - glxinfo - hunspellDicts.de_DE - hunspellDicts.en_US - libva-utils - lsof - mc - unrar - unzip - vulkan-tools - wayland-utils - zsh - zsh-powerlevel10k - ]; - - # allow keyboard configure tools to work - hardware.keyboard.qmk.enable = true; - - # add ~/bin to PATH - environment.homeBinInPath = true; - - # more fonts for all users - fonts = { - # more fonts - fonts = with pkgs; [ - # nice mono spaced font - iosevka-bin - - # needed for powerlevel10k zsh stuff - meslo-lgs-nf - - # unicode capable font - noto-fonts - noto-fonts-extra - noto-fonts-emoji - - # other nice mono spaced font - victor-mono - ]; - - # tune fontconfig - fontconfig = { - # better default fonts - defaultFonts = { - monospace = ["Iosevka"]; - }; - }; - }; - - # 64-bit GL - hardware.opengl.driSupport = true; - - # proper lutris gaming for 32-bit stuff - hardware.opengl.driSupport32Bit = true; - - # let's get SSD status - services.smartd.enable = true; - - # use ZSH per default - users.defaultUserShell = pkgs.zsh; - - # nice zsh config - programs.zsh = { - # zsh wanted - enable = true; - - # some env vars I want in all of my shells - shellInit = "export MOZ_ENABLE_WAYLAND=1; export POWERLEVEL9K_DISABLE_CONFIGURATION_WIZARD=true;"; - - # great prompt - promptInit = "source ${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k/powerlevel10k.zsh-theme; if [ -f ~/.p10k.zsh ]; then source ~/.p10k.zsh; fi;"; - }; - - # dconf is needed for gtk, see https://nixos.wiki/wiki/KDE - programs.dconf.enable = true; - - # enable VirtualBox - virtualisation.virtualbox.host.enable = true; - users.extraGroups.vboxusers.members = [ "cullmann" ]; - - # configure sudo - security.sudo.execWheelOnly = true; - security.sudo.extraConfig = '' - Defaults lecture = never - ''; - - - ### - ### per user configuration below - ### - - # all users and passwords are defined here - users.mutableUsers = false; - - # - # administrator - # - - users.users.root = { - # init password - hashedPassword = builtins.readFile "/data/nixos/password.secret"; - }; - - home-manager.users.root = { pkgs, ... }: { - # initial version - home.stateVersion = "22.11"; - - # sometimes doesn't work - manual.manpages.enable = false; - - # generate the shell config - programs.zsh = { - enable = true; - shellAliases = { - ll = "ls -l"; - }; - }; - }; - - # - # my main user - # - - users.users.cullmann = { - # hard code UID for stability over machines - uid = 1000; - - # normal user - isNormalUser = true; - - # it's me :P - description = "Christoph Cullmann"; - - # allow sudo for my main user - extraGroups = [ "wheel" ]; - - # init password - hashedPassword = builtins.readFile "/data/nixos/password.secret"; - }; - - home-manager.users.cullmann = { pkgs, ... }: { - # initial version - home.stateVersion = "22.11"; - - # extra packages, stuff for work/kde/... - home.packages = with pkgs; [ - calibre - emacs - falkon - fdupes - ffmpeg - file - gimp - go - hugo - inetutils - kate - kcalc - keychain - kompare - konversation - krita - libjxl - libreoffice - linuxKernel.packages.linux_latest_libre.perf - neochat - nmap - okteta - okular - pciutils - perf-tools - pulseaudio - qmk - remmina - signal-desktop - tcl - texlive.combined.scheme-small - tigervnc - tk - tokodon - usbutils - via - vial - vlc - vscodium - xorg.xhost - ]; - - # https://github.com/nix-community/nix-direnv - programs.direnv.enable = true; - programs.direnv.nix-direnv.enable = true; - - # reverse package search, https://github.com/nix-community/nix-index - programs.nix-index.enable = true; - - # generate the shell config - programs.zsh = { - enable = true; - shellAliases = { - ll = "ls -l"; - - # system build/update/cleanup - update = "sudo nixos-rebuild switch"; - upgrade = "sudo nixos-rebuild switch --upgrade"; - gc = "sudo nix-collect-garbage --delete-older-than 7d"; - verify = "sudo nix --extra-experimental-features nix-command store verify --all"; - optimize = "sudo nix --extra-experimental-features nix-command store optimise"; - - # ssh around in the local network - kuro = "ssh kuro.fritz.box"; - kuroroot = "ssh root@kuro.fritz.box"; - mini = "ssh mini.fritz.box"; - miniroot = "ssh root@mini.fritz.box"; - neko = "ssh neko.fritz.box"; - nekoroot = "ssh root@neko.fritz.box"; - }; - }; - - # enable keychain - programs.keychain = { - enable = true; - keys = [ "id_ed25519" ]; - }; - }; - - # networking.hostName = "nixos"; # Define your hostname. - # Pick only one of the below networking options. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. -} - diff --git a/mio/hardware-configuration.nix b/mio/hardware-configuration.nix deleted file mode 100644 index b17b454..0000000 --- a/mio/hardware-configuration.nix +++ /dev/null @@ -1,65 +0,0 @@ -# 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" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ "amdgpu" ]; - boot.kernelModules = [ "kvm-amd" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "none"; - fsType = "tmpfs"; - options = [ "defaults" "size=8G" "mode=755" ]; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/4196-36DD"; - fsType = "vfat"; - }; - - boot.initrd.luks.devices."crypt-disk1".device = "/dev/disk/by-uuid/04638cc4-d719-4ef6-98d7-dd809032d608"; - boot.initrd.luks.devices."crypt-disk1".allowDiscards = true; - boot.initrd.luks.devices."crypt-disk1".bypassWorkqueues = true; - - fileSystems."/nix" = - { device = "/dev/mapper/crypt-disk1"; - fsType = "btrfs"; - options = [ "subvol=nix" "noatime" "compress=zstd" ]; - }; - - fileSystems."/data" = - { device = "/dev/mapper/crypt-disk1"; - fsType = "btrfs"; - options = [ "subvol=data" "noatime" "compress=zstd" ]; - }; - - fileSystems."/home" = - { device = "/data/home"; - fsType = "none"; - options = [ "bind" ]; - }; - - fileSystems."/root" = - { device = "/data/root"; - fsType = "none"; - options = [ "bind" ]; - }; - - fileSystems."/etc/nixos" = - { device = "/data/nixos/mio"; - fsType = "none"; - options = [ "bind" ]; - }; - - swapDevices = [ ]; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -}