diff --git a/flake.nix b/flake.nix index cde66cb..5216046 100644 --- a/flake.nix +++ b/flake.nix @@ -97,6 +97,7 @@ }; in { + nixosConfigurations."apricot" = mkSystem "apricot" "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/apricot/default.nix b/hosts/apricot/default.nix new file mode 100644 index 0000000..23cb160 --- /dev/null +++ b/hosts/apricot/default.nix @@ -0,0 +1,21 @@ +{ config, modules, overlays, pkgs, ... }: { + networking.hostName = "apricot"; + system.stateVersion = "21.05"; + + imports = with modules.system; [ + base + input + kernel + nix + packages + security + snapper + + ./filesystem.nix + ./kernel.nix + ./networking.nix + + ../../users/rin.nix + ]; +} + diff --git a/hosts/apricot/filesystem.nix b/hosts/apricot/filesystem.nix new file mode 100644 index 0000000..6c44ae6 --- /dev/null +++ b/hosts/apricot/filesystem.nix @@ -0,0 +1,29 @@ +{ config, ... }: +let + mkMount = uuid: type: { + device = "/dev/disk/by-uuid/${uuid}"; + fsType = type; + options = [ "defaults" "relatime" ]; + }; + mkBtrfsMount = subvolid: atime: mkMount "c79ebe18-2d2b-4f0f-9940-afd9378afa09" "btrfs" // { + options = [ "autodefrag" "compress=zstd:3" "defaults" "nossd" "nossd_spread" "subvolid=${builtins.toString subvolid}" (if atime then "relatime" else "noatime")]; + }; +in +{ + fileSystems = { + "/" = { + device = "rootfs"; + fsType = "tmpfs"; + options = [ "defaults" "size=4G" "mode=755" ]; + }; + "/boot" = mkMount "2818-A529" "vfat"; + "/mnt/hdd" = mkMount "436ad832-8dcc-4813-b663-4d0b7b773ff2" "ext4"; + + "/mnt/butter" = mkBtrfsMount 5 true; + "/nix" = mkBtrfsMount 258 false; + "/home" = mkBtrfsMount 260 true; + "/home/.snapshots" = mkBtrfsMount 263 false; + "/root" = mkBtrfsMount 261 false; + "/var" = mkBtrfsMount 259 false; + }; +} diff --git a/hosts/apricot/kernel.nix b/hosts/apricot/kernel.nix new file mode 100644 index 0000000..7e7ff0d --- /dev/null +++ b/hosts/apricot/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.kernelModules = [ "i915" ]; + kernelParams = [ + "intel_pstate=passive" + ]; + kernelPackages = pkgs.linuxPackages_latest; + }; +} diff --git a/hosts/apricot/networking.nix b/hosts/apricot/networking.nix new file mode 100644 index 0000000..d7fc78a --- /dev/null +++ b/hosts/apricot/networking.nix @@ -0,0 +1,23 @@ +{ config, ... }: { + networking = { + wireless = { + enable = true; + interfaces = [ "wlp1s0" ]; + }; + + useDHCP = false; + interfaces.enp2s0.useDHCP = false; + interfaces.wlp1s0.useDHCP = false; + + interfaces.enp2s0.ipv4.addresses = [{ + address = "10.0.0.1"; + prefixLength = 24; + }]; + interfaces.wlp1s0.ipv4.addresses = [{ + address = "192.168.100.14"; + prefixLength = 24; + }]; + defaultGateway = "192.168.100.1"; + nameservers = [ "8.8.8.8" ]; + }; +}