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 = {
url = "git+ssh://git@github.com/ghostty-org/ghostty";
};
vscode-server.url = "github:nix-community/nixos-vscode-server";
};
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
forAllSystems = nixpkgs.lib.genAttrs [
"aarch64-linux"
@ -251,6 +253,8 @@
./nixos/profiles/hw-supermicro.nix
];
profileModules = [
vscode-server.nixosModules.default
./nixos/profiles/role-dev.nix
./nixos/profiles/role-server.nix
{ home-manager.users.jahanson = ./nixos/home/jahanson/server.nix; }
];

View file

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

View file

@ -31,6 +31,30 @@ in
"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
networking = {
hostName = "gandalf";
@ -45,11 +69,11 @@ in
};
# For VMs
bridges = {
"br0" = {
interfaces = [ "enp130s0f1" ];
};
};
# bridges = {
# "br0" = {
# interfaces = [ "enp130s0f1" ];
# };
# };
};
swapDevices = [ ];
@ -82,6 +106,10 @@ in
purpose = "Production";
system = {
motd.networkInterfaces = [ "enp130s0f0" "enp130s0f1" ];
# Incus
incus = {
enable = true;
};
# ZFS
zfs.enable = true;
zfs.mountPoolsAtBoot = [ "eru" ];

View file

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

View file

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

View file

@ -1,16 +1,73 @@
{ config, pkgs, ... }:
{ config, pkgs, lib, ... }:
let
cfg = config.mySystem.system.incus;
user = "jahanson";
in
{
sops.secrets.secret-domain-0 = {
sopsFile = ./secret.sops.yaml;
# sops.secrets.secret-domain-0 = {
# 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 = {
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;
};
};
users.users.${user}.extraGroups = [ "incus-admin" ];
# systemd.services.incus-preseed.postStart = "${oidcSetup}";
@ -18,7 +75,7 @@
nftables.enable = true;
firewall = {
allowedTCPPorts = [
8443
8445
53
67
];
@ -28,4 +85,5 @@
];
};
};
};
}

View file

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