diff --git a/flake.lock b/flake.lock index 4c8d793..8efbf85 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1730751873, - "narHash": "sha256-sdY29RWz0S7VbaoTwSy6RummdHKf0wUTaBlqPxrtvmQ=", + "lastModified": 1731060864, + "narHash": "sha256-aYE7oAYZ+gPU1mPNhM0JwLAQNgjf0/JK1BF1ln2KBgk=", "owner": "nix-community", "repo": "disko", - "rev": "856a2902156ba304efebd4c1096dbf7465569454", + "rev": "5e40e02978e3bd63c2a6a9fa6fa8ba0e310e747f", "type": "github" }, "original": { diff --git a/hosts/lenar/disko.nix b/hosts/lenar/disko.nix index df53a71..258a7c6 100644 --- a/hosts/lenar/disko.nix +++ b/hosts/lenar/disko.nix @@ -45,7 +45,6 @@ mountpoint = "/nix"; }; }; - mountpoint = "/partition-root"; }; }; }; diff --git a/hosts/wenar-nix/default.nix b/hosts/wenar-nix/default.nix new file mode 100644 index 0000000..a6f4b6f --- /dev/null +++ b/hosts/wenar-nix/default.nix @@ -0,0 +1,59 @@ +{ + config, + pkgs, + inputs, + ... +}: +{ + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + inputs.disko.nixosModules.disko + inputs.nixos-hardware.nixosModules.common-cpu-intel + ./disko.nix + ]; + + zramSwap.enable = true; + + boot.kernelPackages = pkgs.linuxPackages_latest; + + networking.hostName = "wenar-nix"; # Define your hostname. + + # My own modules configuration + krop = { + audio = { + enable = true; + }; + ide = { + enable = true; + install-pycharm = true; + }; + python = { + enable = true; + install-additional = true; + }; + cli = { + enable = true; + install-k8s-tools = true; + install-cloud-cli = true; + }; + docker = { + enable = true; + changeDefaultNetwork = true; + }; + de.gnome = { + enable = true; + }; + }; + + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + extraSpecialArgs = { + inherit inputs; + }; + users = { + "krop" = import ../../users/krop; + }; + }; +} diff --git a/hosts/wenar-nix/disko.nix b/hosts/wenar-nix/disko.nix new file mode 100644 index 0000000..258a7c6 --- /dev/null +++ b/hosts/wenar-nix/disko.nix @@ -0,0 +1,55 @@ +{ + disko.devices = { + disk = { + main = { + type = "disk"; + device = "/dev/nvme0n1"; + content = { + type = "gpt"; + partitions = { + ESP = { + priority = 1; + name = "ESP"; + start = "1M"; + end = "1G"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + root = { + size = "100%"; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; # Override existing partition + # Subvolumes must set a mountpoint in order to be mounted, + # unless their parent is mounted + subvolumes = { + # Subvolume name is different from mountpoint + "/rootfs" = { + mountpoint = "/"; + }; + # Subvolume name is the same as the mountpoint + "/home" = { + mountOptions = [ "compress=zstd" ]; + mountpoint = "/home"; + }; + # Parent is not mounted so the mountpoint must be set + "/nix" = { + mountOptions = [ + "compress=zstd" + "noatime" + ]; + mountpoint = "/nix"; + }; + }; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/hosts/wenar-nix/hardware-configuration.nix b/hosts/wenar-nix/hardware-configuration.nix new file mode 100644 index 0000000..101237f --- /dev/null +++ b/hosts/wenar-nix/hardware-configuration.nix @@ -0,0 +1,36 @@ +{ + config, + lib, + pkgs, + modulesPath, + ... +}: + +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "nvme" + "usbhid" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + # 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.enp5s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp0s20f0u5.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +}