Compare commits

...

2 commits

Author SHA1 Message Date
1e29882c46 resolve incus merge conflict 2024-09-01 16:43:08 -05:00
81847253a0 add incus 2024-09-01 16:41:26 -05:00
7 changed files with 128 additions and 32 deletions

View file

@ -83,10 +83,12 @@
ghostty = { ghostty = {
url = "git+ssh://git@github.com/ghostty-org/ghostty"; url = "git+ssh://git@github.com/ghostty-org/ghostty";
}; };
vscode-server.url = "github:nix-community/nixos-vscode-server";
}; };
outputs = outputs =
{ self, nixpkgs, sops-nix, home-manager, nix-vscode-extensions, impermanence, disko, talhelper, lix-module, ghostty, ... } @ inputs: { self, nixpkgs, sops-nix, home-manager, nix-vscode-extensions, impermanence, disko, talhelper, lix-module, ghostty, vscode-server, ... } @ inputs:
let let
forAllSystems = nixpkgs.lib.genAttrs [ forAllSystems = nixpkgs.lib.genAttrs [
"aarch64-linux" "aarch64-linux"
@ -251,6 +253,8 @@
./nixos/profiles/hw-supermicro.nix ./nixos/profiles/hw-supermicro.nix
]; ];
profileModules = [ profileModules = [
vscode-server.nixosModules.default
./nixos/profiles/role-dev.nix
./nixos/profiles/role-server.nix ./nixos/profiles/role-server.nix
{ home-manager.users.jahanson = ./nixos/home/jahanson/server.nix; } { home-manager.users.jahanson = ./nixos/home/jahanson/server.nix; }
]; ];

View file

@ -1,4 +1,4 @@
{ pkgs, config, ... }: { pkgs, config, inputs, ... }:
with config; with config;
{ {
imports = [ imports = [
@ -40,6 +40,7 @@ with config;
unstable.peazip unstable.peazip
unstable.telegram-desktop unstable.telegram-desktop
unstable.tidal-hifi unstable.tidal-hifi
inputs.ghostty.packages.${pkgs.system}.default
vlc vlc
# cli # cli

View file

@ -31,6 +31,30 @@ in
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBROTzSefJGJeCNUgNLbE5l4sHHg2fHUO4sCwqvP+zAd root@Gollum" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBROTzSefJGJeCNUgNLbE5l4sHHg2fHUO4sCwqvP+zAd root@Gollum"
]; ];
# VSCode Compatibility Settings
programs.nix-ld.enable = true;
services.vscode-server = {
enable = true;
};
# Home Manager
home-manager.users.jahanson = {
# Git settings
# TODO: Move to config module.
programs.git = {
enable = true;
userName = "Joseph Hanson";
userEmail = "joe@veri.dev";
extraConfig = {
core.autocrlf = "input";
init.defaultBranch = "main";
pull.rebase = true;
rebase.autoStash = true;
};
};
};
# Network settings # Network settings
networking = { networking = {
hostName = "gandalf"; hostName = "gandalf";
@ -45,11 +69,11 @@ in
}; };
# For VMs # For VMs
bridges = { # bridges = {
"br0" = { # "br0" = {
interfaces = [ "enp130s0f1" ]; # interfaces = [ "enp130s0f1" ];
}; # };
}; # };
}; };
swapDevices = [ ]; swapDevices = [ ];
@ -82,6 +106,10 @@ in
purpose = "Production"; purpose = "Production";
system = { system = {
motd.networkInterfaces = [ "enp130s0f0" "enp130s0f1" ]; motd.networkInterfaces = [ "enp130s0f0" "enp130s0f1" ];
# Incus
incus = {
enable = true;
};
# ZFS # ZFS
zfs.enable = true; zfs.enable = true;
zfs.mountPoolsAtBoot = [ "eru" ]; zfs.mountPoolsAtBoot = [ "eru" ];

View file

@ -14,9 +14,14 @@ in
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
networking.firewall.interfaces.podman0 = { networking.firewall.interfaces = {
allowedTCPPorts = [ 8080 8443 8880 8843 ]; enp130s0f0 = {
allowedUDPPorts = [ 3478 ]; allowedTCPPorts = [ 8443 ];
};
podman0 = {
allowedTCPPorts = [ 8080 8443 8880 8843 ];
allowedUDPPorts = [ 3478 ];
};
}; };
virtualisation.oci-containers.containers.${app} = { virtualisation.oci-containers.containers.${app} = {
image = "ghcr.io/goofball222/unifi:${version}"; image = "ghcr.io/goofball222/unifi:${version}";

View file

@ -3,6 +3,7 @@
./borg ./borg
./fingerprint-laptop-lid.nix ./fingerprint-laptop-lid.nix
./impermanence.nix ./impermanence.nix
./incus
./motd ./motd
./nfs ./nfs
./nix.nix ./nix.nix

View file

@ -1,31 +1,89 @@
{ config, pkgs, ... }: { config, pkgs, lib, ... }:
let
cfg = config.mySystem.system.incus;
user = "jahanson";
in
{ {
sops.secrets.secret-domain-0 = { # sops.secrets.secret-domain-0 = {
sopsFile = ./secret.sops.yaml; # sopsFile = ./secret.sops.yaml;
# };
options.mySystem.system.incus = {
enable = lib.mkEnableOption "incus";
}; };
users.users.jahanson.extraGroups = [ "incus-admin" ]; config = lib.mkIf cfg.enable {
virtualisation.incus = { virtualisation.incus = {
enable = true; enable = true;
ui.enable = true; ui.enable = true;
};
preseed = {
config = {
"core.https_address" = "10.1.1.15:8445"; # Need quotes around key
};
networks = [
{
config = {
"ipv4.address" = "auto"; # Need quotes around key
"ipv6.address" = "auto"; # Need quotes around key
};
description = "";
name = "incusbr0";
type = "";
project = "default";
}
];
storage_pools = [
{
config = {
source = "eru/incus";
};
description = "";
name = "default";
driver = "zfs";
}
];
profiles = [
{
config = { };
description = "";
devices = {
eth0 = {
name = "eth0";
network = "incusbr0";
type = "nic";
};
root = {
path = "/";
pool = "default";
type = "disk";
};
};
name = "default";
}
];
projects = [ ];
cluster = null;
};
};
# systemd.services.incus-preseed.postStart = "${oidcSetup}"; users.users.${user}.extraGroups = [ "incus-admin" ];
networking = { # systemd.services.incus-preseed.postStart = "${oidcSetup}";
nftables.enable = true;
firewall = { networking = {
allowedTCPPorts = [ nftables.enable = true;
8443 firewall = {
53 allowedTCPPorts = [
67 8445
]; 53
allowedUDPPorts = [ 67
53 ];
67 allowedUDPPorts = [
]; 53
67
];
};
}; };
}; };
} }

View file

@ -24,7 +24,6 @@ with config;
# bind # for dns utils like named-checkconf # bind # for dns utils like named-checkconf
inputs.nix-inspect.packages.${pkgs.system}.default inputs.nix-inspect.packages.${pkgs.system}.default
inputs.talhelper.packages.${pkgs.system}.default inputs.talhelper.packages.${pkgs.system}.default
inputs.ghostty.packages.${pkgs.system}.default
]; ];
programs.direnv = { programs.direnv = {