Compare commits
6 commits
ca422e2643
...
2df96c6888
Author | SHA1 | Date | |
---|---|---|---|
2df96c6888 | |||
e30d7f3b10 | |||
0c58bb325f | |||
5e54a9be8a | |||
b2f62f7208 | |||
49b456a256 |
9 changed files with 84 additions and 65 deletions
|
@ -1,4 +1,4 @@
|
||||||
#cloud-config
|
#cloud-config
|
||||||
|
|
||||||
runcmd:
|
runcmd:
|
||||||
- curl https://git.cherrykitten.dev/sammy/nixos-infect/raw/branch/sammy/nixos-infect | PROVIDER=hetznercloud NIX_CHANNEL=nixos-23.05 bash 2>&1 | tee /tmp/infect.log
|
- curl https://git.cherrykitten.dev/sammy/nixos-infect/raw/branch/sammy/nixos-infect | PROVIDER=hetznercloud NIX_CHANNEL=nixos-24.05 bash 2>&1 | tee /tmp/infect.log
|
||||||
|
|
30
flake.lock
30
flake.lock
|
@ -8,11 +8,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1716374277,
|
"lastModified": 1716797840,
|
||||||
"narHash": "sha256-xfLyv/CtVwt/Qqklq0K5/gkc9iAaK2Fa7xaZCmFPx30=",
|
"narHash": "sha256-Xhc61kTl/hJ/UmLzkmZjGp1qkv7G0JqmqpIhpbLWQPg=",
|
||||||
"ref": "nix",
|
"ref": "nix",
|
||||||
"rev": "b85442d733f8a1b32c5e5728259a6fc1a70c6dc3",
|
"rev": "e89223d5af321e4298daf4f756d84231412f6f5f",
|
||||||
"revCount": 37,
|
"revCount": 38,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.cherrykitten.dev/sammy/cherrykitten.dev"
|
"url": "https://git.cherrykitten.dev/sammy/cherrykitten.dev"
|
||||||
},
|
},
|
||||||
|
@ -119,32 +119,32 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1715381426,
|
"lastModified": 1716736833,
|
||||||
"narHash": "sha256-wPuqrAQGdv3ISs74nJfGb+Yprm23U/rFpcHFFNWgM94=",
|
"narHash": "sha256-rNObca6dm7Qs524O4st8VJH6pZ/Xe1gxl+Rx6mcWYo0=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "ab5542e9dbd13d0100f8baae2bc2d68af901f4b4",
|
"rev": "a631666f5ec18271e86a5cde998cba68c33d9ac6",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"ref": "release-23.11",
|
"ref": "release-24.05",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1716218643,
|
"lastModified": 1717144377,
|
||||||
"narHash": "sha256-i/E7gzQybvcGAYDRGDl39WL6yVk30Je/NXypBz6/nmM=",
|
"narHash": "sha256-F/TKWETwB5RaR8owkPPi+SPJh83AQsm6KrQAlJ8v/uA=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "a8695cbd09a7ecf3376bd62c798b9864d20f86ee",
|
"rev": "805a384895c696f802a9bf5bf4720f37385df547",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"id": "nixpkgs",
|
"id": "nixpkgs",
|
||||||
"ref": "nixos-23.11",
|
"ref": "nixos-24.05",
|
||||||
"type": "indirect"
|
"type": "indirect"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -162,11 +162,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-unstable": {
|
"nixpkgs-unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1716312448,
|
"lastModified": 1717112898,
|
||||||
"narHash": "sha256-PH3w5av8d+TdwCkiWN4UPBTxrD9MpxIQPDVWctlomVo=",
|
"narHash": "sha256-7R2ZvOnvd9h8fDd65p0JnB7wXfUvreox3xFdYWd1BnY=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "e381a1288138aceda0ac63db32c7be545b446921",
|
"rev": "6132b0f6e344ce2fe34fc051b72fb46e34f668e0",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
18
flake.nix
18
flake.nix
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "nixpkgs/nixos-23.11";
|
nixpkgs.url = "nixpkgs/nixos-24.05";
|
||||||
nixpkgs-unstable.url = "nixpkgs/nixpkgs-unstable";
|
nixpkgs-unstable.url = "nixpkgs/nixpkgs-unstable";
|
||||||
|
|
||||||
colmena = {
|
colmena = {
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager/release-23.11";
|
url = "github:nix-community/home-manager/release-24.05";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -77,20 +77,6 @@
|
||||||
);
|
);
|
||||||
|
|
||||||
packages.x86_64-linux.iso = self.nixosConfigurations.iso.config.system.build.isoImage;
|
packages.x86_64-linux.iso = self.nixosConfigurations.iso.config.system.build.isoImage;
|
||||||
|
|
||||||
homeConfigurations =
|
|
||||||
let
|
|
||||||
pkgs = import nixpkgs { system = "x86_64-linux"; };
|
|
||||||
in
|
|
||||||
nixpkgs.lib.genAttrs (builtins.attrNames (builtins.readDir ./users)) (name: home-manager.lib.homeManagerConfiguration {
|
|
||||||
inherit pkgs;
|
|
||||||
modules = [ ./users/${name}/home.nix ];
|
|
||||||
extraSpecialArgs = {
|
|
||||||
inherit inputs;
|
|
||||||
flake = self;
|
|
||||||
pkgs-unstable = import nixpkgs-unstable { system = "x86_64-linux"; };
|
|
||||||
};
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
17
hive.nix
17
hive.nix
|
@ -30,23 +30,6 @@ in
|
||||||
inputs.home-manager.nixosModules.home-manager
|
inputs.home-manager.nixosModules.home-manager
|
||||||
] ++ builtins.attrValues self.nixosModules;
|
] ++ builtins.attrValues self.nixosModules;
|
||||||
|
|
||||||
options.cherrykitten = {
|
|
||||||
primaryIPv4 = lib.mkOption {
|
|
||||||
type = lib.types.nullOr lib.types.str;
|
|
||||||
default =
|
|
||||||
if (config.networking.interfaces ? eth0) then
|
|
||||||
(builtins.elemAt config.networking.interfaces.eth0.ipv4.addresses 0).address
|
|
||||||
else null;
|
|
||||||
};
|
|
||||||
primaryIPv6 = lib.mkOption {
|
|
||||||
type = lib.types.nullOr lib.types.str;
|
|
||||||
default =
|
|
||||||
if (config.networking.interfaces ? eth0) then
|
|
||||||
(builtins.elemAt config.networking.interfaces.eth0.ipv6.addresses 0).address
|
|
||||||
else null;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
networking.hostName = name;
|
networking.hostName = name;
|
||||||
networking.domain = "cherrykitten.xyz";
|
networking.domain = "cherrykitten.xyz";
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
[
|
||||||
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ];
|
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ];
|
||||||
|
@ -14,7 +15,8 @@
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
fileSystems."/" =
|
fileSystems."/" =
|
||||||
{ device = "/dev/disk/by-uuid/a3e601e7-7005-4513-8dff-748d9f384646";
|
{
|
||||||
|
device = "/dev/disk/by-uuid/a3e601e7-7005-4513-8dff-748d9f384646";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = [ "subvol=root" ];
|
options = [ "subvol=root" ];
|
||||||
};
|
};
|
||||||
|
@ -23,38 +25,42 @@
|
||||||
boot.initrd.luks.devices."swap".device = "/dev/disk/by-uuid/4bd4ac67-74a8-4a67-b5eb-e8ebf814d5d7";
|
boot.initrd.luks.devices."swap".device = "/dev/disk/by-uuid/4bd4ac67-74a8-4a67-b5eb-e8ebf814d5d7";
|
||||||
|
|
||||||
fileSystems."/home" =
|
fileSystems."/home" =
|
||||||
{ device = "/dev/disk/by-uuid/a3e601e7-7005-4513-8dff-748d9f384646";
|
{
|
||||||
|
device = "/dev/disk/by-uuid/a3e601e7-7005-4513-8dff-748d9f384646";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = [ "subvol=home" ];
|
options = [ "subvol=home" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/nix" =
|
fileSystems."/nix" =
|
||||||
{ device = "/dev/disk/by-uuid/a3e601e7-7005-4513-8dff-748d9f384646";
|
{
|
||||||
|
device = "/dev/disk/by-uuid/a3e601e7-7005-4513-8dff-748d9f384646";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = [ "subvol=nix" ];
|
options = [ "subvol=nix" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/persist" =
|
fileSystems."/persist" =
|
||||||
{ device = "/dev/disk/by-uuid/a3e601e7-7005-4513-8dff-748d9f384646";
|
{
|
||||||
|
device = "/dev/disk/by-uuid/a3e601e7-7005-4513-8dff-748d9f384646";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = [ "subvol=persist" ];
|
options = [ "subvol=persist" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/var/log" =
|
fileSystems."/var/log" =
|
||||||
{ device = "/dev/disk/by-uuid/a3e601e7-7005-4513-8dff-748d9f384646";
|
{
|
||||||
|
device = "/dev/disk/by-uuid/a3e601e7-7005-4513-8dff-748d9f384646";
|
||||||
fsType = "btrfs";
|
fsType = "btrfs";
|
||||||
options = [ "subvol=log" ];
|
options = [ "subvol=log" ];
|
||||||
neededForBoot = true;
|
neededForBoot = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/boot" =
|
fileSystems."/boot" =
|
||||||
{ device = "/dev/disk/by-uuid/6891-5A39";
|
{
|
||||||
|
device = "/dev/disk/by-uuid/6891-5A39";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
};
|
};
|
||||||
|
|
||||||
swapDevices =
|
swapDevices =
|
||||||
[ { device = "/dev/disk/by-uuid/65f4c4dd-57e7-4709-a017-2277874d3917"; }
|
[{ device = "/dev/disk/by-uuid/65f4c4dd-57e7-4709-a017-2277874d3917"; }];
|
||||||
];
|
|
||||||
|
|
||||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
# 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
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ lib, ... }: {
|
{ lib, config, ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
./gotosocial.nix
|
./gotosocial.nix
|
||||||
../../profiles/hcloud
|
../../profiles/hcloud
|
||||||
|
@ -6,6 +6,12 @@
|
||||||
];
|
];
|
||||||
fileSystems."/" = { device = "/dev/sda1"; fsType = "ext4"; };
|
fileSystems."/" = { device = "/dev/sda1"; fsType = "ext4"; };
|
||||||
cherrykitten.backups.enable = true;
|
cherrykitten.backups.enable = true;
|
||||||
|
cherrykitten.network = {
|
||||||
|
public_IPv4 = "128.140.109.125";
|
||||||
|
public_IPv6 = "2a01:4f8:c2c:bd32::1";
|
||||||
|
internal_IPv4 = "10.69.0.5";
|
||||||
|
internal_IPv6 = "fe80::9400:3ff:fe24:677a";
|
||||||
|
};
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
nameservers = [
|
nameservers = [
|
||||||
|
@ -21,16 +27,22 @@
|
||||||
interfaces = {
|
interfaces = {
|
||||||
eth0 = {
|
eth0 = {
|
||||||
ipv4.addresses = [
|
ipv4.addresses = [
|
||||||
{ address = "128.140.109.125"; prefixLength = 32; }
|
{ address = config.cherrykitten.network.public_IPv4; prefixLength = 32; }
|
||||||
];
|
];
|
||||||
ipv6.addresses = [
|
ipv6.addresses = [
|
||||||
{ address = "2a01:4f8:c2c:bd32::1"; prefixLength = 64; }
|
{ address = config.cherrykitten.network.public_IPv6; prefixLength = 64; }
|
||||||
{ address = "fe80::9400:3ff:fe24:677a"; prefixLength = 64; }
|
|
||||||
];
|
];
|
||||||
ipv4.routes = [{ address = "172.31.1.1"; prefixLength = 32; }];
|
ipv4.routes = [{ address = "172.31.1.1"; prefixLength = 32; }];
|
||||||
ipv6.routes = [{ address = "fe80::1"; prefixLength = 128; }];
|
ipv6.routes = [{ address = "fe80::1"; prefixLength = 128; }];
|
||||||
};
|
};
|
||||||
|
eth1 = {
|
||||||
|
ipv4.addresses = [
|
||||||
|
{ address = config.cherrykitten.network.internal_IPv4; prefixLength = 32; }
|
||||||
|
];
|
||||||
|
ipv6.addresses = [
|
||||||
|
{ address = config.cherrykitten.network.internal_IPv6; prefixLength = 64; }
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
services.udev.extraRules = ''
|
services.udev.extraRules = ''
|
||||||
|
|
6
justfile
6
justfile
|
@ -9,6 +9,12 @@ apply:
|
||||||
build-vm host="bengal":
|
build-vm host="bengal":
|
||||||
nixos-rebuild build-vm --flake .#{{host}}
|
nixos-rebuild build-vm --flake .#{{host}}
|
||||||
|
|
||||||
|
create-new-hcloud-host name="" type="cx11" location="nbg1":
|
||||||
|
hcloud server create --name '{{name}}' --type 'cx11' --image debian-11 --user-data-from-file files/cloud-init.yml --location nbg1 --ssh-key openpgp:0x6068FEBB --network cherrykitten-internal
|
||||||
|
|
||||||
|
delete-hcloud-host name="":
|
||||||
|
hcloud server delete '{{name}}'
|
||||||
|
|
||||||
git:
|
git:
|
||||||
nix fmt
|
nix fmt
|
||||||
git add .
|
git add .
|
||||||
|
|
26
modules/nixos/cherrykitten/default.nix
Normal file
26
modules/nixos/cherrykitten/default.nix
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.cherrykitten;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.cherrykitten = {
|
||||||
|
network = {
|
||||||
|
public_IPv4 = lib.mkOption {
|
||||||
|
type = lib.types.nullOr lib.types.str;
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
public_IPv6 = lib.mkOption {
|
||||||
|
type = lib.types.nullOr lib.types.str;
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
internal_IPv4 = lib.mkOption {
|
||||||
|
type = lib.types.nullOr lib.types.str;
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
internal_IPv6 = lib.mkOption {
|
||||||
|
type = lib.types.nullOr lib.types.str;
|
||||||
|
default = null;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue