diff options
author | ene <ene@sils.li> | 2023-02-01 21:33:11 +0100 |
---|---|---|
committer | ene <ene@sils.li> | 2023-02-03 17:34:11 +0100 |
commit | 871d3f95963eac25765427ecca9a8e4812071439 (patch) | |
tree | 5dcf241ece31050cf0c74219852242abe504e068 | |
parent | Build(flake): Added Flake.lock (diff) | |
download | nixos-config-871d3f95963eac25765427ecca9a8e4812071439.tar.gz nixos-config-871d3f95963eac25765427ecca9a8e4812071439.zip |
Feat: Split the config apart
Diffstat (limited to '')
-rw-r--r-- | hosts/IDOHVE/configuration.nix | 9 | ||||
-rw-r--r-- | hosts/IDOHVE/hardware.nix | 85 | ||||
-rw-r--r-- | hosts/IDOHVE/hardware/boot.nix | 32 | ||||
-rw-r--r-- | hosts/IDOHVE/hardware/cpu.nix | 4 | ||||
-rw-r--r-- | hosts/IDOHVE/hardware/filesystems.nix | 41 | ||||
-rw-r--r-- | hosts/IDOHVE/hardware/gpu.nix (renamed from hosts/IDOHVE/gpu.nix) | 1 | ||||
-rw-r--r-- | hosts/IDOHVE/hardware/hardware.nix | 19 | ||||
-rw-r--r-- | services/nix/nix.nix (renamed from services/nix.nix) | 0 | ||||
-rw-r--r-- | services/printing/printing.nix | 4 | ||||
-rw-r--r-- | services/services.nix | 7 | ||||
-rw-r--r-- | services/zsh/custom_cursor.sh (renamed from services/custom_cursor.sh) | 0 | ||||
-rw-r--r-- | services/zsh/zsh-init.sh (renamed from services/zsh-init.sh) | 0 | ||||
-rw-r--r-- | services/zsh/zsh-prompt.sh (renamed from services/zsh-prompt.sh) | 0 | ||||
-rw-r--r-- | services/zsh/zsh.nix (renamed from services/zsh.nix) | 2 | ||||
-rw-r--r-- | system/locale/locale.nix | 26 | ||||
-rw-r--r-- | system/packages/packages.conf (renamed from system/packages.conf) | 6 | ||||
-rw-r--r-- | system/packages/packages.nix (renamed from system/packages.nix) | 0 | ||||
-rw-r--r-- | system/sound/sound.nix | 18 | ||||
-rw-r--r-- | system/system.nix | 8 | ||||
-rw-r--r-- | system/users/users.nix (renamed from system/users.nix) | 0 |
20 files changed, 166 insertions, 96 deletions
diff --git a/hosts/IDOHVE/configuration.nix b/hosts/IDOHVE/configuration.nix index a3cf2b2c..e9ddc69d 100644 --- a/hosts/IDOHVE/configuration.nix +++ b/hosts/IDOHVE/configuration.nix @@ -7,15 +7,12 @@ ... }: { imports = [ - ./hardware.nix - ./gpu.nix + ./hardware/hardware.nix ./networking.nix - ../../system/packages.nix - ../../system/users.nix + ../../system/system.nix - ../../services/nix.nix - ../../services/zsh.nix + ../../services/services.nix ]; diff --git a/hosts/IDOHVE/hardware.nix b/hosts/IDOHVE/hardware.nix deleted file mode 100644 index be55c07c..00000000 --- a/hosts/IDOHVE/hardware.nix +++ /dev/null @@ -1,85 +0,0 @@ -{ - config, - lib, - pkgs, - modulesPath, - ... -}: let - main_disk = "/dev/disk/by-uuid/<uuid>"; -in { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") # TODO is this necessary? - ]; - - boot = { - initrd = { - compressor = "lz4"; - compressorArgs = ["-9"]; - - # TODO check this: - availableKernelModules = ["xhci_pci" "nvme" "rtsx_pci_sdmmc"]; - }; - - kernelModules = ["kvm-amd"]; - kernelPackages = pkgs.linuxPackages_latest; - loader = { - grub = { - enable = true; - version = 2; - theme = pkgs.nixos-grub2-theme; - splashImage = ./grub_boot_image.png; - efiSupport = true; - device = "nodev"; # TODO add this - }; - efi = { - canTouchEfiVariables = true; - efiSysMountPoint = "/boot"; - }; - }; - }; - - fileSystems = { - "/" = { - device = "none"; - fsType = "tmpfs"; - options = ["defaults" "size=2G" "mode=755"]; - }; - "/nix" = { - device = main_disk; - fsType = "btrfs"; - options = ["subvol=@nix" "compress-force=zstd:9"]; - }; - "/boot" = { - device = "/dev/disk/by-uuid/<uuid>"; - fsType = "vfat"; - }; - - "/srv/home" = { - device = main_disk; - fsType = "btrfs"; - options = ["subvol=@home" "compress-force=zstd:9"]; - }; - "/srv/nixos-config" = { - device = main_disk; - fsType = "btrfs"; - options = ["subvol=@nixos-config" "compress-force=zstd:9"]; - }; - - "/etc/nixos" = { - device = "/srv/nix-config"; - options = ["bind"]; - }; - "/home" = { - device = "/srv/home"; - options = ["bind"]; - }; - }; - - swapDevices = []; - - - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; -} - diff --git a/hosts/IDOHVE/hardware/boot.nix b/hosts/IDOHVE/hardware/boot.nix new file mode 100644 index 00000000..932155a4 --- /dev/null +++ b/hosts/IDOHVE/hardware/boot.nix @@ -0,0 +1,32 @@ +{ + config, + pkgs, + ... +}: { + boot = { + initrd = { + compressor = "lz4"; + compressorArgs = ["-9"]; + + # TODO check this: + availableKernelModules = ["xhci_pci" "nvme" "rtsx_pci_sdmmc"]; + }; + + kernelModules = ["kvm-amd"]; + kernelPackages = pkgs.linuxPackages_latest; + loader = { + grub = { + enable = true; + version = 2; + theme = pkgs.nixos-grub2-theme; + splashImage = ./grub_boot_image.png; + efiSupport = true; + device = "nodev"; # only for efi + }; + efi = { + canTouchEfiVariables = true; + efiSysMountPoint = "/boot"; + }; + }; + }; +} diff --git a/hosts/IDOHVE/hardware/cpu.nix b/hosts/IDOHVE/hardware/cpu.nix new file mode 100644 index 00000000..5d61d02f --- /dev/null +++ b/hosts/IDOHVE/hardware/cpu.nix @@ -0,0 +1,4 @@ +{config, ...}: { + powerManagement.cpuFreqGovernor = "powersave"; + hardware.cpu.amd.updateMicrocode = true; # Why not? +} diff --git a/hosts/IDOHVE/hardware/filesystems.nix b/hosts/IDOHVE/hardware/filesystems.nix new file mode 100644 index 00000000..a188df18 --- /dev/null +++ b/hosts/IDOHVE/hardware/filesystems.nix @@ -0,0 +1,41 @@ +{config, ...}: let + main_disk = "/dev/disk/by-uuid/<uuid>"; +in { + fileSystems = { + "/" = { + device = "none"; + fsType = "tmpfs"; + options = ["defaults" "size=2G" "mode=755"]; + }; + "/nix" = { + device = main_disk; + fsType = "btrfs"; + options = ["subvol=@nix" "compress-force=zstd:9"]; + }; + "/boot" = { + device = "/dev/disk/by-uuid/<uuid>"; + fsType = "vfat"; + }; + + "/srv/home" = { + device = main_disk; + fsType = "btrfs"; + options = ["subvol=@home" "compress-force=zstd:9"]; + }; + "/srv/nixos-config" = { + device = main_disk; + fsType = "btrfs"; + options = ["subvol=@nixos-config" "compress-force=zstd:9"]; + }; + + "/etc/nixos" = { + device = "/srv/nix-config"; + options = ["bind"]; + }; + "/home" = { + device = "/srv/home"; + options = ["bind"]; + }; + }; + swapDevices = []; +} diff --git a/hosts/IDOHVE/gpu.nix b/hosts/IDOHVE/hardware/gpu.nix index 6796d04b..49197c2b 100644 --- a/hosts/IDOHVE/gpu.nix +++ b/hosts/IDOHVE/hardware/gpu.nix @@ -4,7 +4,6 @@ lib, ... }: { - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; # TODO hardware.opengl.extraPackages = with pkgs; [ rocm-opencl-icd # open-cl diff --git a/hosts/IDOHVE/hardware/hardware.nix b/hosts/IDOHVE/hardware/hardware.nix new file mode 100644 index 00000000..20e4c4f3 --- /dev/null +++ b/hosts/IDOHVE/hardware/hardware.nix @@ -0,0 +1,19 @@ +{ + config, + lib, + pkgs, + modulesPath, + ... +}:{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") # TODO is this necessary? + ./cpu.nix + ./gpu.nix + ./boot.nix + ./filesystems.nix + ]; + + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} + diff --git a/services/nix.nix b/services/nix/nix.nix index b94cfc95..b94cfc95 100644 --- a/services/nix.nix +++ b/services/nix/nix.nix diff --git a/services/printing/printing.nix b/services/printing/printing.nix new file mode 100644 index 00000000..d178e3b6 --- /dev/null +++ b/services/printing/printing.nix @@ -0,0 +1,4 @@ +{config, ...}: { + # Enable CUPS to print documents. + services.printing.enable = true; +} diff --git a/services/services.nix b/services/services.nix new file mode 100644 index 00000000..27e5086f --- /dev/null +++ b/services/services.nix @@ -0,0 +1,7 @@ +{config, ...}: { + imports = [ + ./zsh/zsh.nix + ./printing/printing.nix + ./nix/nix.nix + ]; +} diff --git a/services/custom_cursor.sh b/services/zsh/custom_cursor.sh index 9a6da012..9a6da012 100644 --- a/services/custom_cursor.sh +++ b/services/zsh/custom_cursor.sh diff --git a/services/zsh-init.sh b/services/zsh/zsh-init.sh index bc9af87a..bc9af87a 100644 --- a/services/zsh-init.sh +++ b/services/zsh/zsh-init.sh diff --git a/services/zsh-prompt.sh b/services/zsh/zsh-prompt.sh index 1f0f164b..1f0f164b 100644 --- a/services/zsh-prompt.sh +++ b/services/zsh/zsh-prompt.sh diff --git a/services/zsh.nix b/services/zsh/zsh.nix index b194ab6b..78387f91 100644 --- a/services/zsh.nix +++ b/services/zsh/zsh.nix @@ -53,7 +53,7 @@ in { interactiveShellInit = builtins.readFile ./zsh-init.sh; histSize = 9999999; histFile = "$XDG_DATA_HOME/zsh/history"; - autosuggentions = { + autosuggestions = { enable = true; }; }; diff --git a/system/locale/locale.nix b/system/locale/locale.nix new file mode 100644 index 00000000..2fcc2115 --- /dev/null +++ b/system/locale/locale.nix @@ -0,0 +1,26 @@ +{ + config, + pkgs, + ... +}: { + # Set your time zone. + time.timeZone = "Europe/Berlin"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + 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"; + }; + + # Configure console keymap + console.keyMap = "dvorak"; +} diff --git a/system/packages.conf b/system/packages/packages.conf index 25f6ace8..4d409077 100644 --- a/system/packages.conf +++ b/system/packages/packages.conf @@ -107,9 +107,9 @@ # Listen moc # An ncurses console audio player designed to be powerful and easy to use pavucontrol # PulseAudio Volume Control - pipewire-alsa # Low-latency audio/video router and processor - ALSA configuration - pipewire-jack # Low-latency audio/video router and processor - JACK support - pipewire-pulse # Low-latency audio/video router and processor - PulseAudio replacement +#pipewire-alsa # Low-latency audio/video router and processor - ALSA configuration +#pipewire-jack # Low-latency audio/video router and processor - JACK support +#pipewire-pulse # Low-latency audio/video router and processor - PulseAudio replacement # Hardware # Boot diff --git a/system/packages.nix b/system/packages/packages.nix index 1acba85e..1acba85e 100644 --- a/system/packages.nix +++ b/system/packages/packages.nix diff --git a/system/sound/sound.nix b/system/sound/sound.nix new file mode 100644 index 00000000..16dd4279 --- /dev/null +++ b/system/sound/sound.nix @@ -0,0 +1,18 @@ +{config, ...}: { + # Enable sound with pipewire. + sound.enable = true; + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + # If you want to use JACK applications, uncomment this + jack.enable = true; + + # use the example session manager (no others are packaged yet so this is enabled by default, + # no need to redefine it in your config for now) + #media-session.enable = true; + }; +} diff --git a/system/system.nix b/system/system.nix new file mode 100644 index 00000000..3a034742 --- /dev/null +++ b/system/system.nix @@ -0,0 +1,8 @@ +{config, ...}: { + imports = [ + ./locale/locale.nix + ./users/users.nix + ./sound/sound.nix + ./packages/packages.nix + ]; +} diff --git a/system/users.nix b/system/users/users.nix index ca2fc352..ca2fc352 100644 --- a/system/users.nix +++ b/system/users/users.nix |