diff --git a/flake.nix b/flake.nix index 3115591..fbdbcb2 100644 --- a/flake.nix +++ b/flake.nix @@ -117,30 +117,22 @@ ### # Proxmox Homelab Machine ### - susano-minimal = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs outputs extraHomeModules; }; - modules = [ - disko.nixosModules.disko - home-manager.nixosModules.home-manager - ./machines/susano-minimal - ]; - }; - - susano = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs outputs extraHomeModules; }; - modules = [ - disko.nixosModules.disko - home-manager.nixosModules.home-manager + susano-minimal = mkComputer + ./machines/susano/minimal + [] + "susano"; + susano = mkComputer + ./machines/susano/main + [ sops-nix.nixosModules.sops # Applications inputs.copyparty.nixosModules.default inputs.vscode-server.nixosModules.default - ./machines/susano ./modules - ]; - }; + ] + "susano"; ### # Proxmox Remote Dev Machine diff --git a/machines/susano-minimal/disko-config.nix b/machines/susano-minimal/disko-config.nix deleted file mode 100644 index 35e76fc..0000000 --- a/machines/susano-minimal/disko-config.nix +++ /dev/null @@ -1,55 +0,0 @@ -{ - disko.devices = { - disk = { - main = { - device = "/dev/sda"; - type = "disk"; - content = { - type = "gpt"; - partitions = { - boot = { - size = "1M"; - type = "EF02"; # for grub MBR - }; - root = { - size = "100%"; - content = { - type = "btrfs"; - extraArgs = [ "-f" ]; # Override existing partition - # Subvolumes must set a mountpoint in order to be mounted, - # unless their parent is mounted - subvolumes = { - # Subvolume name is different from mountpoint - "/rootfs" = { - mountpoint = "/"; - }; - # Subvolume name is the same as the mountpoint - "/home" = { - mountOptions = [ "compress=zstd" ]; - mountpoint = "/home"; - }; - # Sub(sub)volume doesn't need a mountpoint as its parent is mounted - "/home/susano" = { }; - "/nix" = { - mountOptions = [ - "compress=zstd" - "noatime" - ]; - mountpoint = "/nix"; - }; - }; - - mountpoint = "/partition-root"; - swap = { - swapfile = { - size = "8G"; - }; - }; - }; - }; - }; - }; - }; - }; - }; -} diff --git a/machines/susano-minimal/hardware-configuration.nix b/machines/susano-minimal/hardware-configuration.nix deleted file mode 100644 index c760612..0000000 --- a/machines/susano-minimal/hardware-configuration.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ config, lib, pkgs, modulesPath, ... }: - -{ - imports = - [ (modulesPath + "/profiles/qemu-guest.nix") - ]; - - boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ahci" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ ]; - boot.extraModulePackages = [ ]; - - # fileSystems."/" = - # { device = "/dev/disk/by-uuid/301d5990-7186-4a90-94aa-997044007358"; - # fsType = "ext4"; - # }; - - # swapDevices = [ ]; - - # 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.<interface>.useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.ens18.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; -} diff --git a/machines/susano/.sops.yaml b/machines/susano/main/.sops.yaml similarity index 100% rename from machines/susano/.sops.yaml rename to machines/susano/main/.sops.yaml diff --git a/machines/susano/default.nix b/machines/susano/main/default.nix similarity index 94% rename from machines/susano/default.nix rename to machines/susano/main/default.nix index 92ac85b..ce3a596 100644 --- a/machines/susano/default.nix +++ b/machines/susano/main/default.nix @@ -1,13 +1,14 @@ -{ config, pkgs, extraHomeModules, inputs, lib, ... }: +{ config, pkgs, extraHomeModules, inputs, lib, username, ... }: let - username = "susano"; flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs; in { imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ./disko-config.nix + [ + ../../minimal.nix + + ../hardware-configuration.nix + ../disko-config.nix ./sops.nix ]; @@ -88,8 +89,6 @@ in { openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBcGhVpjmWEw1GEw0y/ysJPa2v3+u/Rt/iES/Se2huH2 alexander0derevianko@gmail.com" ]; - - shell = pkgs.zsh; }; environment.systemPackages = with pkgs; [ diff --git a/machines/susano-minimal/home.nix b/machines/susano/main/home.nix similarity index 100% rename from machines/susano-minimal/home.nix rename to machines/susano/main/home.nix diff --git a/machines/susano/secrets/secrets.yaml b/machines/susano/main/secrets/secrets.yaml similarity index 100% rename from machines/susano/secrets/secrets.yaml rename to machines/susano/main/secrets/secrets.yaml diff --git a/machines/susano/sops.nix b/machines/susano/main/sops.nix similarity index 100% rename from machines/susano/sops.nix rename to machines/susano/main/sops.nix diff --git a/machines/susano-minimal/default.nix b/machines/susano/minimal/default.nix similarity index 93% rename from machines/susano-minimal/default.nix rename to machines/susano/minimal/default.nix index 9cbbc72..3004c29 100644 --- a/machines/susano-minimal/default.nix +++ b/machines/susano/minimal/default.nix @@ -1,13 +1,14 @@ -{ config, pkgs, extraHomeModules, inputs, lib, ... }: +{ config, pkgs, extraHomeModules, inputs, lib, username, ... }: let - username = "susano"; flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs; in { imports = - [ # Include the results of the hardware scan. - ./hardware-configuration.nix - ./disko-config.nix + [ + ../../minimal.nix + + ../hardware-configuration.nix + ../disko-config.nix ]; nixpkgs = { @@ -87,8 +88,6 @@ in { openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBcGhVpjmWEw1GEw0y/ysJPa2v3+u/Rt/iES/Se2huH2 alexander0derevianko@gmail.com" ]; - - shell = pkgs.zsh; }; environment.systemPackages = with pkgs; [ diff --git a/machines/susano/home.nix b/machines/susano/minimal/home.nix similarity index 100% rename from machines/susano/home.nix rename to machines/susano/minimal/home.nix