From dc2e7bf1aa6e8cc1af04589a7fad3e6f0806e77d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Jane=C5=BEi=C4=8D?= Date: Fri, 27 Mar 2026 23:11:27 +0100 Subject: [PATCH 1/4] feat: add disko input --- flake.lock | 21 +++++++++++++++++++++ flake.nix | 5 +++++ 2 files changed, 26 insertions(+) diff --git a/flake.lock b/flake.lock index 60ad441..f1d18d6 100644 --- a/flake.lock +++ b/flake.lock @@ -99,6 +99,26 @@ "type": "github" } }, + "disko": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1773889306, + "narHash": "sha256-PAqwnsBSI9SVC2QugvQ3xeYCB0otOwCacB1ueQj2tgw=", + "owner": "nix-community", + "repo": "disko", + "rev": "5ad85c82cc52264f4beddc934ba57f3789f28347", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "disko", + "type": "github" + } + }, "firefox-gnome-theme": { "flake": false, "locked": { @@ -491,6 +511,7 @@ "root": { "inputs": { "assets": "assets", + "disko": "disko", "flake-parts": "flake-parts", "home-manager": "home-manager", "lanzaboote": "lanzaboote", diff --git a/flake.nix b/flake.nix index d24df88..27fa128 100644 --- a/flake.nix +++ b/flake.nix @@ -37,6 +37,11 @@ neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay"; + disko = { + url = "github:nix-community/disko"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; outputs = From 99fea4e9db164e0742d93f53e02904a67b7bbf42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Jane=C5=BEi=C4=8D?= Date: Sat, 28 Mar 2026 00:49:37 +0100 Subject: [PATCH 2/4] feat: prepare initial floo host --- flake/hosts.nix | 12 ++++++++++++ hosts/floo/configuration.nix | 37 ++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 hosts/floo/configuration.nix diff --git a/flake/hosts.nix b/flake/hosts.nix index e50556d..aca1f2d 100644 --- a/flake/hosts.nix +++ b/flake/hosts.nix @@ -73,6 +73,18 @@ in ]; }; + # nix run github:nix-community/nixos-anywhere -- --flake .#floo root@ + floo = mkHost "floo" { + system = "x86_64-linux"; + user = "matej"; + features = [ + "openssh" + "localisation" + "shell" + "tailscale" + ]; + }; + ephvm = mkHost "ephvm" { system = "x86_64-linux"; user = "matej"; diff --git a/hosts/floo/configuration.nix b/hosts/floo/configuration.nix new file mode 100644 index 0000000..e40f8d1 --- /dev/null +++ b/hosts/floo/configuration.nix @@ -0,0 +1,37 @@ +{ inputs, ... }: +{ + imports = [ inputs.disko.nixosModules.disko ]; + + boot.loader.grub.enable = true; + + disko.devices.disk.main = { + type = "disk"; + device = "/dev/sda"; + content = { + type = "gpt"; + partitions = { + boot = { + size = "1M"; + type = "EF02"; + }; + root = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + }; + }; + }; + + users.users.matej.hashedPassword = "$6$59Z5NIkOYZ3eSElX$FehMGGXQlC040G8eoO42JQDScb7hI04NbdVMAkKYKqVOLTO/.MJxfk8fHypQHrCdtAs67N1bnU2s5H/3zLWhC1"; + + localisation = { + timeZone = "Europe/Ljubljana"; + defaultLocale = "en_US.UTF-8"; + }; + + system.stateVersion = "25.11"; +} From 21a757232d8bbb0c358abb0d9fde75710a3ef18c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Jane=C5=BEi=C4=8D?= Date: Sat, 28 Mar 2026 00:49:57 +0100 Subject: [PATCH 3/4] feat: add provision and deploy just recipes --- justfile | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/justfile b/justfile index dc533a1..1ccc3fd 100644 --- a/justfile +++ b/justfile @@ -41,6 +41,14 @@ ephvm *ARGS: ephvm-ssh port="2222": ssh -p {{port}} -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null matej@localhost +# provision a host with nixos-anywhere +provision host ip: + nix run github:nix-community/nixos-anywhere -- --flake .#{{host}} --generate-hardware-config nixos-generate-config ./hosts/{{host}}/hardware-configuration.nix root@{{ip}} + +# deploy config to a remote host +deploy host remote=host: + nixos-rebuild switch --flake .#{{host}} --target-host {{remote}} --sudo --ask-sudo-password + # garbage collect old generations clean: sudo nix-collect-garbage $(nix eval --raw -f ./nix.nix nix.gc.options) From 16eb3dcf001fba3d69f571d16cfbb3e0b77ce22c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Jane=C5=BEi=C4=8D?= Date: Sat, 28 Mar 2026 00:50:24 +0100 Subject: [PATCH 4/4] feat: add floo hardware configuration --- hosts/floo/hardware-configuration.nix | 37 +++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 hosts/floo/hardware-configuration.nix diff --git a/hosts/floo/hardware-configuration.nix b/hosts/floo/hardware-configuration.nix new file mode 100644 index 0000000..39900cf --- /dev/null +++ b/hosts/floo/hardware-configuration.nix @@ -0,0 +1,37 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ + config, + lib, + pkgs, + modulesPath, + ... +}: + +{ + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = [ + "ahci" + "xhci_pci" + "virtio_pci" + "virtio_scsi" + "sd_mod" + "sr_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + 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.enp1s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +}