aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--flake.lock21
-rw-r--r--flake.nix5
-rw-r--r--hosts/underworld/default.nix14
-rw-r--r--hosts/underworld/disko.nix45
-rw-r--r--hosts/underworld/hardware.nix25
-rw-r--r--hosts/underworld/home.nix7
6 files changed, 90 insertions, 27 deletions
diff --git a/flake.lock b/flake.lock
index c804895..51935e1 100644
--- a/flake.lock
+++ b/flake.lock
@@ -21,6 +21,26 @@
"type": "github"
}
},
+ "disko": {
+ "inputs": {
+ "nixpkgs": [
+ "nixpkgs"
+ ]
+ },
+ "locked": {
+ "lastModified": 1700927249,
+ "narHash": "sha256-iqmIWiEng890/ru7ZBf4nUezFPyRm2fjRTvuwwxqk2o=",
+ "owner": "nix-community",
+ "repo": "disko",
+ "rev": "3cb78c93e6a02f494aaf6aeb37481c27a2e2ee22",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-community",
+ "repo": "disko",
+ "type": "github"
+ }
+ },
"flake-compat": {
"flake": false,
"locked": {
@@ -367,6 +387,7 @@
"root": {
"inputs": {
"devshell": "devshell",
+ "disko": "disko",
"flake-parts": "flake-parts",
"home-manager": "home-manager",
"hyprland": "hyprland",
diff --git a/flake.nix b/flake.nix
index f73cd4d..3cbdf5d 100644
--- a/flake.nix
+++ b/flake.nix
@@ -3,6 +3,10 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
+ disko = {
+ url = "github:nix-community/disko";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
@@ -56,6 +60,7 @@
modules = [
inputs.home-manager.nixosModules.home-manager
inputs.sops-nix.nixosModules.sops
+ inputs.disko.nixosModules.disko
./share/nixos-modules/nix-config.nix
# This directory has to exist and have a `default.nix` in it, see
diff --git a/hosts/underworld/default.nix b/hosts/underworld/default.nix
index bcdc5a6..d900560 100644
--- a/hosts/underworld/default.nix
+++ b/hosts/underworld/default.nix
@@ -2,6 +2,8 @@
imports = [
# Include the results of the hardware scan.
./hardware.nix
+ ./disko.nix
+
./home.nix
(flakeRoot + /share/system/steam.nix)
(flakeRoot + /share/system/hyprland.nix)
@@ -17,10 +19,14 @@
randomizedDelaySec = "15min";
};
- # Use the systemd-boot EFI boot loader.
+ # Using grub because the disko docs tell me to use it
boot = {
- loader.systemd-boot.enable = true;
- loader.efi.canTouchEfiVariables = true;
+ supportedFilesystems = [ "bacachefs" ];
+ loader.grub = {
+ enable = true;
+ efiSupport = true;
+ efiInstallAsRemovable = true;
+ };
};
networking = {
@@ -85,5 +91,5 @@
# 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?
+ system.stateVersion = "23.11"; # Did you read the comment?
}
diff --git a/hosts/underworld/disko.nix b/hosts/underworld/disko.nix
new file mode 100644
index 0000000..e713323
--- /dev/null
+++ b/hosts/underworld/disko.nix
@@ -0,0 +1,45 @@
+{
+ disko.devices = {
+ disk = {
+ main = {
+ type = "disk";
+ device = "/dev/disk/by-id/ata-WDC_WDS240G2G0B-00EPW0_194176803299";
+ content = {
+ type = "gpt";
+ partitions = {
+ boot = {
+ size = "1M";
+ type = "EF02"; # for grub MBR
+ };
+ ESP = {
+ size = "512M";
+ type = "EF00";
+ content = {
+ type = "filesystem";
+ format = "vfat";
+ mountpoint = "/boot";
+ };
+ };
+ root = {
+ name = "root";
+ end = "-20G";
+ content = {
+ type = "filesystem";
+ format = "bcachefs";
+ mountpoint = "/";
+ };
+ };
+ encryptedSwap = {
+ size = "100%";
+ content = {
+ type = "swap";
+ randomEncryption = true;
+ resumeDevice = true; # resume from hibernation from this device
+ };
+ };
+ };
+ };
+ };
+ };
+ };
+}
diff --git a/hosts/underworld/hardware.nix b/hosts/underworld/hardware.nix
index a99d2a3..305d6ce 100644
--- a/hosts/underworld/hardware.nix
+++ b/hosts/underworld/hardware.nix
@@ -1,39 +1,26 @@
# 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 =
- [ (modulesPath + "/installer/scan/not-detected.nix")
+ [
+ (modulesPath + "/installer/scan/not-detected.nix")
];
- boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "sd_mod" ];
+ boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
- fileSystems."/" =
- { device = "/dev/disk/by-uuid/fc1a2a05-efb0-45e7-83f2-2b9dae515b0a";
- fsType = "ext4";
- };
-
- fileSystems."/boot" =
- { device = "/dev/disk/by-uuid/FEB7-A352";
- fsType = "vfat";
- };
-
- swapDevices =
- [ { device = "/dev/disk/by-uuid/f16d9af0-4043-4d39-a8d6-e788451f8e9e"; }
- ];
-
# 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.enp1s0.useDHCP = lib.mkDefault true;
- # networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true;
+ # networking.interfaces.enp9s0.useDHCP = lib.mkDefault true;
+ nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
diff --git a/hosts/underworld/home.nix b/hosts/underworld/home.nix
index c7cdb1b..42061ef 100644
--- a/hosts/underworld/home.nix
+++ b/hosts/underworld/home.nix
@@ -1,5 +1,4 @@
-{ pkgs
-, flakeRoot
+{ flakeRoot
, inputs
, ...
}: {
@@ -15,10 +14,10 @@
(flakeRoot + /share/home/gallery-dl.nix)
];
- home.stateVersion = "23.05";
+ home.stateVersion = "23.11";
};
home-manager.users.root = {
- home.stateVersion = "23.05";
+ home.stateVersion = "23.11";
};
}