From c2a0dfab6410ab9f2b39228c6c0db093734ccb71 Mon Sep 17 00:00:00 2001 From: Don Harper Date: Thu, 4 Jan 2024 22:15:10 -0600 Subject: [PATCH] add disko and update config for fred --- flake.nix | 3 ++ hosts/fred/default.nix | 1 + hosts/fred/disko.nix | 40 +++++++++++++++++++++++++++ hosts/fred/hardware-configuration.nix | 12 ++++---- 4 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 hosts/fred/disko.nix diff --git a/flake.nix b/flake.nix index 1b075da..8fc0b47 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,6 @@ { inputs = { + disko.url = "github:nix-community/disko"; nixos-hardware.url = "github:NixOS/nixos-hardware/master"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; home-manager = { @@ -25,6 +26,7 @@ workstation = { system = "x86_64-linux"; modules = [ + inputs.disko.nixosModules.disko ./workstation inputs.home-manager.nixosModules.home-manager ./home @@ -34,6 +36,7 @@ server = { system = "x86_64-linux"; modules = [ + inputs.disko.nixosModules.disko ./server inputs.home-manager.nixosModules.home-manager ./home diff --git a/hosts/fred/default.nix b/hosts/fred/default.nix index cb8ba8b..ba04011 100644 --- a/hosts/fred/default.nix +++ b/hosts/fred/default.nix @@ -4,5 +4,6 @@ imports = [ ./hardware-configuration.nix + ./disko.nix ]; } diff --git a/hosts/fred/disko.nix b/hosts/fred/disko.nix new file mode 100644 index 0000000..98348ee --- /dev/null +++ b/hosts/fred/disko.nix @@ -0,0 +1,40 @@ +{ + disko.devices = { + disk = { + vdb = { + device = "/dev/sda"; + type = "disk"; + content = { + type = "table"; + format = "gpt"; + partitions = [ + { + name = "ESP"; + start = "1M"; + end = "500M"; + bootable = true; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + } + { + name = "root"; + start = "500M"; + end = "100%"; + part-type = "primary"; + bootable = true; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + } + ]; + }; + }; + }; + }; +} + diff --git a/hosts/fred/hardware-configuration.nix b/hosts/fred/hardware-configuration.nix index 7782faf..779f8af 100644 --- a/hosts/fred/hardware-configuration.nix +++ b/hosts/fred/hardware-configuration.nix @@ -14,18 +14,18 @@ boot.extraModulePackages = [ ]; fileSystems."/" = - { device = "/dev/disk/by-uuid/90189466-8309-4b46-befe-cf476b8a7dd7"; + { device = "/dev/sda2"; fsType = "ext4"; }; fileSystems."/boot" = - { device = "/dev/disk/by-uuid/A327-E803"; + { device = "/dev/sda1"; fsType = "vfat"; }; - swapDevices = - [ { device = "/dev/disk/by-uuid/13b6e2c4-b8f1-48c9-b992-bf2d172d9a25"; } - ]; + #swapDevices = + #[ { device = "/dev/disk/by-uuid/13b6e2c4-b8f1-48c9-b992-bf2d172d9a25"; } + #]; # 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 @@ -36,6 +36,6 @@ # networking.interfaces.wlp1s0.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + #powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; }