diff --git a/flake.nix b/flake.nix index ea3077f..70bc001 100644 --- a/flake.nix +++ b/flake.nix @@ -109,6 +109,7 @@ in { nixosConfigurations."apricot" = mkSystem "apricot" "x86_64-linux" false; + nixosConfigurations."fondue" = mkSystem "fondue" "x86_64-linux" false; nixosConfigurations."winter" = mkSystem "winter" "x86_64-linux" true; packages.x86_64-linux = customPackages nixpkgs.legacyPackages.x86_64-linux; diff --git a/hosts/fondue/default.nix b/hosts/fondue/default.nix new file mode 100644 index 0000000..9eb04d5 --- /dev/null +++ b/hosts/fondue/default.nix @@ -0,0 +1,23 @@ +{ config, modules, modulesPath, overlays, pkgs, ... }: { + networking.hostName = "fondue"; + system.stateVersion = "21.05"; + time.timeZone = "Australia/Melbourne"; + + imports = with modules.system; [ + (modulesPath + "/profiles/qemu-guest.nix") + base + input + kernel + nix + packages + security + snapper + + ./filesystem.nix + ./kernel.nix + ./networking.nix + + ../../users/rin.nix + ]; +} + diff --git a/hosts/fondue/filesystem.nix b/hosts/fondue/filesystem.nix new file mode 100644 index 0000000..8dba16d --- /dev/null +++ b/hosts/fondue/filesystem.nix @@ -0,0 +1,28 @@ +{ config, ... }: +let + mkMount = uuid: type: { + device = "/dev/disk/by-uuid/${uuid}"; + fsType = type; + options = [ "defaults" "relatime" ]; + }; + mkBtrfsMount = subvolid: atime: mkMount "8253d2ea-0813-4f71-9968-553965f0054b" "btrfs" // { + options = [ "autodefrag" "compress=zstd:3" "defaults" "ssd" "ssd_spread" "subvolid=${builtins.toString subvolid}" (if atime then "relatime" else "noatime")]; + }; +in +{ + fileSystems = { + "/" = { + device = "rootfs"; + fsType = "tmpfs"; + options = [ "defaults" "size=2G" "mode=755" ]; + }; + "/boot" = mkMount "0F35-9054" "vfat"; + + "/mnt/butter" = mkBtrfsMount 5 true; + "/nix" = mkBtrfsMount 258 false; + "/home" = mkBtrfsMount 260 true; + "/home/.snapshots" = mkBtrfsMount 262 false; + "/root" = mkBtrfsMount 261 false; + "/var" = mkBtrfsMount 259 false; + }; +} diff --git a/hosts/fondue/kernel.nix b/hosts/fondue/kernel.nix new file mode 100644 index 0000000..780ace8 --- /dev/null +++ b/hosts/fondue/kernel.nix @@ -0,0 +1,18 @@ +{ config, pkgs, ... }: { + boot = { + loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + grub = { + enable = true; + efiSupport = true; + device = "nodev"; + }; + }; + initrd = { + availableKernelModules = [ "uhci_hcd" "ehci_pci" "ahci" "virtio_pci" "sr_mod" "virtio_blk" ]; + kernelModules = [ "kvm-amd" ]; + }; + kernelPackages = pkgs.linuxPackages_latest; + }; +} diff --git a/hosts/fondue/networking.nix b/hosts/fondue/networking.nix new file mode 100644 index 0000000..fb275f7 --- /dev/null +++ b/hosts/fondue/networking.nix @@ -0,0 +1,13 @@ +{ config, ... }: { + networking = { + useDHCP = false; + interfaces.enp2s1.useDHCP = false; + + interfaces.enp2s1.ipv4.addresses = [{ + address = "192.168.100.101"; + prefixLength = 24; + }]; + defaultGateway = "192.168.100.1"; + nameservers = [ "8.8.8.8" ]; + }; +}