Compare commits

...

6 commits

Author SHA1 Message Date
2df96c6888
nix fmt 2024-06-01 20:12:20 +02:00
e30d7f3b10
new hcloud commands in justfile 2024-06-01 20:11:52 +02:00
0c58bb325f
i don't use standalone home-manager anymore, so bye bye it goes 2024-06-01 20:03:44 +02:00
5e54a9be8a
update to NixOS 24.05 :3 2024-06-01 20:02:21 +02:00
b2f62f7208
update networking foo a bit 2024-06-01 15:19:39 +02:00
49b456a256
flake.lock: Update
Flake lock file updates:

• Updated input 'cherrykitten-website':
    'git+https://git.cherrykitten.dev/sammy/cherrykitten.dev?ref=nix&rev=b85442d733f8a1b32c5e5728259a6fc1a70c6dc3' (2024-05-22)
  → 'git+https://git.cherrykitten.dev/sammy/cherrykitten.dev?ref=nix&rev=e89223d5af321e4298daf4f756d84231412f6f5f' (2024-05-27)
• Updated input 'home-manager':
    'github:nix-community/home-manager/ab5542e9dbd13d0100f8baae2bc2d68af901f4b4' (2024-05-10)
  → 'github:nix-community/home-manager/2c78a57c544dd19b07442350727ced097e1aa6e6' (2024-05-26)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/a8695cbd09a7ecf3376bd62c798b9864d20f86ee' (2024-05-20)
  → 'github:NixOS/nixpkgs/9d29cd266cebf80234c98dd0b87256b6be0af44e' (2024-05-25)
• Updated input 'nixpkgs-unstable':
    'github:NixOS/nixpkgs/e381a1288138aceda0ac63db32c7be545b446921' (2024-05-21)
  → 'github:NixOS/nixpkgs/e2dd4e18cc1c7314e24154331bae07df76eb582f' (2024-05-26)
2024-05-27 10:20:21 +02:00
9 changed files with 84 additions and 65 deletions

View file

@ -1,4 +1,4 @@
#cloud-config
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

View file

@ -8,11 +8,11 @@
]
},
"locked": {
"lastModified": 1716374277,
"narHash": "sha256-xfLyv/CtVwt/Qqklq0K5/gkc9iAaK2Fa7xaZCmFPx30=",
"lastModified": 1716797840,
"narHash": "sha256-Xhc61kTl/hJ/UmLzkmZjGp1qkv7G0JqmqpIhpbLWQPg=",
"ref": "nix",
"rev": "b85442d733f8a1b32c5e5728259a6fc1a70c6dc3",
"revCount": 37,
"rev": "e89223d5af321e4298daf4f756d84231412f6f5f",
"revCount": 38,
"type": "git",
"url": "https://git.cherrykitten.dev/sammy/cherrykitten.dev"
},
@ -119,32 +119,32 @@
]
},
"locked": {
"lastModified": 1715381426,
"narHash": "sha256-wPuqrAQGdv3ISs74nJfGb+Yprm23U/rFpcHFFNWgM94=",
"lastModified": 1716736833,
"narHash": "sha256-rNObca6dm7Qs524O4st8VJH6pZ/Xe1gxl+Rx6mcWYo0=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "ab5542e9dbd13d0100f8baae2bc2d68af901f4b4",
"rev": "a631666f5ec18271e86a5cde998cba68c33d9ac6",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-23.11",
"ref": "release-24.05",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1716218643,
"narHash": "sha256-i/E7gzQybvcGAYDRGDl39WL6yVk30Je/NXypBz6/nmM=",
"lastModified": 1717144377,
"narHash": "sha256-F/TKWETwB5RaR8owkPPi+SPJh83AQsm6KrQAlJ8v/uA=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a8695cbd09a7ecf3376bd62c798b9864d20f86ee",
"rev": "805a384895c696f802a9bf5bf4720f37385df547",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-23.11",
"ref": "nixos-24.05",
"type": "indirect"
}
},
@ -162,11 +162,11 @@
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1716312448,
"narHash": "sha256-PH3w5av8d+TdwCkiWN4UPBTxrD9MpxIQPDVWctlomVo=",
"lastModified": 1717112898,
"narHash": "sha256-7R2ZvOnvd9h8fDd65p0JnB7wXfUvreox3xFdYWd1BnY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e381a1288138aceda0ac63db32c7be545b446921",
"rev": "6132b0f6e344ce2fe34fc051b72fb46e34f668e0",
"type": "github"
},
"original": {

View file

@ -1,6 +1,6 @@
{
inputs = {
nixpkgs.url = "nixpkgs/nixos-23.11";
nixpkgs.url = "nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "nixpkgs/nixpkgs-unstable";
colmena = {
@ -9,7 +9,7 @@
};
home-manager = {
url = "github:nix-community/home-manager/release-23.11";
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
@ -77,20 +77,6 @@
);
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"; };
};
});
};
};
}

View file

@ -30,29 +30,12 @@ in
inputs.home-manager.nixosModules.home-manager
] ++ 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 = {
networking.hostName = name;
networking.domain = "cherrykitten.xyz";
deployment = {
allowLocalDeployment = true;
allowLocalDeployment = true;
targetUser = lib.mkDefault "sammy";
tags = [ pkgs.stdenv.hostPlatform.system ];
};

View file

@ -5,7 +5,8 @@
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
[
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ];
@ -14,7 +15,8 @@
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/a3e601e7-7005-4513-8dff-748d9f384646";
{
device = "/dev/disk/by-uuid/a3e601e7-7005-4513-8dff-748d9f384646";
fsType = "btrfs";
options = [ "subvol=root" ];
};
@ -23,38 +25,42 @@
boot.initrd.luks.devices."swap".device = "/dev/disk/by-uuid/4bd4ac67-74a8-4a67-b5eb-e8ebf814d5d7";
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/a3e601e7-7005-4513-8dff-748d9f384646";
{
device = "/dev/disk/by-uuid/a3e601e7-7005-4513-8dff-748d9f384646";
fsType = "btrfs";
options = [ "subvol=home" ];
};
fileSystems."/nix" =
{ device = "/dev/disk/by-uuid/a3e601e7-7005-4513-8dff-748d9f384646";
{
device = "/dev/disk/by-uuid/a3e601e7-7005-4513-8dff-748d9f384646";
fsType = "btrfs";
options = [ "subvol=nix" ];
};
fileSystems."/persist" =
{ device = "/dev/disk/by-uuid/a3e601e7-7005-4513-8dff-748d9f384646";
{
device = "/dev/disk/by-uuid/a3e601e7-7005-4513-8dff-748d9f384646";
fsType = "btrfs";
options = [ "subvol=persist" ];
};
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";
options = [ "subvol=log" ];
neededForBoot = true;
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/6891-5A39";
{
device = "/dev/disk/by-uuid/6891-5A39";
fsType = "vfat";
};
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
# (the default) this is the recommended approach. When using systemd-networkd it's

View file

@ -1,4 +1,4 @@
{ lib, ... }: {
{ lib, config, ... }: {
imports = [
./gotosocial.nix
../../profiles/hcloud
@ -6,6 +6,12 @@
];
fileSystems."/" = { device = "/dev/sda1"; fsType = "ext4"; };
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 = {
nameservers = [
@ -21,16 +27,22 @@
interfaces = {
eth0 = {
ipv4.addresses = [
{ address = "128.140.109.125"; prefixLength = 32; }
{ address = config.cherrykitten.network.public_IPv4; prefixLength = 32; }
];
ipv6.addresses = [
{ address = "2a01:4f8:c2c:bd32::1"; prefixLength = 64; }
{ address = "fe80::9400:3ff:fe24:677a"; prefixLength = 64; }
{ address = config.cherrykitten.network.public_IPv6; prefixLength = 64; }
];
ipv4.routes = [{ address = "172.31.1.1"; prefixLength = 32; }];
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 = ''

View file

@ -9,6 +9,12 @@ apply:
build-vm host="bengal":
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:
nix fmt
git add .

View 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;
};
};
};
}

View file

@ -2,6 +2,6 @@
{
nixpkgs.overlays = [
(import ./gotosocial.nix)
(import ./gotosocial.nix)
];
}