From f3fe0145585203a911ee2df72adb273235adcbbd Mon Sep 17 00:00:00 2001 From: notohh Date: Fri, 12 May 2023 05:26:48 -0400 Subject: [PATCH] feat: init sakura --- hosts/deploy.nix | 10 +++++ hosts/sakura/default.nix | 50 +++++++++++++++++++++++++ hosts/sakura/hardware-configuration.nix | 37 ++++++++++++++++++ hosts/sakura/home.nix | 18 +++++++++ 4 files changed, 115 insertions(+) create mode 100644 hosts/sakura/default.nix create mode 100644 hosts/sakura/hardware-configuration.nix create mode 100644 hosts/sakura/home.nix diff --git a/hosts/deploy.nix b/hosts/deploy.nix index 028b5f6..3a7e51a 100644 --- a/hosts/deploy.nix +++ b/hosts/deploy.nix @@ -20,5 +20,15 @@ inputs: { sshOpts = ["-t"]; magicRollback = false; }; + sakura = { + hostname = "192.168.1.25"; + profiles.system = { + user = "root"; + path = activate.nixos inputs.self.nixosConfigurations.sakura; + }; + sshUser = "notoh"; + sshOpts = ["-t"]; + magicRollback = false; + }; }; } diff --git a/hosts/sakura/default.nix b/hosts/sakura/default.nix new file mode 100644 index 0000000..f4c7ed7 --- /dev/null +++ b/hosts/sakura/default.nix @@ -0,0 +1,50 @@ +{ + config, + pkgs, + ... +}: { + imports = [ + ./hardware-configuration.nix + ../../modules + ]; + + boot.loader = { + grub = { + enable = true; + configurationLimit = 3; + device = "/dev/sda"; + useOSProber = false; + }; + }; + + networking = { + hostName = "sakura"; + }; + + services.xserver = { + layout = "us"; + xkbVariant = ""; + }; + + virtualisation.docker.enable = true; + users = { + defaultUserShell = pkgs.nushell; + users.notoh = { + isNormalUser = true; + description = "notoh"; + extraGroups = ["networkmanager" "wheel" "docker"]; + }; + }; + + environment.systemPackages = with pkgs; [ + wget + nfs-utils + pinentry-curses + ]; + + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + pinentryFlavor = "curses"; + }; +} diff --git a/hosts/sakura/hardware-configuration.nix b/hosts/sakura/hardware-configuration.nix new file mode 100644 index 0000000..2feb4d1 --- /dev/null +++ b/hosts/sakura/hardware-configuration.nix @@ -0,0 +1,37 @@ +# 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 + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = []; + boot.extraModulePackages = []; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/8c99d37a-4599-4ef2-830c-8752854d0493"; + fsType = "ext4"; + }; + + swapDevices = [ + {device = "/dev/disk/by-uuid/96c98d32-fdb4-4055-8112-46f9b5680181";} + ]; + + # 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.ens18.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} diff --git a/hosts/sakura/home.nix b/hosts/sakura/home.nix new file mode 100644 index 0000000..c8a9536 --- /dev/null +++ b/hosts/sakura/home.nix @@ -0,0 +1,18 @@ +{ + config, + pkgs, + ... +}: { + imports = [ + ../../home + ]; + + systemd.user.startServices = "sd-switch"; + programs.home-manager.enable = true; + + home = { + username = "notoh"; + homeDirectory = "/home/notoh"; + stateVersion = "23.05"; + }; +}