diff options
-rw-r--r-- | flake.nix | 12 | ||||
-rw-r--r-- | home/nipsy/jupiter.nix | 6 | ||||
-rw-r--r-- | home/root/jupiter.nix | 6 | ||||
-rw-r--r-- | hosts/jupiter/default.nix | 61 | ||||
-rw-r--r-- | hosts/jupiter/disks.nix | 95 | ||||
-rw-r--r-- | hosts/jupiter/hardware-configuration.nix | 47 |
6 files changed, 227 insertions, 0 deletions
@@ -116,6 +116,18 @@ ]; }; + jupiter = nixpkgs.lib.nixosSystem rec { + specialArgs = { inherit inputs outputs; }; + modules = [ + ./hosts/jupiter + home-manager.nixosModules.home-manager { + #home-manager.sharedModules = [ sops-nix.homeManagerModules.sops ]; + home-manager.users.root = import ./home/root/jupiter.nix; + home-manager.users.nipsy = import ./home/nipsy/jupiter.nix; + } + #sops-nix.nixosModules.sops + ]; + }; richese = nixpkgs.lib.nixosSystem rec { specialArgs = { inherit inputs outputs; }; modules = [ diff --git a/home/nipsy/jupiter.nix b/home/nipsy/jupiter.nix new file mode 100644 index 0000000..83c92cd --- /dev/null +++ b/home/nipsy/jupiter.nix @@ -0,0 +1,6 @@ +{ inputs, lib, pkgs, config, outputs, ... }: +{ + imports = [ + common/core + ]; +} diff --git a/home/root/jupiter.nix b/home/root/jupiter.nix new file mode 100644 index 0000000..83c92cd --- /dev/null +++ b/home/root/jupiter.nix @@ -0,0 +1,6 @@ +{ inputs, lib, pkgs, config, outputs, ... }: +{ + imports = [ + common/core + ]; +} diff --git a/hosts/jupiter/default.nix b/hosts/jupiter/default.nix new file mode 100644 index 0000000..4ed8c9e --- /dev/null +++ b/hosts/jupiter/default.nix @@ -0,0 +1,61 @@ +{ 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/openssh.nix + ../common/optional/zfs.nix + ../common/users/nipsy + ../common/users/root + ]; + + networking = { + hostId = "d3a9e699"; + hostName = "jupiter"; + domain = "bitgnome.net"; + nftables.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/jupiter.yaml; + + # secrets = { + # "kea-dhcp4_conf" = {}; + # "nftables/forward" = {}; + # "nftables/ssh" = {}; + # "nix-access-token-github" = {}; + # }; + #}; + + system.stateVersion = "24.11"; +} diff --git a/hosts/jupiter/disks.nix b/hosts/jupiter/disks.nix new file mode 100644 index 0000000..e8474fa --- /dev/null +++ b/hosts/jupiter/disks.nix @@ -0,0 +1,95 @@ +{ + 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 swap1" ]; + }; + }; + 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/jupiter/hardware-configuration.nix b/hosts/jupiter/hardware-configuration.nix new file mode 100644 index 0000000..96dd160 --- /dev/null +++ b/hosts/jupiter/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; +} |