start of a latepanda config.
This commit is contained in:
		
							parent
							
								
									e641a643af
								
							
						
					
					
						commit
						b0cfcb6c8d
					
				
					 8 changed files with 284 additions and 49 deletions
				
			
		| 
						 | 
				
			
			@ -1,6 +1,3 @@
 | 
			
		|||
# Edit this configuration file to define what should be installed on
 | 
			
		||||
# your system.  Help is available in the configuration.nix(5) man page
 | 
			
		||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
 | 
			
		||||
{
 | 
			
		||||
  inputs,
 | 
			
		||||
  outputs,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										122
									
								
								hosts/nfs-panda/default.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										122
									
								
								hosts/nfs-panda/default.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,122 @@
 | 
			
		|||
{
 | 
			
		||||
  inputs,
 | 
			
		||||
  outputs,
 | 
			
		||||
  ...
 | 
			
		||||
}:
 | 
			
		||||
inputs.nixpkgs.lib.nixosSystem {
 | 
			
		||||
  system = "x86_64-linux";
 | 
			
		||||
  specialArgs = {inherit inputs outputs;};
 | 
			
		||||
  # > Our main nixos configuration file <
 | 
			
		||||
  modules = [
 | 
			
		||||
    inputs.home-manager.nixosModules.home-manager
 | 
			
		||||
    inputs.disko.nixosModules.disko
 | 
			
		||||
    ./disk-config.nix
 | 
			
		||||
    ../../modules/hostopts.nix
 | 
			
		||||
    ../../modules/nixos/common.nix
 | 
			
		||||
    ../../modules/nixos/networking.nix
 | 
			
		||||
    ../../modules/nixos/nfsv2.nix
 | 
			
		||||
    ({
 | 
			
		||||
      config,
 | 
			
		||||
      pkgs,
 | 
			
		||||
      ...
 | 
			
		||||
    }: {
 | 
			
		||||
      host = {
 | 
			
		||||
        user = "gabe";
 | 
			
		||||
        gui.enable = false;
 | 
			
		||||
      };
 | 
			
		||||
      networking.hostId = "4dabfd52";
 | 
			
		||||
      # Define your hostname.
 | 
			
		||||
      networking.hostName = "gv-panda";
 | 
			
		||||
      systemd.network = {
 | 
			
		||||
        enable = true;
 | 
			
		||||
        networks = {
 | 
			
		||||
          enp2s0 = {
 | 
			
		||||
            name = "enp2s0";
 | 
			
		||||
            address = [
 | 
			
		||||
              "172.16.0.20/16"
 | 
			
		||||
              "192.168.168.20/24"
 | 
			
		||||
            ];
 | 
			
		||||
          };
 | 
			
		||||
          enx00249b6f0f57 = {
 | 
			
		||||
            name = "enx00249b6f0f57";
 | 
			
		||||
            DHCP = "yes";
 | 
			
		||||
          };
 | 
			
		||||
        };
 | 
			
		||||
      };
 | 
			
		||||
 | 
			
		||||
      time.timeZone = "America/Chicago";
 | 
			
		||||
 | 
			
		||||
      # Select internationalisation properties.
 | 
			
		||||
      i18n.defaultLocale = "en_US.UTF-8";
 | 
			
		||||
 | 
			
		||||
      services.nfs.server = {
 | 
			
		||||
        enable = true;
 | 
			
		||||
        exports = "/srv/nfs *(rw,sync,no_root_squash)";
 | 
			
		||||
        createMountPoints = true;
 | 
			
		||||
      };
 | 
			
		||||
 | 
			
		||||
      environment.systemPackages = with pkgs; [
 | 
			
		||||
        zfs
 | 
			
		||||
        neovim
 | 
			
		||||
      ];
 | 
			
		||||
 | 
			
		||||
      programs.zsh.enable = true;
 | 
			
		||||
      environment.shells = with pkgs; [zsh];
 | 
			
		||||
      # Define a user account. Don't forget to set a password with ‘passwd’.
 | 
			
		||||
      users.users.${config.host.user} = {
 | 
			
		||||
        isNormalUser = true;
 | 
			
		||||
        description = "Gabe Venberg";
 | 
			
		||||
        shell = pkgs.zsh;
 | 
			
		||||
        extraGroups = ["wheel"];
 | 
			
		||||
      };
 | 
			
		||||
 | 
			
		||||
      home-manager.users.${config.host.user} = {
 | 
			
		||||
        inputs,
 | 
			
		||||
        osConfig,
 | 
			
		||||
        ...
 | 
			
		||||
      }: {
 | 
			
		||||
        host = osConfig.host;
 | 
			
		||||
        # machine specific options
 | 
			
		||||
        home = {
 | 
			
		||||
          nvim = {
 | 
			
		||||
            enable-lsp = false;
 | 
			
		||||
            enable-treesitter = false;
 | 
			
		||||
          };
 | 
			
		||||
          git = {
 | 
			
		||||
            profile = {
 | 
			
		||||
              name = "Gabe Venberg";
 | 
			
		||||
              email = "gabevenberg@gmail.com";
 | 
			
		||||
            };
 | 
			
		||||
            workProfile = {
 | 
			
		||||
              enable = true;
 | 
			
		||||
              email = "venberggabe@johndeere.com";
 | 
			
		||||
            };
 | 
			
		||||
          };
 | 
			
		||||
        };
 | 
			
		||||
        imports = [
 | 
			
		||||
          ../../roles/home-manager/terminal.nix
 | 
			
		||||
          ../../modules/home-manager/common.nix
 | 
			
		||||
          inputs.nixvim.homeManagerModules.nixvim
 | 
			
		||||
        ];
 | 
			
		||||
      };
 | 
			
		||||
 | 
			
		||||
      # Enable the OpenSSH daemon.
 | 
			
		||||
      services.openssh.enable = true;
 | 
			
		||||
 | 
			
		||||
      # Bootloader.
 | 
			
		||||
      boot.loader.systemd-boot.enable = true;
 | 
			
		||||
      boot.loader.efi.canTouchEfiVariables = true;
 | 
			
		||||
      boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
 | 
			
		||||
      boot.supportedFilesystems = {zfs = true;};
 | 
			
		||||
      boot.initrd.supportedFilesystems = {zfs = true;};
 | 
			
		||||
 | 
			
		||||
      # This value determines the NixOS release from which the default
 | 
			
		||||
      # settings for stateful data, like file locations and database versions
 | 
			
		||||
      # on your system were taken. It‘s perfectly fine and recommended to leave
 | 
			
		||||
      # this value at the release version of the first install of this system.
 | 
			
		||||
      # Before changing this value read the documentation for this option
 | 
			
		||||
      # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
 | 
			
		||||
      system.stateVersion = "23.11"; # Did you read the comment?
 | 
			
		||||
    })
 | 
			
		||||
  ];
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										74
									
								
								hosts/nfs-panda/disk-config.nix
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										74
									
								
								hosts/nfs-panda/disk-config.nix
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,74 @@
 | 
			
		|||
{
 | 
			
		||||
  disko.devices = {
 | 
			
		||||
    disk = {
 | 
			
		||||
      emmc = {
 | 
			
		||||
        device = "/dev/mmcblk0";
 | 
			
		||||
        type = "disk";
 | 
			
		||||
        content = {
 | 
			
		||||
          type = "gpt";
 | 
			
		||||
          partitions = {
 | 
			
		||||
            ESP = {
 | 
			
		||||
              size = "64M";
 | 
			
		||||
              type = "EF00";
 | 
			
		||||
              content = {
 | 
			
		||||
                type = "filesystem";
 | 
			
		||||
                format = "vfat";
 | 
			
		||||
                mountpoint = "/boot";
 | 
			
		||||
              };
 | 
			
		||||
            };
 | 
			
		||||
            zfs = {
 | 
			
		||||
              size = "100%";
 | 
			
		||||
              content = {
 | 
			
		||||
                type = "zfs";
 | 
			
		||||
                pool = "zroot";
 | 
			
		||||
              };
 | 
			
		||||
            };
 | 
			
		||||
          };
 | 
			
		||||
        };
 | 
			
		||||
      };
 | 
			
		||||
      ssd = {
 | 
			
		||||
        device = "/dev/nvme0n1";
 | 
			
		||||
        type = "disk";
 | 
			
		||||
        content = {
 | 
			
		||||
          type = "gpt";
 | 
			
		||||
          partitions = {
 | 
			
		||||
            zfs = {
 | 
			
		||||
              size = "100%";
 | 
			
		||||
              content = {
 | 
			
		||||
                type = "zfs";
 | 
			
		||||
                pool = "zroot";
 | 
			
		||||
              };
 | 
			
		||||
            };
 | 
			
		||||
          };
 | 
			
		||||
        };
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
    zpool = {
 | 
			
		||||
      zroot = {
 | 
			
		||||
        type = "zpool";
 | 
			
		||||
        rootFsOptions = {
 | 
			
		||||
          ashift = "12";
 | 
			
		||||
          compression = "zstd";
 | 
			
		||||
          mountpoint = "none";
 | 
			
		||||
          atime = "off";
 | 
			
		||||
        };
 | 
			
		||||
        datasets = {
 | 
			
		||||
          root_fs = {
 | 
			
		||||
            type = "zfs_fs";
 | 
			
		||||
            mountpoint = "/";
 | 
			
		||||
            options.mountpoint = "legacy";
 | 
			
		||||
          };
 | 
			
		||||
          nix_fs = {
 | 
			
		||||
            type = "zfs_fs";
 | 
			
		||||
            mountpoint = "/nix";
 | 
			
		||||
            options.mountpoint = "legacy";
 | 
			
		||||
          };
 | 
			
		||||
          nfs_fs = {
 | 
			
		||||
            type = "zfs_fs";
 | 
			
		||||
            mountpoint = "/srv/nfs";
 | 
			
		||||
          };
 | 
			
		||||
        };
 | 
			
		||||
      };
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue