From 1be09af058424219de2aad4b9cc27ccf760d23f6 Mon Sep 17 00:00:00 2001 From: adikro Date: Sun, 1 Mar 2026 19:57:16 +0100 Subject: ... --- hosts/oci/configuration.nix | 85 +++++++++++++++++++++++++++++++++++++++++++++ hosts/oci/disko.nix | 77 ++++++++++++++++++++++++++++++++++++++++ hosts/oci/home.nix | 21 +++++++++++ 3 files changed, 183 insertions(+) create mode 100644 hosts/oci/configuration.nix create mode 100644 hosts/oci/disko.nix create mode 100644 hosts/oci/home.nix (limited to 'hosts/oci') diff --git a/hosts/oci/configuration.nix b/hosts/oci/configuration.nix new file mode 100644 index 0000000..e3e4840 --- /dev/null +++ b/hosts/oci/configuration.nix @@ -0,0 +1,85 @@ +{ + inputs, + username, + ... +}: +{ + system.stateVersion = "25.05"; + + imports = [ + inputs.disko.nixosModules.disko + # ./disko.nix + + ../../os/default.nix + ]; + # hardware.facter.reportPath = /etc/nixos/hosts/oci/facter.json; + + # networking = { + # hostName = "oci"; + # defaultGateway = "10.0.0.1"; + # nameservers = [ "9.9.9.9" ]; + # interfaces.eth0 = { + # ipv4.addresses = [ + # { + # address = "10.0.0.90"; + # prefixLength = 24; + # } + # ]; + # useDHCP = true; + # }; + # firewall = { + # logRefusedConnections = false; + # rejectPackets = true; + # }; + # }; + + boot.loader = { + # efi.canTouchEfiVariables = true; + systemd-boot.enable = true; + }; + + services.cloud-init = { + enable = true; + network.enable = true; + }; + + os = { + core = { + # allowUnfree.enable = true; + + bootloader.type = "none"; + bootloader.efi = false; + drivers = { + enable = true; + kernel = "stable"; + }; + fonts.enable = true; + home-manager = { + enable = true; + users.${username}.path = ./home.nix; + }; + locale.enable = true; + memory = { + zram.enable = true; + swapfile = { + enable = true; + size = 16; + }; + }; + network.enable = true; + security.enable = true; + ssh.enable = true; + storage.enable = true; + users.enable = true; + }; + srv = { + sops.enable = true; + files.enable = true; + nix-helper.enable = true; + }; + }; + boot.kernelParams = [ + "console=ttyS0" + "net.ifnames=0" + ]; +} diff --git a/hosts/oci/disko.nix b/hosts/oci/disko.nix new file mode 100644 index 0000000..fb01384 --- /dev/null +++ b/hosts/oci/disko.nix @@ -0,0 +1,77 @@ +{ lib, ... }: +{ + disko.devices.disk.main = { + device = "/dev/sda"; + type = "disk"; + content = { + type = "gpt"; + partitions = { + ESP = { + size = "1G"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "umask=0077" ]; + }; + }; + root = { + size = "100%"; + content = { + type = lib.mkForce "btrfs"; + extraArgs = [ "-f" ]; + subvolumes = { + "root" = { + mountpoint = lib.mkForce "/"; + mountOptions = [ + "compress=zstd:1" + "discard=async" + "noatime" + ]; + }; + "nix" = { + mountpoint = "/nix"; + mountOptions = [ + "compress=zstd:1" + "discard=async" + "nodev" + "noatime" + ]; + }; + "home" = { + mountpoint = "/home"; + mountOptions = [ + "compress=zstd:1" + "discard=async" + "nosuid" + "nodev" + "noatime" + ]; + }; + "log" = { + mountpoint = "/var/log"; + mountOptions = [ + "compress=zstd:1" + "discard=async" + "nosuid" + "nodev" + "noatime" + ]; + }; + "swap" = { + mountpoint = "/.swapvol"; + mountOptions = [ + "compress=none" + "discard=async" + "nodatacow" + "noatime" + ]; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/hosts/oci/home.nix b/hosts/oci/home.nix new file mode 100644 index 0000000..3ffc2ee --- /dev/null +++ b/hosts/oci/home.nix @@ -0,0 +1,21 @@ +{ username, ... }: +{ + imports = [ ../../hm/default.nix ]; + + home = { + username = "${username}"; + homeDirectory = "/home/${username}"; + stateVersion = "25.05"; + }; + + hm = { + conf.git.enable = true; + editors.nixvim.enable = true; + shell = { + cli.enable = true; + fish.enable = true; + foot.enable = true; + starship.enable = true; + }; + }; +} -- cgit v1.3