Skip to content

Commit

Permalink
hosts/abrechnung: init
Browse files Browse the repository at this point in the history
* flake: add disko
* users: add leona
  • Loading branch information
leona-ya authored and xanderio committed Apr 1, 2024
1 parent f8483a2 commit cab2237
Show file tree
Hide file tree
Showing 7 changed files with 120 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
result*
.env
.direnv
21 changes: 21 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
colmena.inputs."nixpkgs".follows = "nixpkgs";
sops-nix.url = "github:Mic92/sops-nix";
sops-nix.inputs."nixpkgs".follows = "nixpkgs";
disko.url = "github:nix-community/disko";
disko.inputs."nixpkgs".follows = "nixpkgs";
};

outputs = inputs@{ flake-parts, ... }: flake-parts.lib.mkFlake { inherit inputs; } {
Expand Down
35 changes: 35 additions & 0 deletions hosts/abrechnung/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{ inputs, pkgs, ... }: {

imports = [
./disko.nix
./hardware-configuration.nix
inputs.disko.nixosModules.disko
];

entropia.users = [ "leona" ];

networking.hostName = "abrechnung";
networking.domain = "entropia.de";
deployment.targetHost = "abrechnung.entropia.de";

boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
system.stateVersion = "24.05";

networking.useNetworkd = true;
systemd.network.wait-online.anyInterface = true;
systemd.network.networks."10-eth" = {
enable = true;
name = "en*";
dns = [ "1.1.1.1" ];
address = [
"45.140.180.56/27"
"2a0e:c5c0:0:201::15/64"
];
routes = [
{ routeConfig = { Destination = "0.0.0.0/0"; Gateway = "45.140.180.33"; }; }
{ routeConfig = { Destination = "::/0"; Gateway = "2a0e:c5c0:0:201::"; }; }
];
};
services.resolved.enable = true;
}
36 changes: 36 additions & 0 deletions hosts/abrechnung/disko.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
disko.devices = {
disk = {
main = {
type = "disk";
device = "/dev/vda";
content = {
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02"; # for grub MBR
};
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "xfs";
mountpoint = "/";
};
};
};
};
};
};
};
}
18 changes: 18 additions & 0 deletions hosts/abrechnung/hardware-configuration.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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 = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];


nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}
7 changes: 7 additions & 0 deletions users/leona/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
isNormalUser = true;
extraGroups = [ "wheel" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOkvy9P1Qweq1kykgn3IWIBWe/v/dTNAx+hd9i2aKe1O openpgp:0xCACA6CB6"
];
}

0 comments on commit cab2237

Please sign in to comment.