commit e1276b0ceafbdd79ca26ac67d858d8bc5d0af421 Author: freek Date: Thu Oct 8 19:54:18 2026 +0200 initial nixos install diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..f9145ec --- /dev/null +++ b/configuration.nix @@ -0,0 +1,28 @@ +{ modulesPath, ... }: { + imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; + + boot.loader.grub = { + efiSupport = true; + efiInstallAsRemovable = true; + }; + + networking.hostName = "myserver"; + networking.useDHCP = true; + + services.openssh = { + enable = true; + settings.PasswordAuthentication = false; + }; + + users.users.root.openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPmPNXFUH+yVRbsvgl+51x6UkJfR2eQB9GTKlWKFg3dP freek@MacBookPro.localdomain" + ]; + + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + nix.gc = { + automatic = true; + options = "--delete-older-than 14d"; + }; + + system.stateVersion = "25.11"; +} diff --git a/disk.nix b/disk.nix new file mode 100644 index 0000000..058a8a2 --- /dev/null +++ b/disk.nix @@ -0,0 +1,29 @@ +{ + disko.devices.disk.main = { + device = "/dev/sda"; + type = "disk"; + content = { + type = "gpt"; + partitions = { + boot = { size = "1M"; type = "EF02"; }; + ESP = { + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + root = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + }; + }; + }; +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..2804477 --- /dev/null +++ b/flake.nix @@ -0,0 +1,18 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; + disko.url = "github:nix-community/disko"; + disko.inputs.nixpkgs.follows = "nixpkgs"; + }; + + outputs = { nixpkgs, disko, ... }: { + nixosConfigurations.myserver = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + disko.nixosModules.disko + ./disk.nix + ./configuration.nix + ]; + }; + }; +}