diff --git a/flake.nix b/flake.nix index 5e0ac88..4c1d644 100644 --- a/flake.nix +++ b/flake.nix @@ -32,9 +32,11 @@ ./nixos/machines/installer/configuration.nix ./nixos/machines/crash/machine.nix ./nixos/machines/tides/machine.nix + ./nixos/machines/driftwood/machine.nix ./home-manager/machines/wsl/home.nix ./home-manager/machines/crash/home.nix ./home-manager/machines/tides/home.nix + ./home-manager/machines/driftwood/home.nix ./devshells/rust.nix ./devshells/idris2.nix ./devshells/raku.nix diff --git a/home-manager/machines/driftwood/home.nix b/home-manager/machines/driftwood/home.nix new file mode 100644 index 0000000..39d6753 --- /dev/null +++ b/home-manager/machines/driftwood/home.nix @@ -0,0 +1,51 @@ +{ + withSystem, + inputs, + ... +}: { + # perSystem = { ... }: { config.packages.hello = ...; }; + + flake.homeConfigurations.tides = withSystem "x86_64-linux" ( + ctx @ { + config, + inputs', + ... + }: + inputs.home-manager.lib.homeManagerConfiguration { + pkgs = inputs.nixpkgs.legacyPackages.${"x86_64-linux"}; + extraSpecialArgs = { + inherit inputs inputs'; + packages = config.packages; + }; + modules = [ + ( + { + config, + lib, + pkgs, + ... + }: { + imports = [ + ../../modules/programs/shell.nix + ../../modules/programs/neovim.nix + (import ../../modules/programs/git.nix {}) + ../../modules/programs/core.nix + ../../modules/programs/ssh.nix + ]; + home.username = "nathan"; + home.homeDirectory = "/home/nathan/"; + programs.command-not-found.enable = true; + home.stateVersion = "24.11"; + programs.home-manager.enable = true; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + home.packages = with pkgs; [ + ]; + } + ) + ]; + } + ); +} diff --git a/nixos/machines/driftwood/configuration.nix b/nixos/machines/driftwood/configuration.nix new file mode 100644 index 0000000..f04a9a0 --- /dev/null +++ b/nixos/machines/driftwood/configuration.nix @@ -0,0 +1,20 @@ +# 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; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "driftwood"; + + time.timeZone = "America/Louisville"; + i18n.defaultLocale = "en_US.UTF-8"; + + system.stateVersion = "24.11"; # Did you read the comment? + +} + diff --git a/nixos/machines/driftwood/hardware.nix b/nixos/machines/driftwood/hardware.nix new file mode 100644 index 0000000..9ee179b --- /dev/null +++ b/nixos/machines/driftwood/hardware.nix @@ -0,0 +1,67 @@ +# 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") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/e9e1adfb-feb9-4456-80a0-d8d306b36145"; + fsType = "btrfs"; + options = [ "subvol=root" ]; + }; + + fileSystems."/nix" = + { device = "/dev/disk/by-uuid/e9e1adfb-feb9-4456-80a0-d8d306b36145"; + fsType = "btrfs"; + options = [ "subvol=nix" ]; + }; + + fileSystems."/var" = + { device = "/dev/disk/by-uuid/e9e1adfb-feb9-4456-80a0-d8d306b36145"; + fsType = "btrfs"; + options = [ "subvol=var" ]; + }; + + fileSystems."/home" = + { device = "/dev/disk/by-uuid/e9e1adfb-feb9-4456-80a0-d8d306b36145"; + fsType = "btrfs"; + options = [ "subvol=home" ]; + }; + + fileSystems."/etc" = + { device = "/dev/disk/by-uuid/e9e1adfb-feb9-4456-80a0-d8d306b36145"; + fsType = "btrfs"; + options = [ "subvol=etc" ]; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/DE13-B03B"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/fe4935bf-ae69-4529-87cd-1a913c346876"; } + ]; + + # 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.enp5s0f0.useDHCP = lib.mkDefault true; + # networking.interfaces.enp5s0f1.useDHCP = lib.mkDefault true; + # networking.interfaces.enp7s0f3u2u2c2.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/nixos/machines/driftwood/machine.nix b/nixos/machines/driftwood/machine.nix new file mode 100644 index 0000000..6530412 --- /dev/null +++ b/nixos/machines/driftwood/machine.nix @@ -0,0 +1,52 @@ +{ + withSystem, + inputs, + ... +}: { + # perSystem = { ... }: { config.packages.hello = ...; }; + + flake.nixosConfigurations.driftwood = 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; + }) + (import ../../modules/ssh.nix) + ]; + + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; + } + ) + ]; + } + ); +}