From 48dcf2c25d34034598841e378c1e35fbb137c2b7 Mon Sep 17 00:00:00 2001 From: Don Harper Date: Fri, 27 Sep 2024 07:23:42 -0500 Subject: [PATCH] task | add t2 and pi1 --- flake.nix | 2 ++ hosts/loki/default.nix | 1 + hosts/pi1/default.nix | 21 +++++++++++++++ hosts/pi1/disko.nix | 39 ++++++++++++++++++++++++++++ hosts/pi1/hardware-configuration.nix | 33 +++++++++++++++++++++++ hosts/t2/default.nix | 3 +++ hosts/t2/hardware-configuration.nix | 1 + hosts/workstation/default.nix | 26 +------------------ 8 files changed, 101 insertions(+), 25 deletions(-) create mode 100644 hosts/pi1/default.nix create mode 100644 hosts/pi1/disko.nix create mode 100644 hosts/pi1/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index deffb09..020f830 100644 --- a/flake.nix +++ b/flake.nix @@ -55,6 +55,8 @@ fred = import ./hosts/fred; loki = import ./hosts/loki; smaug = import ./hosts/smaug; + t2 = import ./hosts/t2; + pi1 = import ./hosts/pi1; }; nixosConfigurations = { diff --git a/hosts/loki/default.nix b/hosts/loki/default.nix index 20ce460..29eb1c1 100644 --- a/hosts/loki/default.nix +++ b/hosts/loki/default.nix @@ -20,6 +20,7 @@ ../../home/work ]; networking.hostName = "loki"; + boot.binfmt.emulatedSystems = ["aarch64-linux"]; deployment = { tags = ["workstation"]; }; diff --git a/hosts/pi1/default.nix b/hosts/pi1/default.nix new file mode 100644 index 0000000..5e34e0b --- /dev/null +++ b/hosts/pi1/default.nix @@ -0,0 +1,21 @@ +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: { + imports = [ + inputs.stylix.nixosModules.stylix + inputs.catppuccin.nixosModules.catppuccin + ./hardware-configuration.nix + ../server + ../themes.nix + ]; + networking.hostName = "pi1"; + deployment = { + targetHost = "nixos"; + tags = ["arm"]; + }; +} diff --git a/hosts/pi1/disko.nix b/hosts/pi1/disko.nix new file mode 100644 index 0000000..c15997b --- /dev/null +++ b/hosts/pi1/disko.nix @@ -0,0 +1,39 @@ +{ + disko.devices = { + disk = { + vdb = { + device = "/dev/mmcblk0"; + 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/pi1/hardware-configuration.nix b/hosts/pi1/hardware-configuration.nix new file mode 100644 index 0000000..1a400f0 --- /dev/null +++ b/hosts/pi1/hardware-configuration.nix @@ -0,0 +1,33 @@ +# 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 = [ ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888"; + fsType = "ext4"; + }; + + swapDevices = [ ]; + + # 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.enu1u1.useDHCP = lib.mkDefault true; + # networking.interfaces.wlan0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; + powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; +} diff --git a/hosts/t2/default.nix b/hosts/t2/default.nix index be6a2be..59ca564 100644 --- a/hosts/t2/default.nix +++ b/hosts/t2/default.nix @@ -15,4 +15,7 @@ ../wm ]; networking.hostName = "t2"; + deployment = { + tags = ["arm"]; + }; } diff --git a/hosts/t2/hardware-configuration.nix b/hosts/t2/hardware-configuration.nix index 89bc487..1f9335b 100644 --- a/hosts/t2/hardware-configuration.nix +++ b/hosts/t2/hardware-configuration.nix @@ -33,4 +33,5 @@ # networking.interfaces.wlu1.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; + nixpkgs.config.allowUnsupportedSystem = true; } diff --git a/hosts/workstation/default.nix b/hosts/workstation/default.nix index 10b1a1d..d6840e4 100644 --- a/hosts/workstation/default.nix +++ b/hosts/workstation/default.nix @@ -125,31 +125,6 @@ in { ACTION=="add|change", KERNEL=="sd[a-z]*[0-9]*|mmcblk[0-9]*p[0-9]*|nvme[0-9]*n[0-9]*p[0-9]*", ENV{ID_FS_TYPE}=="ext4", ATTR{../queue/scheduler}="none" ''; }; - # kmscon = { - # enable = true; - # fonts = [ - # { - # name = "Source Code Pro"; - # package = pkgs.source-code-pro; - # } - # ]; - # extraConfig = '' - # font-size=10 - # palette=custom - # palette-black=33, 34, 44 - # palette-cyan=128, 255, 234 - # palette-dark-grey=182, 185, 201 - # palette-green=138, 255, 128 - # palette-dark-grey=65, 69, 88 - # palette-light-grey=98, 103, 132 - # palette-light-green=208, 255, 204 - # palette-light-red=255, 212, 204 - # palette-light-yellow=255, 255, 204 - # palette-red=255, 149, 128 - # palette-white=248, 248, 242 - # palette-yellow=255, 255, 128 - # ''; - # }; pcscd = { enable = true; }; @@ -279,6 +254,7 @@ in { brightnessctl btop colmena + delta espeak-classic fwup fwupd