From feefcfc89b00d4955dbb3314c20be035f3db206f Mon Sep 17 00:00:00 2001 From: tzlil Date: Sat, 29 Jul 2023 20:53:14 +0300 Subject: disko for laptop, wip rewrite --- hosts/vps/cfg.nix | 91 --------------------------------------------------- hosts/vps/default.nix | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++ hosts/vps/git.nix | 3 +- 3 files changed, 92 insertions(+), 93 deletions(-) delete mode 100644 hosts/vps/cfg.nix create mode 100644 hosts/vps/default.nix (limited to 'hosts/vps') diff --git a/hosts/vps/cfg.nix b/hosts/vps/cfg.nix deleted file mode 100644 index 3597c5c..0000000 --- a/hosts/vps/cfg.nix +++ /dev/null @@ -1,91 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: { - imports = [ - ../../profiles/core.nix - ../../profiles/user.nix - ../../profiles/ssh.nix - ../../mixins/tailscale.nix - ../../mixins/cli.nix - ./website.nix - ./git.nix - ./hydrus.nix - ./matrix.nix - ./maloja.nix - ]; - - config = { - _module.args.nixinate = { - host = "vps"; - sshUser = "tzlil"; - buildOn = "remote"; # valid args are "local" or "remote" - substituteOnTarget = true; # if buildOn is "local" then it will substitute on the target, "-s" - hermetic = false; - }; - - networking.hostName = "vps"; - - boot = { - kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; - loader.grub.device = "/dev/vda"; - initrd = { - availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk"]; - kernelModules = []; - }; - kernelModules = []; - extraModulePackages = []; - }; - - networking.interfaces.ens3.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; - virtualisation.hypervGuest.enable = true; - - time.timeZone = lib.mkDefault "Frankfurt"; - - fileSystems = { - "/" = { - device = "none"; - fsType = "tmpfs"; - options = ["noexec" "defaults" "size=2G" "mode=755"]; - }; - "/nix" = { - device = "/dev/disk/by-uuid/e4c4735d-bfdd-477f-bc43-d07510cb6a9a"; - fsType = "btrfs"; - }; - "/boot" = { - device = "/dev/disk/by-uuid/7ea63707-099d-4c21-90eb-a51bfa6d8ba5"; - fsType = "ext4"; - }; - }; - - swapDevices = [{device = "/dev/disk/by-uuid/00eb2d2e-4d7c-4e95-804d-e9ecb22679d4";}]; - - zramSwap = { - enable = true; - algorithm = "zstd"; - }; - - networking.networkmanager.enable = lib.mkForce false; - - nixpkgs.config.allowUnfree = true; - environment.persistence."/nix/persist".directories = [ - { - directory = config.services.terraria.dataDir; - user = "terraria"; - group = "terraria"; - } - ]; - - services.terraria = { - enable = true; - worldPath = "${config.services.terraria.dataDir}/14.wld"; - password = "???"; - openFirewall = true; - }; - }; -} diff --git a/hosts/vps/default.nix b/hosts/vps/default.nix new file mode 100644 index 0000000..3597c5c --- /dev/null +++ b/hosts/vps/default.nix @@ -0,0 +1,91 @@ +{ + config, + lib, + pkgs, + ... +}: { + imports = [ + ../../profiles/core.nix + ../../profiles/user.nix + ../../profiles/ssh.nix + ../../mixins/tailscale.nix + ../../mixins/cli.nix + ./website.nix + ./git.nix + ./hydrus.nix + ./matrix.nix + ./maloja.nix + ]; + + config = { + _module.args.nixinate = { + host = "vps"; + sshUser = "tzlil"; + buildOn = "remote"; # valid args are "local" or "remote" + substituteOnTarget = true; # if buildOn is "local" then it will substitute on the target, "-s" + hermetic = false; + }; + + networking.hostName = "vps"; + + boot = { + kernelPackages = lib.mkDefault pkgs.linuxPackages_latest; + loader.grub.device = "/dev/vda"; + initrd = { + availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "sr_mod" "virtio_blk"]; + kernelModules = []; + }; + kernelModules = []; + extraModulePackages = []; + }; + + networking.interfaces.ens3.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + virtualisation.hypervGuest.enable = true; + + time.timeZone = lib.mkDefault "Frankfurt"; + + fileSystems = { + "/" = { + device = "none"; + fsType = "tmpfs"; + options = ["noexec" "defaults" "size=2G" "mode=755"]; + }; + "/nix" = { + device = "/dev/disk/by-uuid/e4c4735d-bfdd-477f-bc43-d07510cb6a9a"; + fsType = "btrfs"; + }; + "/boot" = { + device = "/dev/disk/by-uuid/7ea63707-099d-4c21-90eb-a51bfa6d8ba5"; + fsType = "ext4"; + }; + }; + + swapDevices = [{device = "/dev/disk/by-uuid/00eb2d2e-4d7c-4e95-804d-e9ecb22679d4";}]; + + zramSwap = { + enable = true; + algorithm = "zstd"; + }; + + networking.networkmanager.enable = lib.mkForce false; + + nixpkgs.config.allowUnfree = true; + environment.persistence."/nix/persist".directories = [ + { + directory = config.services.terraria.dataDir; + user = "terraria"; + group = "terraria"; + } + ]; + + services.terraria = { + enable = true; + worldPath = "${config.services.terraria.dataDir}/14.wld"; + password = "???"; + openFirewall = true; + }; + }; +} diff --git a/hosts/vps/git.nix b/hosts/vps/git.nix index d9c638d..8bd4653 100644 --- a/hosts/vps/git.nix +++ b/hosts/vps/git.nix @@ -13,8 +13,7 @@ packages = [pkgs.git]; shell = "${pkgs.git}/bin/git-shell"; openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMDyzrs9sbstv3KFK5FV8qYlSknnEy8Cn+qch4dJLmHA" - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPhN4Iq070J9rFJhOwP9RUyUJG9MC1W5KnDGqBqWZnlu" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIgPE76xQXx1kpvWavHGNOWHiZSFdGfz/rQlISGrKsDe" ]; }; -- cgit 1.4.1