diff --git a/flake.nix b/flake.nix index a76eaf55..b37f27da 100644 --- a/flake.nix +++ b/flake.nix @@ -19,6 +19,9 @@ libx = import ./lib { inherit inputs outputs stateVersion hmStateVersion; }; in { nixosConfigurations = { + # Generic Images + nixos-rpi4-img = libx.mkHost { hostname = "nixos-rpi4-img"; platform = "aarch64-linux"; }; + # Host Specific Configs nixos-laptop = libx.mkHost { hostname = "nixos-laptop"; desktop = "hyprland"; gpu = "intel"; theme = "gruvbox"; }; nixos-framework = libx.mkHost { hostname = "nixos-framework"; desktop = "hyprland"; gpu = "amd"; theme = "gruvbox"; }; nixos-rpi4-01 = libx.mkHost { hostname = "nixos-rpi4-01"; platform = "aarch64-linux"; }; @@ -26,16 +29,14 @@ nixos-rpi4-03 = libx.mkHost { hostname = "nixos-rpi4-03"; platform = "aarch64-linux"; }; }; homeConfigurations = { + # Generic Images + "albert@nixos-rpi4-img" = libx.mkHome { hostname = "nixos-rpi4-img"; platform = "aarch64-linux"; }; + # Host Specific Configs "albert@nixos-laptop" = libx.mkHome { hostname = "nixos-laptop"; desktop = "hyprland"; theme = "gruvbox"; }; "albert@nixos-framework" = libx.mkHome { hostname = "nixos-framework"; desktop = "hyprland"; theme = "gruvbox"; }; "albert@nixos-rpi4-01" = libx.mkHome { hostname = "nixos-rpi4-01"; platform = "aarch64-linux"; }; "albert@nixos-rpi4-02" = libx.mkHome { hostname = "nixos-rpi4-01"; platform = "aarch64-linux"; }; "albert@nixos-rpi4-03" = libx.mkHome { hostname = "nixos-rpi4-01"; platform = "aarch64-linux"; }; }; - images = { - nixos-rpi4-01 = nixosConfigurations.nixos-rpi4-01.config.system.build.sdImage; - nixos-rpi4-02 = nixosConfigurations.nixos-rpi4-02.config.system.build.sdImage; - nixos-rpi4-03 = nixosConfigurations.nixos-rpi4-03.config.system.build.sdImage; - }; }; } \ No newline at end of file diff --git a/lib/default.nix b/lib/default.nix index 89c99e5e..3c782c3e 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -29,6 +29,7 @@ specialArgs = { inherit inputs outputs desktop hostname username stateVersion gpu platform theme; }; modules = [ ../nixos + inputs.nixpkgs.nixos.modules.installer.sd-card.sd-image-raspberrypi inputs.sops-nix.nixosModules.sops inputs.lanzaboote.nixosModules.lanzaboote ] ++ (inputs.nixpkgs.lib.optionals (installer != null) [ installer ]); diff --git a/nixos/hosts/nixos-rpi4-img/default.nix b/nixos/hosts/nixos-rpi4-img/default.nix new file mode 100644 index 00000000..4b6537fa --- /dev/null +++ b/nixos/hosts/nixos-rpi4-img/default.nix @@ -0,0 +1,38 @@ +# 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") + + ]; + ##################################################################################### + # BEGIN hardware config + ##################################################################################### + + # Use the extlinux boot loader. (NixOS wants to enable GRUB by default) + boot.loader.grub.enable = false; + # Enables the generation of /boot/extlinux/extlinux.conf + boot.loader.generic-extlinux-compatible.enable = true; + + boot.initrd.availableKernelModules = [ "xhci_pci" "usbhid" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888"; + fsType = "ext4"; + }; + + swapDevices = [ ]; + networking.useDHCP = lib.mkDefault true; + nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; + powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; + networking.hostName = "nixos-rpi4-img"; + ##################################################################################### + # END hardware config + ##################################################################################### + # Temporary + networking.firewall.allowedTCPPorts = [ 22 ]; +} \ No newline at end of file