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

View file

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

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: { pkgs, lib, ... }:
{ {
users.users.asonix = { users.users.asonix = {
@ -7,6 +7,8 @@
}; };
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
services = { services = {
automatic-timezoned.enable = true;
geoclue2.enableDemoAgent = lib.mkForce true;
xserver = { xserver = {
layout = "us"; layout = "us";
xkbVariant = ""; xkbVariant = "";
@ -40,8 +42,11 @@
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
android-tools android-tools
bottom
firefox firefox
git git
htop
screen
vim vim
zsh 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 # Enables the generation of /boot/extlinux/extlinux.conf
boot.loader.generic-extlinux-compatible.enable = true; 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 = { sops = {
age.keyFile = "/home/asonix/.config/sops/age/keys.txt"; age.keyFile = "/home/asonix/.config/sops/age/keys.txt";
age.generateKey = true; age.generateKey = true;