Separate desktop and server config

This commit is contained in:
asonix 2023-06-07 18:10:43 -05:00
parent 569734690b
commit 241a2e5006
5 changed files with 42 additions and 20 deletions

View file

@ -152,11 +152,11 @@
"rockchip": "rockchip"
},
"locked": {
"lastModified": 1686175220,
"narHash": "sha256-+jdhbkTLmvf2ZCwFjlvZXCHg7fR4v4G+eM0KubQ5x2c=",
"lastModified": 1686179112,
"narHash": "sha256-2wkmSD9F0mIZ8PoVjqgKc9PNRyf9/UxVQftooktddH0=",
"ref": "asonix/nabam-sd-image",
"rev": "b0eda5c0d9e84a9cf81e164b83c24104b9096fa7",
"revCount": 41,
"rev": "6892f699e6041cba868ad79fa732d71bb2cab5b9",
"revCount": 42,
"type": "git",
"url": "https://git.asonix.dog/asonix/sd-images"
},

View file

@ -28,6 +28,7 @@
networkModule = import ./modules/network;
wireguardModule = import ./modules/wireguard;
desktopModule = import ./modules/desktop;
serverModule = import ./modules/server;
makeConfig = { hostname, extraModules ? [ ] }:
nixpkgs.lib.nixosSystem {
@ -39,9 +40,21 @@
] ++ extraModules;
};
makeServerConfig = { hostname, extraModules ? [ ] }:
makeConfig {
inherit hostname;
extraModules = [ (serverModule) ] ++ extraModules;
};
makeDesktopConfig = { hostname, extraModules ? [ ] }:
makeConfig {
inherit hostname;
extraModules = [ (desktopModule) ] ++ extraModules;
};
makeGenericK3sConfig =
{ hostname, enableK3s ? true, serverIp ? null, extraModules ? [ ] }:
makeConfig {
makeServerConfig {
inherit hostname;
extraModules = [
@ -417,7 +430,7 @@
mountDir = "/btrfs/loop";
subvolumes = [ "@build-cfg" ];
in
makeConfig {
makeServerConfig {
inherit hostname;
extraModules = sd-images.packages.${system}.RockPro64v2.modules ++ [
@ -450,7 +463,7 @@
device = "/dev/disk/by-label/${deviceLabel}";
mountDir = "/btrfs/raid";
in
makeConfig {
makeServerConfig {
inherit hostname;
extraModules = modules ++ [
@ -543,7 +556,7 @@
makeGarageConfig = system:
{ hostname, selfIp, unlockMounts ? true, mountVolumes ? true }:
makeConfig {
makeServerConfig {
inherit hostname;
extraModules = sd-images.packages.${system}.RockPro64v2.modules ++ [
@ -677,7 +690,7 @@
mountDir = "/btrfs/ssd";
subvolumes = [ "@postgres" "@postgres-cfg" ];
in
makeConfig {
makeServerConfig {
inherit hostname;
extraModules = sd-images.packages.${system}.Rock64.modules ++ [
@ -887,7 +900,7 @@
serverIp = "192.168.20.120";
};
pinetab2 = makeConfig {
pinetab2 = makeDesktopConfig {
hostname = "pinetab2";
extraModules = [
{
@ -900,7 +913,6 @@
address = "192.168.5.13/24";
privateKeyFile = config.sops.secrets.pinetabWireguardKey.path;
})
(desktopModule)
] ++ sd-images.packages.${system}.PineTab2.modules;
};

View file

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs, lib, ... }:
{
users.users.asonix = {
@ -7,6 +7,8 @@
};
networking.networkmanager.enable = true;
services = {
automatic-timezoned.enable = true;
geoclue2.enableDemoAgent = lib.mkForce true;
xserver = {
layout = "us";
xkbVariant = "";
@ -40,8 +42,11 @@
environment.systemPackages = with pkgs; [
android-tools
bottom
firefox
git
htop
screen
vim
zsh

View file

@ -0,0 +1,13 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [ bottom cryptsetup git htop screen ];
time.timeZone = "UTC";
programs.neovim = {
enable = true;
viAlias = true;
vimAlias = true;
};
}

View file

@ -8,14 +8,6 @@
# Enables the generation of /boot/extlinux/extlinux.conf
boot.loader.generic-extlinux-compatible.enable = true;
environment.systemPackages = with pkgs; [ bottom cryptsetup git htop screen ];
programs.neovim = {
enable = true;
viAlias = true;
vimAlias = true;
};
sops = {
age.keyFile = "/home/asonix/.config/sops/age/keys.txt";
age.generateKey = true;