diff options
| -rw-r--r-- | flake.lock | 82 | ||||
| -rw-r--r-- | flake.nix | 46 | ||||
| -rw-r--r-- | srv/h-alpha/configuration.nix | 35 | ||||
| -rw-r--r-- | srv/h-alpha/disko-config.nix | 37 | ||||
| -rw-r--r-- | srv/h-alpha/hardware-configuration.nix | 27 |
5 files changed, 227 insertions, 0 deletions
diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..4d9334a --- /dev/null +++ b/flake.lock @@ -0,0 +1,82 @@ +{ + "nodes": { + "disko": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1734011192, + "narHash": "sha256-NghuiWXx6Q3gwLiudiNwDpYQ1CPEUK7J+f9dWREN8KA=", + "owner": "nix-community", + "repo": "disko", + "rev": "0f31ad735e784315a22d9899d3ba24340ce64220", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "disko", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1733808091, + "narHash": "sha256-KWwINTQelKOoQgrXftxoqxmKFZb9pLVfnRvK270nkVk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a0f3e10d94359665dba45b71b4227b0aeb851f8e", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "disko": "disko", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..b6f8e92 --- /dev/null +++ b/flake.nix @@ -0,0 +1,46 @@ +{ + inputs = { + nixpkgs = { + url = "github:NixOS/nixpkgs/nixos-24.11"; + }; + flake-utils = { + url = "github:numtide/flake-utils"; + }; + disko = { + url = "github:nix-community/disko"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + outputs = + inputs@{ + self, + nixpkgs, + flake-utils, + ... + }: + let + osConfig = { + nixosConfigurations = { + alpha-site = nixpkgs.lib.nixosSystem { + system = "aarch64-linux"; + modules = [ + ./srv/h-alpha/configuration.nix + inputs.disko.nixosModules.disko + ]; + }; + }; + }; + metaConfig = flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = import nixpkgs { + inherit system; + }; + in + { + formatter = pkgs.nixfmt-rfc-style; + } + ); + in + (metaConfig // osConfig); +} diff --git a/srv/h-alpha/configuration.nix b/srv/h-alpha/configuration.nix new file mode 100644 index 0000000..4f9eb44 --- /dev/null +++ b/srv/h-alpha/configuration.nix @@ -0,0 +1,35 @@ +{ + config, + lib, + pkgs, + ... +}: +{ + imports = [ + ./hardware-configuration.nix + ./disko-config.nix + ]; + boot.loader.systemd-boot.enable = true; + # boot.loader.grub.device = "/dev/sda"; + + users.users.nea = { + isNormalUser = true; + extraGroups = [ "wheel" ]; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINg2WYMRKINwbH5UCqqK2qq/qW0gG1NnaALHqEyU4NzM" + ]; + }; + + security.sudo.wheelNeedsPassword = false; + nix.settings.trusted-users = [ "@wheel" ]; + services.openssh = { + enable = true; + settings = { + PermitRootLogin = "no"; + PasswordAuthentication = false; + KbdInteractiveAuthentication = false; + }; + }; + + system.stateVersion = "24.11"; +} diff --git a/srv/h-alpha/disko-config.nix b/srv/h-alpha/disko-config.nix new file mode 100644 index 0000000..d439fcc --- /dev/null +++ b/srv/h-alpha/disko-config.nix @@ -0,0 +1,37 @@ +{ + disko.devices = { + disk = { + main = { + type = "disk"; + device = "/dev/sda"; + content = { + type = "gpt"; + partitions = { + boot = { + size = "1M"; + type = "EF02"; + priority = 1; + }; + ESP = { + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + root = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/srv/h-alpha/hardware-configuration.nix b/srv/h-alpha/hardware-configuration.nix new file mode 100644 index 0000000..1003394 --- /dev/null +++ b/srv/h-alpha/hardware-configuration.nix @@ -0,0 +1,27 @@ +{ + config, + lib, + pkgs, + modulesPath, + ... +}: + +{ + imports = [ (modulesPath + "/profiles/qemu-guest.nix") ]; + boot.initrd.availableKernelModules = [ + "ahci" + "xhci_pci" + "virtio_pci" + "virtio_scsi" + "sd_mod" + "sr_mod" + "virtio_gpu" + "ext4" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + swapDevices = [ ]; + networking.useDHCP = lib.mkDefault true; + nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; +} |
