summaryrefslogtreecommitdiff
path: root/hosts/oci
diff options
context:
space:
mode:
authoradikro <adikro@disroot.org>2026-03-01 19:57:16 +0100
committeradikro <adikro@disroot.org>2026-03-01 19:57:16 +0100
commit1be09af058424219de2aad4b9cc27ccf760d23f6 (patch)
treebdc1177b166e1eef36763984b6862d7755a7bde8 /hosts/oci
parent4b41ce640c5eddcb50904331e03aac5460caa144 (diff)
...
Diffstat (limited to 'hosts/oci')
-rw-r--r--hosts/oci/configuration.nix85
-rw-r--r--hosts/oci/disko.nix77
-rw-r--r--hosts/oci/home.nix21
3 files changed, 183 insertions, 0 deletions
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;
+ };
+ };
+}