diff --git a/hosts/default.nix b/hosts/default.nix index 677405f..feb79b4 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -166,7 +166,7 @@ ]; }; hs = {}; - devbox = { + mothership = { extraModules = [inputs.disko.nixosModules.disko]; extraHmModules = [ inputs.ccrEmacs.hmModules.default @@ -181,7 +181,9 @@ } ]; secrets = { + "cachix" = {}; "git-workspace-tokens".owner = "ccr"; + "magit-forge-github-token".owner = "ccr"; }; }; }; diff --git a/hosts/mothership/default.nix b/hosts/mothership/default.nix new file mode 100644 index 0000000..d21ce8d --- /dev/null +++ b/hosts/mothership/default.nix @@ -0,0 +1,75 @@ +{ + modulesPath, + fleetModules, + lib, + pkgs, + config, + ... +}: { + imports = fleetModules [ + "common" + "ssh" + "ccr" + "nix" + ]; + + ccr = { + enable = true; + autologin = true; + modules = [ + "emacs" + "git" + "gpg" + "helix" + "shell" + "xdg" + "git-workspace" + ]; + packages = with pkgs; [ + comma + ]; + extraGroups = [ + "wheel" + "fuse" + "video" + "networkmanager" + ]; + }; + + disko.devices = import ./disko.nix { + inherit lib; + }; + + fonts = { + fonts = with pkgs; [powerline-fonts dejavu_fonts fira-code fira-code-symbols emacs-all-the-icons-fonts nerdfonts joypixels etBook]; + fontconfig.defaultFonts = { + monospace = ["DejaVu Sans Mono for Powerline"]; + sansSerif = ["DejaVu Sans"]; + serif = ["DejaVu Serif"]; + }; + }; + + nixpkgs.config.joypixels.acceptLicense = true; + + environment.systemPackages = with pkgs; [waypipe firefox]; + + programs.mosh.enable = true; + + boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; + + boot.loader.efi.canTouchEfiVariables = true; + boot.loader.systemd-boot = { + enable = true; + configurationLimit = 20; + }; + networking.hostId = "03259b66"; + + networking.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + powerManagement.cpuFreqGovernor = lib.mkDefault "performance"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/mothership/disko.nix b/hosts/mothership/disko.nix new file mode 100644 index 0000000..69b763a --- /dev/null +++ b/hosts/mothership/disko.nix @@ -0,0 +1,78 @@ +{ + lib, + disks ? ["/dev/nvme0n1" "/dev/nvme1n1"], + ... +}: { + disk = { + x = { + type = "disk"; + device = builtins.elemAt disks 0; + content = { + type = "table"; + format = "gpt"; + partitions = [ + { + type = "partition"; + name = "ESP"; + start = "0"; + end = "960MiB"; + fs-type = "fat32"; + bootable = true; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + } + { + type = "partition"; + name = "zfs"; + start = "1GiB"; + end = "100%"; + content = { + type = "zfs"; + pool = "zroot"; + }; + } + ]; + }; + }; + y = { + type = "disk"; + device = builtins.elemAt disks 1; + content = { + type = "table"; + format = "gpt"; + partitions = [ + { + type = "partition"; + name = "zfs"; + start = "1GiB"; + end = "100%"; + content = { + type = "zfs"; + pool = "zroot"; + }; + } + ]; + }; + }; + }; + zpool = { + zroot = { + type = "zpool"; + mode = "mirror"; + rootFsOptions = { + compression = "lz4"; + "com.sun:auto-snapshot" = "false"; + }; + datasets = { + root = { + zfs_type = "filesystem"; + options.mountpoint = "legacy"; + mountpoint = "/"; + }; + }; + }; + }; +}