From 743cca2e063dcd9b7e57df9f201fd31603e7b252 Mon Sep 17 00:00:00 2001 From: Serenity-F Date: Tue, 9 Apr 2024 01:47:46 +1000 Subject: [PATCH] copied proserpina configs to hosts/hades to fill space for now, updated 'README.me', updated 'Serenity OS' version num. --- README.md | 3 ++ flake.nix | 2 +- hosts/hades/configuration.nix | 74 ++++++++++++++++++++++++++ hosts/hades/disko-config.nix | 66 +++++++++++++++++++++++ hosts/hades/hardware-configuration.nix | 29 ++++++++++ hosts/hades/network-configuration.nix | 72 +++++++++++++++++++++++++ 6 files changed, 245 insertions(+), 1 deletion(-) create mode 100644 hosts/hades/configuration.nix create mode 100644 hosts/hades/disko-config.nix create mode 100644 hosts/hades/hardware-configuration.nix create mode 100644 hosts/hades/network-configuration.nix diff --git a/README.md b/README.md index b06dc9d..3cac539 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ To Do: - [ ] per host hardware configurations - [ ] Hades + - [ ] adjust Hades' configs - [X] Proserpina - [ ] per host themes @@ -30,6 +31,7 @@ WIP Flake Structure │ └── packages ├── flake ├── home +│ ├── git │ └── users └── hosts ├── hades @@ -44,6 +46,7 @@ WIP Flake Structure ├── flake.lock ├── flake.nix ├── home +│ ├── git.nix │ ├── home.nix │ └── users │ ├── -coffee.nix diff --git a/flake.nix b/flake.nix index a214b98..8dcfb68 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "SerenityOS v0.3.61"; + description = "SerenityOS v0.3.63"; inputs = { diff --git a/hosts/hades/configuration.nix b/hosts/hades/configuration.nix new file mode 100644 index 0000000..10f8ad7 --- /dev/null +++ b/hosts/hades/configuration.nix @@ -0,0 +1,74 @@ +{ inputs, outputs, config, lib, pkgs, ... }: + +{ + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + # "${builtins.fetchTarball "https://github.com/nix-community/disko/archive/master.tar.gz"}/module.nix" + ./disko-config.nix + ./network-configuration.nix + ../../core/configuration.nix + + ]; + + # Enable swap on luks + boot = { + loader = { + systemd-boot = { + enable = true; + configurationLimit = 5; + }; + efi = { + canTouchEfiVariables = true; + # efiSysMountPoint = "/boot/efi"; + }; + }; + initrd = { + systemd.enable = true; + secrets = { + # "crypto_keyfile.bin" = null; + }; + luks = { + # devices."luks-DISK_UUID" = { + # device = "/dev/disk/by-uuid/DISK_UUID"; + # keyfile = "/crypto_keyfile.bin"; + # }; + }; + }; + }; + + services.fstrim.enable = true; + + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + + hardware = { + + cpu.intel.updateMicrocode = true; + enableAllFirmware = false; + bluetooth.enable = true; + + opengl = { + enable = true; + extraPackages = with pkgs; [ + intel-compute-runtime + intel-media-driver + vaapiIntel + vaapiVdpau + libvdpau-va-gl + ]; + }; + + }; + + nix = { + # settings = { + # }; + gc = { + automatic = true; + dates = "daily"; + options = "--delete-older-than 2d"; + persistent = true; + }; + }; + +} diff --git a/hosts/hades/disko-config.nix b/hosts/hades/disko-config.nix new file mode 100644 index 0000000..06b376d --- /dev/null +++ b/hosts/hades/disko-config.nix @@ -0,0 +1,66 @@ +{ + + disko.devices = { + disk = { + sda = { + type = "disk"; + device = "/dev/sda"; + content = { + type = "gpt"; + partitions = { + ESP = { + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ + "defaults" + ]; + }; + }; + + luks = { + size = "100%"; + content = { + type = "luks"; + name = "pomegranate"; + # disable settings.keyFile if you want to use interactive password entry + #passwordFile = "/tmp/secret.key"; # Interactive + settings = { + allowDiscards = true; + #keyFile = "/tmp/secret.key"; + }; + # additionalKeyFiles = [ "/tmp/additionalSecret.key" ]; + + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; + subvolumes = { + "/root" = { + mountpoint = "/"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; + "/home" = { + mountpoint = "/home"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; + "/nix" = { + mountpoint = "/nix"; + mountOptions = [ "compress=zstd" "noatime" ]; + }; + }; + }; + + }; + }; + + }; + }; + }; + }; + + }; + +} diff --git a/hosts/hades/hardware-configuration.nix b/hosts/hades/hardware-configuration.nix new file mode 100644 index 0000000..1e02223 --- /dev/null +++ b/hosts/hades/hardware-configuration.nix @@ -0,0 +1,29 @@ +# 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") + # ./disko-config.sh + ./disko-config.nix + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + # 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..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp58s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/hades/network-configuration.nix b/hosts/hades/network-configuration.nix new file mode 100644 index 0000000..eb93781 --- /dev/null +++ b/hosts/hades/network-configuration.nix @@ -0,0 +1,72 @@ +{ pkgs, lib, config, ... }: + +{ + + imports = [ + # ./file.nix + ]; + + networking = { + hostName = "proserpina"; + wireless.enable = false; + networkmanager = { + enable = true; + }; + # nameservers = [ + # "1.1.1.1" + # ]; + }; + + # networking.proxy = { + # default = "https://user:password@proxy:port/"; + # noProxy = "127.0.0.1, localhost, internal.comain"; + # }; + + networking.firewall = { + enable = false; + # checkReversePath = "loose"; + # allowedTCPPorts = [ 22000 21027 25565 ]; + # allowedUDPPorts = [ 22000 21027 41641 51820 ]; + # allowedTCPPortRanges = [ + # { from = 9999; to = 9999; } # KDE COnnect + # { from = 9999; to = 9999; } # Nicotine+ + # ]; + # allowedUDPPortRanges = [ + # { from = 9999; to = 9999; } # KDE COnnect + # ]; + # interfaces."DEVICENAME".allowedTCPPorts = [ 22999 ] + }; + + services.syncthing = { + enable = false; + dataDir = "/home/serenity/"; + configDir = "/home/serenity/.config/syncthing"; + user = "serenity"; + settings.devices = { + + # hades.id = "DEVICE_ID"; + # proserpina.id = "DEVICE_ID"; + # hecate.id = "DEVICE_ID"; + + }; + settings.folders = { + + # "FOLDER_ID" = { + # path = "/home/serenity/Documents/Notes"; + # devices = [ "hecate" "hades" "proserpina" ]; + # }; + + # "FOLDER_ID" = { + # path = "/home/serenity/Documents/Notes"; + # devices = [ "hecate" "hades" "proserpina" ]; + # }; + + # "FOLDER_ID" = { + # path = "/home/serenity/Documents/Notes"; + # devices = [ "hecate" "hades" "proserpina" ]; + # }; + + }; + }; + +}