diff --git a/nixos/machines/tides/configuration.nix b/nixos/machines/tides/configuration.nix new file mode 100644 index 0000000..4bdaa86 --- /dev/null +++ b/nixos/machines/tides/configuration.nix @@ -0,0 +1,45 @@ +# 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, + ... +}: { + # Use the systemd-boot EFI boot loader. + boot = { + loader = { + systemd-boot.enable = true; + efi = { + canTouchEfiVariables = true; + efiSysMountPoint = "/boot"; + }; + }; + initrd.systemd.enable = true; + }; + + networking.hostName = "tides"; + networking.domain = "stranger.systems"; + networking.networkmanager.enable = true; + + time.timeZone = "America/Louisville"; + i18n.defaultLocale = "en_US.UTF-8"; + + # Enable passwordless sudo. + security.sudo.extraRules = [ + { + users = ["nathan"]; + commands = [ + { + command = "ALL"; + options = ["NOPASSWD"]; + } + ]; + } + ]; + + services.openssh.enable = true; + + system.stateVersion = "24.11"; # Did you read the comment? +} diff --git a/nixos/machines/tides/hardware-configuration.nix b/nixos/machines/tides/hardware-configuration.nix new file mode 100644 index 0000000..3d4f269 --- /dev/null +++ b/nixos/machines/tides/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 = [ "xhci_pci" "virtio_scsi" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/ebde67a3-7bb8-4453-953b-897440b1ced5"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/9119-BB6A"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + 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..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp0s6.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; +} diff --git a/nixos/machines/tides/machine.nix b/nixos/machines/tides/machine.nix new file mode 100644 index 0000000..b7febc6 --- /dev/null +++ b/nixos/machines/tides/machine.nix @@ -0,0 +1,51 @@ +{ + withSystem, + inputs, + ... +}: { + # perSystem = { ... }: { config.packages.hello = ...; }; + + flake.nixosConfigurations.crash = withSystem "aarch64-linux" ( + ctx @ { + config, + inputs', + ... + }: + inputs.nixpkgs.lib.nixosSystem { + # Expose `packages`, `inputs` and `inputs'` as module arguments. + # Use specialArgs permits use in `imports`. + # Note: if you publish modules for reuse, do not rely on specialArgs, but + # on the flake scope instead. See also https://flake.parts/define-module-in-separate-file.html + specialArgs = { + packages = config.packages; + inherit inputs inputs'; + }; + modules = [ + ( + { + config, + lib, + pkgs, + ... + }: { + imports = [ + # Our modules + (import ../../modules/base.nix {inherit inputs;}) + (import ./configuration.nix) + (import ./hardware.nix) + (import ../../modules/user.nix { + inherit inputs; + mutableUsers = false; + }) + ]; + + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + } + ) + ]; + } + ); +} diff --git a/nixos/modules/base.nix b/nixos/modules/base.nix index f533040..ad927e1 100644 --- a/nixos/modules/base.nix +++ b/nixos/modules/base.nix @@ -19,6 +19,8 @@ tmux alejandra nix-index + curl + wget ]; system.stateVersion = "24.11";