diff --git a/provision/nixos/hosts/kestrel/configuration.nix b/provision/nixos/hosts/kestrel/configuration.nix index b00c8959..a50d7faf 100644 --- a/provision/nixos/hosts/kestrel/configuration.nix +++ b/provision/nixos/hosts/kestrel/configuration.nix @@ -40,11 +40,6 @@ time.timeZone = "America/Los_Angeles"; i18n.defaultLocale = "en_US.UTF-8"; - # Enable sound. - sound.enable = true; - hardware.pulseaudio.enable = true; - hardware.pulseaudio.support32Bit = true; - # Add fonts fonts.fonts = with pkgs; [ nerdfonts @@ -54,62 +49,18 @@ virtualisation.docker.enable = true; virtualisation.docker.storageDriver = "btrfs"; - # Enable zsh - programs.zsh.enable = true; - # Define user account. users.users.${user} = { isNormalUser = true; 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 imports = [ ../../modules ]; modules = { - services = { - samba-client.enable = true; - virt-manager.enable = true; + desktop = { + sway.enable = true; }; devel = { tooling.enable = true; @@ -119,10 +70,17 @@ gaming = { steam.enable = true; }; - desktop = { - sway.enable = true; + services = { + samba-client.enable = true; + virt-manager.enable = true; + syncthing.enable = true; + peripherals.enable = true; + }; + system = { + terminal.enable = true; + ssh.enable = true; }; }; - - system.stateVersion = "23.05"; # Did you read the comment? + # Did you read the comment? + system.stateVersion = "23.05"; } diff --git a/provision/nixos/modules/default.nix b/provision/nixos/modules/default.nix index efa58c8d..72799026 100644 --- a/provision/nixos/modules/default.nix +++ b/provision/nixos/modules/default.nix @@ -1,4 +1,4 @@ { ... }: { - imports = [ ./desktop ./gaming ./devel ./services ]; + imports = [ ./desktop ./gaming ./devel ./services ./system ]; } diff --git a/provision/nixos/modules/devel/tooling.nix b/provision/nixos/modules/devel/tooling.nix index 28e46e7c..36276788 100644 --- a/provision/nixos/modules/devel/tooling.nix +++ b/provision/nixos/modules/devel/tooling.nix @@ -7,20 +7,15 @@ let in { options.modules.devel.tooling.enable = lib.mkEnableOption "tooling"; config = lib.mkIf cfg.enable { - # Install packages environment.systemPackages = with pkgs; [ - neovim - ripgrep - tmux - tmuxp - lazygit - git-annex + cmake + gcc + coreutils + gnumake + # TODO: Move somewhere else pandoc gollum - cmake - coreutils - gcc ]; }; } diff --git a/provision/nixos/modules/services/default.nix b/provision/nixos/modules/services/default.nix index d8b18134..ecbd0763 100644 --- a/provision/nixos/modules/services/default.nix +++ b/provision/nixos/modules/services/default.nix @@ -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 ]; } diff --git a/provision/nixos/modules/services/peripherals.nix b/provision/nixos/modules/services/peripherals.nix new file mode 100644 index 00000000..6648802b --- /dev/null +++ b/provision/nixos/modules/services/peripherals.nix @@ -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; + }; + }; +} diff --git a/provision/nixos/modules/services/syncthing.nix b/provision/nixos/modules/services/syncthing.nix new file mode 100644 index 00000000..8ea1ebec --- /dev/null +++ b/provision/nixos/modules/services/syncthing.nix @@ -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"; + }; + }; +} diff --git a/provision/nixos/modules/system/default.nix b/provision/nixos/modules/system/default.nix new file mode 100644 index 00000000..3d1a89d9 --- /dev/null +++ b/provision/nixos/modules/system/default.nix @@ -0,0 +1,4 @@ +{ ... }: +{ + imports = [ ./terminal.nix ./ssh.nix ]; +} diff --git a/provision/nixos/modules/system/ssh.nix b/provision/nixos/modules/system/ssh.nix new file mode 100644 index 00000000..aa7f693c --- /dev/null +++ b/provision/nixos/modules/system/ssh.nix @@ -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; + }; + }; +} diff --git a/provision/nixos/modules/system/terminal.nix b/provision/nixos/modules/system/terminal.nix new file mode 100644 index 00000000..6416305b --- /dev/null +++ b/provision/nixos/modules/system/terminal.nix @@ -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 + ]; + }; +}