Create module for desktop

This commit is contained in:
Pim Kunis 2024-11-19 22:08:41 +01:00
parent 7312d03b61
commit da3e3e621e
4 changed files with 41 additions and 34 deletions

View file

@ -10,7 +10,6 @@ in {
config = { config = {
pim = { pim = {
cinnamon.enable = true; cinnamon.enable = true;
inWheel = false;
}; };
facter.reportPath = ./facter.json; facter.reportPath = ./facter.json;
@ -18,9 +17,19 @@ in {
home-manager.users.pim.imports = [./home.nix]; home-manager.users.pim.imports = [./home.nix];
programs.steam.enable = true; programs.steam.enable = true;
users.users = {
root.openssh.authorizedKeys.keys = config.pim.ssh.keys.pim;
pim = {
isNormalUser = true;
openssh.authorizedKeys.keys = config.pim.ssh.keys.pim;
};
};
deployment = { deployment = {
targetHost = "gamepc"; targetHost = "gamepc";
targetUser = "root"; targetUser = "root";
tags = ["desktop"];
keys = { keys = {
root-sops-age-key = { root-sops-age-key = {
@ -44,11 +53,6 @@ in {
tailscale.enable = true; tailscale.enable = true;
}; };
users.users = {
root.openssh.authorizedKeys.keys = config.pim.ssh.keys.pim;
pim.openssh.authorizedKeys.keys = config.pim.ssh.keys.pim;
};
boot.loader.grub = { boot.loader.grub = {
enable = true; enable = true;
efiSupport = true; efiSupport = true;

View file

@ -16,9 +16,15 @@ in {
compliance.enable = true; compliance.enable = true;
}; };
users.users.pim = {
isNormalUser = true;
extraGroups = ["wheel" "docker" "input" "wireshark" "dialout"];
};
deployment = { deployment = {
allowLocalDeployment = true; allowLocalDeployment = true;
targetHost = null; targetHost = null;
tags = ["desktop"];
keys = { keys = {
# TODO: Create macro for this # TODO: Create macro for this

View file

@ -19,17 +19,12 @@
./compliance.nix ./compliance.nix
./cinnamon.nix ./cinnamon.nix
./ssh.nix ./ssh.nix
./desktop.nix
]; ];
options.pim.inWheel = lib.mkOption {
type = lib.types.bool;
default = true;
};
config = { config = {
time.timeZone = "Europe/Amsterdam"; time.timeZone = "Europe/Amsterdam";
i18n.defaultLocale = "en_US.UTF-8"; i18n.defaultLocale = "en_US.UTF-8";
programs.ssh.startAgent = true;
hardware.pulseaudio.enable = false; hardware.pulseaudio.enable = false;
systemd = { systemd = {
@ -38,23 +33,10 @@
}; };
services = { services = {
xserver = { xserver.excludePackages = [pkgs.xterm];
enable = true; printing.drivers = [pkgs.hplip pkgs.gutenprint];
excludePackages = [pkgs.xterm];
};
tailscale = {
useRoutingFeatures = "client";
extraSetFlags = ["--accept-routes"];
};
printing = {
enable = true;
drivers = [pkgs.hplip pkgs.gutenprint];
};
pipewire = { pipewire = {
enable = true;
alsa.enable = true; alsa.enable = true;
alsa.support32Bit = true; alsa.support32Bit = true;
pulse.enable = true; pulse.enable = true;
@ -62,13 +44,6 @@
}; };
}; };
users.users.pim = {
isNormalUser = true;
extraGroups =
["docker" "input" "wireshark" "dialout"]
++ lib.optional config.pim.inWheel "wheel";
};
environment = { environment = {
systemPackages = with pkgs; [ systemPackages = with pkgs; [
age age
@ -114,6 +89,7 @@
nix = { nix = {
package = pkgs.nixFlakes; package = pkgs.nixFlakes;
# TODO: "pim" shouldn't be here by default
settings.trusted-users = ["root" "pim"]; settings.trusted-users = ["root" "pim"];
extraOptions = '' extraOptions = ''
@ -170,6 +146,7 @@
useUserPackages = true; useUserPackages = true;
extraSpecialArgs = {inherit self inputs;}; extraSpecialArgs = {inherit self inputs;};
# TODO: shouldn't be here by default
users.pim.imports = ["${self}/home-manager"]; users.pim.imports = ["${self}/home-manager"];
}; };
}; };

20
nixos/desktop.nix Normal file
View file

@ -0,0 +1,20 @@
{
lib,
config,
...
}: {
config = lib.mkIf (builtins.elem "desktop" config.deployment.tags) {
programs.ssh.startAgent = true;
services = {
xserver.enable = true;
printing.enable = true;
pipewire.enable = true;
tailscale = {
useRoutingFeatures = "client";
extraSetFlags = ["--accept-routes"];
};
};
};
}