diff options
author | Mark Nipper <nipsy@bitgnome.net> | 2024-11-11 19:05:02 -0800 |
---|---|---|
committer | Mark Nipper <nipsy@bitgnome.net> | 2024-11-11 19:05:02 -0800 |
commit | cb3885e72abaa985e0e1fd95f6e57382c7c343e7 (patch) | |
tree | 04fe914816b35de2a2e6a9d7eef2b1e296490492 | |
parent | 2f0664317ee6b6dd9bd05844582346b0b6fec1b8 (diff) | |
download | nix-cb3885e72abaa985e0e1fd95f6e57382c7c343e7.tar nix-cb3885e72abaa985e0e1fd95f6e57382c7c343e7.tar.gz nix-cb3885e72abaa985e0e1fd95f6e57382c7c343e7.tar.bz2 nix-cb3885e72abaa985e0e1fd95f6e57382c7c343e7.tar.lz nix-cb3885e72abaa985e0e1fd95f6e57382c7c343e7.tar.xz nix-cb3885e72abaa985e0e1fd95f6e57382c7c343e7.tar.zst nix-cb3885e72abaa985e0e1fd95f6e57382c7c343e7.zip |
Add @uranus
Diffstat (limited to '')
-rw-r--r-- | flake.nix | 14 | ||||
-rw-r--r-- | home/nipsy/uranus.nix | 6 | ||||
-rw-r--r-- | home/root/uranus.nix | 6 | ||||
-rw-r--r-- | hosts/uranus/default.nix | 66 | ||||
-rw-r--r-- | hosts/uranus/disks.nix | 96 | ||||
-rw-r--r-- | hosts/uranus/hardware-configuration.nix | 47 |
6 files changed, 235 insertions, 0 deletions
@@ -156,6 +156,20 @@ } ]; }; + + uranus = nixpkgs.lib.nixosSystem rec { + specialArgs = { inherit inputs outputs; }; + modules = [ + ./hosts/uranus + home-manager.nixosModules.home-manager { + #home-manager.sharedModules = [ sops-nix.homeManagerModules.sops ]; + home-manager.users.root = import ./home/root/uranus.nix; + home-manager.users.nipsy = import ./home/nipsy/uranus.nix; + } + #sops-nix.nixosModules.sops + ]; + }; + }; overlays = import ./overlays {inherit inputs;}; diff --git a/home/nipsy/uranus.nix b/home/nipsy/uranus.nix new file mode 100644 index 0000000..83c92cd --- /dev/null +++ b/home/nipsy/uranus.nix @@ -0,0 +1,6 @@ +{ inputs, lib, pkgs, config, outputs, ... }: +{ + imports = [ + common/core + ]; +} diff --git a/home/root/uranus.nix b/home/root/uranus.nix new file mode 100644 index 0000000..83c92cd --- /dev/null +++ b/home/root/uranus.nix @@ -0,0 +1,6 @@ +{ inputs, lib, pkgs, config, outputs, ... }: +{ + imports = [ + common/core + ]; +} diff --git a/hosts/uranus/default.nix b/hosts/uranus/default.nix new file mode 100644 index 0000000..2128dc2 --- /dev/null +++ b/hosts/uranus/default.nix @@ -0,0 +1,66 @@ +{ config, inputs, outputs, pkgs, ... }: { + boot = { + initrd.kernelModules = [ "amdgpu" "zfs" ]; + #kernel.sysctl = { + # "net.ipv4.ip_forward" = true; + #}; + loader = { + efi.canTouchEfiVariables = true; + systemd-boot.enable = true; + timeout = 3; + }; + supportedFilesystems = [ "zfs" ]; + zfs.devNodes = "/dev/disk/by-label"; + }; + + environment.systemPackages = with pkgs; [ + wpa_supplicant + ]; + + imports = [ + ./hardware-configuration.nix + ../common/core + ../common/optional/misc.nix + ../common/optional/services/fwupd.nix + ../common/optional/services/openssh.nix + ../common/optional/zfs.nix + ../common/users/nipsy + ../common/users/root + ]; + + networking = { + hostId = "46fdaa8e"; + hostName = "uranus"; + domain = "bitgnome.net"; + nftables.enable = true; + wireless = { + enable = true; + userControlled.enable = true; + }; + }; + + nixpkgs = { + config.allowUnfree = true; + hostPlatform = "x86_64-linux"; + overlays = [ + outputs.overlays.additions + outputs.overlays.modifications + outputs.overlays.master-packages + outputs.overlays.stable-packages + ]; + }; + + #sops = { + # age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; + # defaultSopsFile = ../secrets/uranus.yaml; + + # secrets = { + # "kea-dhcp4_conf" = {}; + # "nftables/forward" = {}; + # "nftables/ssh" = {}; + # "nix-access-token-github" = {}; + # }; + #}; + + system.stateVersion = "24.11"; +} diff --git a/hosts/uranus/disks.nix b/hosts/uranus/disks.nix new file mode 100644 index 0000000..52e8926 --- /dev/null +++ b/hosts/uranus/disks.nix @@ -0,0 +1,96 @@ +{ + disko.devices = { + disk = { + nvme0n1 = { + type = "disk"; + device = "/dev/nvme0n1"; + content = { + type = "gpt"; + partitions = { + ESP = { + size = "1G"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "defaults" ]; + extraArgs = [ "-nboot" ]; + }; + }; + swap = { + size = "16G"; + type = "8200"; + content = { + type = "swap"; + extraArgs = [ "-L swap" ]; + }; + }; + rpool = { + size = "100%"; + content = { + type = "zfs"; + pool = "rpool"; + }; + }; + }; + }; + }; + }; + zpool = { + rpool = { + type = "zpool"; + rootFsOptions = { + acltype = "posixacl"; + canmount = "off"; + compression = "on"; + dnodesize = "auto"; + relatime = "on"; + xattr = "sa"; + }; + options = { + ashift = "12"; + autotrim = "on"; + }; + datasets = { + "local" = { + type = "zfs_fs"; + options.mountpoint = "none"; + }; + "local/root" = { + type = "zfs_fs"; + options.mountpoint = "legacy"; + mountpoint = "/"; + }; + "local/nix" = { + type = "zfs_fs"; + options = { + atime = "off"; + mountpoint = "legacy"; + }; + mountpoint = "/nix"; + }; + "user" = { + type = "zfs_fs"; + options.mountpoint = "none"; + }; + "user/home" = { + type = "zfs_fs"; + options.mountpoint = "legacy"; + mountpoint = "/home"; + }; + "user/home/root" = { + type = "zfs_fs"; + options.mountpoint = "legacy"; + mountpoint = "/root"; + }; + "user/home/nipsy" = { + type = "zfs_fs"; + options.mountpoint = "legacy"; + mountpoint = "/home/nipsy"; + }; + }; + }; + }; + }; +} diff --git a/hosts/uranus/hardware-configuration.nix b/hosts/uranus/hardware-configuration.nix new file mode 100644 index 0000000..96dd160 --- /dev/null +++ b/hosts/uranus/hardware-configuration.nix @@ -0,0 +1,47 @@ +# 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 = [ "nvme" "xhci_pci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "rpool/local/root"; + fsType = "zfs"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-label/boot"; + fsType = "vfat"; + }; + + fileSystems."/nix" = + { device = "rpool/local/nix"; + fsType = "zfs"; + }; + + fileSystems."/root" = + { device = "rpool/user/home/root"; + fsType = "zfs"; + }; + + fileSystems."/home/nipsy" = + { device = "rpool/user/home/nipsy"; + fsType = "zfs"; + }; + + swapDevices = + [ { device = "/dev/disk/by-label/swap"; } + ]; + + #nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + #hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} |