refactor kestrel

This commit is contained in:
Tyler Starr 2023-09-12 21:34:40 -07:00
parent aa0790da22
commit 7aff57181a
9 changed files with 103 additions and 68 deletions

View File

@ -40,11 +40,6 @@
time.timeZone = "America/Los_Angeles"; time.timeZone = "America/Los_Angeles";
i18n.defaultLocale = "en_US.UTF-8"; i18n.defaultLocale = "en_US.UTF-8";
# Enable sound.
sound.enable = true;
hardware.pulseaudio.enable = true;
hardware.pulseaudio.support32Bit = true;
# Add fonts # Add fonts
fonts.fonts = with pkgs; [ fonts.fonts = with pkgs; [
nerdfonts nerdfonts
@ -54,62 +49,18 @@
virtualisation.docker.enable = true; virtualisation.docker.enable = true;
virtualisation.docker.storageDriver = "btrfs"; virtualisation.docker.storageDriver = "btrfs";
# Enable zsh
programs.zsh.enable = true;
# Define user account. # Define user account.
users.users.${user} = { users.users.${user} = {
isNormalUser = true; isNormalUser = true;
extraGroups = [ "wheel" "docker" "libvirtd" ]; # Enable sudo for the user. extraGroups = [ "wheel" "docker" "libvirtd" ]; # Enable sudo for the user.
shell = pkgs.zsh; shell = pkgs.bash;
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
vim
git
killall
pciutils
syncthing
pinentry-curses
trash-cli
unzip
nnn
advcpmv
];
# Enable user services
services = {
gvfs.enable = true; # USB automount
blueman.enable = true;
printing.enable = true;
printing.drivers = [ pkgs.hplip ];
avahi.enable = true;
avahi.nssmdns = true;
syncthing = {
enable = true;
user = "${user}";
dataDir = "/home/${user}/sync";
configDir = "/home/${user}/.config/syncthing";
};
};
# Enable the OpenSSH daemon.
services.openssh.enable = true;
services.pcscd.enable = true;
programs.gnupg.agent = {
enable = true;
pinentryFlavor = "curses";
enableSSHSupport = true;
}; };
# Enable modules # Enable modules
imports = [ ../../modules ]; imports = [ ../../modules ];
modules = { modules = {
services = { desktop = {
samba-client.enable = true; sway.enable = true;
virt-manager.enable = true;
}; };
devel = { devel = {
tooling.enable = true; tooling.enable = true;
@ -119,10 +70,17 @@
gaming = { gaming = {
steam.enable = true; steam.enable = true;
}; };
desktop = { services = {
sway.enable = true; samba-client.enable = true;
virt-manager.enable = true;
syncthing.enable = true;
peripherals.enable = true;
};
system = {
terminal.enable = true;
ssh.enable = true;
}; };
}; };
# Did you read the comment?
system.stateVersion = "23.05"; # Did you read the comment? system.stateVersion = "23.05";
} }

View File

@ -1,4 +1,4 @@
{ ... }: { ... }:
{ {
imports = [ ./desktop ./gaming ./devel ./services ]; imports = [ ./desktop ./gaming ./devel ./services ./system ];
} }

View File

@ -7,20 +7,15 @@ let
in { in {
options.modules.devel.tooling.enable = lib.mkEnableOption "tooling"; options.modules.devel.tooling.enable = lib.mkEnableOption "tooling";
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
# Install packages # Install packages
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
neovim cmake
ripgrep gcc
tmux coreutils
tmuxp gnumake
lazygit # TODO: Move somewhere else
git-annex
pandoc pandoc
gollum gollum
cmake
coreutils
gcc
]; ];
}; };
} }

View File

@ -1,4 +1,4 @@
{ ... }: { ... }:
{ {
imports = [ ./samba-server.nix ./samba-client.nix ./jellyfin.nix ./virt-manager.nix ]; imports = [ ./syncthing.nix ./samba-server.nix ./samba-client.nix ./jellyfin.nix ./virt-manager.nix ./peripherals.nix ];
} }

View File

@ -0,0 +1,21 @@
{ config, lib, pkgs, ... }:
let cfg = config.modules.services.peripherals;
in {
options.modules.services.peripherals.enable = lib.mkEnableOption "peripherals";
config = lib.mkIf cfg.enable {
# Enable sound.
sound.enable = true;
hardware.pulseaudio.enable = true;
hardware.pulseaudio.support32Bit = true;
services = {
gvfs.enable = true;
blueman.enable = true;
printing.enable = true;
printing.drivers = [ pkgs.hplip ];
avahi.enable = true;
avahi.nssmdns = true;
};
};
}

View File

@ -0,0 +1,15 @@
{ config, lib, pkgs, ... }:
let cfg = config.modules.services.syncthing;
in {
options.modules.services.syncthing.enable = lib.mkEnableOption "syncthing";
config = lib.mkIf cfg.enable {
# Install packages
environment.systemPackages = with pkgs; [ syncthing ];
services.syncthing = {
enable = true;
user = "${user}";
configDir = "/home/${user}/.config/syncthing";
};
};
}

View File

@ -0,0 +1,4 @@
{ ... }:
{
imports = [ ./terminal.nix ./ssh.nix ];
}

View File

@ -0,0 +1,16 @@
{ config, lib, pkgs, user, ... }:
let cfg = config.modules.system.ssh;
in {
options.modules.system.ssh.enable = lib.mkEnableOption "ssh";
config = lib.mkIf cfg.enable {
# Enable the OpenSSH daemon.
services.openssh.enable = true;
services.pcscd.enable = true;
programs.gnupg.agent = {
enable = true;
pinentryFlavor = "curses";
enableSSHSupport = true;
};
};
}

View File

@ -0,0 +1,26 @@
{ config, lib, pkgs, user, ... }:
let cfg = config.modules.system.terminal;
in {
options.modules.system.terminal.enable = lib.mkEnableOption "terminal";
config = lib.mkIf cfg.enable {
# Install packages
environment.systemPackages = with pkgs; [
bash
bash-completion
neovim
ripgrep
tmux
tmuxp
git
git-annex
killall
pciutils
pinentry-curses
trash-cli
unzip
nnn
advcpmv
];
};
}