diff --git a/flake.nix b/flake.nix index df2b105..4e65b48 100644 --- a/flake.nix +++ b/flake.nix @@ -136,6 +136,20 @@ docker = nixpkgs.lib.nixosSystem { } ]; }; + + linode = nixpkgs.lib.nixosSystem { + inherit system; + modules = [ + ./hosts/linode/configuration.nix + ./modules/hardware-configuration/vm/linode.nix + + home-manager.nixosModules.home-manager { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.nixos = import ./modules/common/home.nix; + } + ]; + }; }; }; } diff --git a/hosts/linode/configuration.nix b/hosts/linode/configuration.nix new file mode 100644 index 0000000..c88acdd --- /dev/null +++ b/hosts/linode/configuration.nix @@ -0,0 +1,49 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page, on +# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). + +{ config, lib, pkgs, inputs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ../../modules/common/configuration.nix +# ../../modules/nix/cache-client.nix +# ../../modules/nix/remote-builder-client.nix + ../../modules/tailscale/enable-service.nix + ../../modules/docker/enable-service.nix + ]; + + networking.hostName = "linode"; # Define your hostname. + + + # Open ports in the firewall. +# networking.firewall.allowedTCPPorts = [ 80 8080 443 ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; + + # Copy the NixOS configuration file and link it from the resulting system + # (/run/current-system/configuration.nix). This is useful in case you + # accidentally delete configuration.nix. + # system.copySystemConfiguration = true; + + # This option defines the first version of NixOS you have installed on this particular machine, + # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. + # + # Most users should NEVER change this value after the initial install, for any reason, + # even if you've upgraded your system to a new NixOS release. + # + # This value does NOT affect the Nixpkgs version your packages and OS are pulled from, + # so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how + # to actually do that. + # + # This value being lower than the current NixOS release does NOT mean your system is + # out of date, out of support, or vulnerable. + # + # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, + # and migrated your data accordingly. + # + # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.sta> + system.stateVersion = "25.05"; # Did you read the comment? +} diff --git a/modules/hardware-configuration/vm/linode.nix b/modules/hardware-configuration/vm/linode.nix new file mode 100644 index 0000000..647f7c3 --- /dev/null +++ b/modules/hardware-configuration/vm/linode.nix @@ -0,0 +1,24 @@ +# 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 = [ "virtio_scsi" "ahci" "sd_mod" "sr_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/39c9f27b-5fea-4024-8a5d-64f5537e604d"; + fsType = "ext4"; + }; + + swapDevices = [ ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} \ No newline at end of file