summaryrefslogtreecommitdiff
path: root/archetypes
diff options
context:
space:
mode:
Diffstat (limited to 'archetypes')
-rw-r--r--archetypes/collections/bluetooth.nix12
-rw-r--r--archetypes/collections/desktop/cad.nix21
-rw-r--r--archetypes/collections/desktop/chromium.nix18
-rw-r--r--archetypes/collections/desktop/crypto.nix13
-rw-r--r--archetypes/collections/desktop/default.nix17
-rw-r--r--archetypes/collections/desktop/extra.nix16
-rw-r--r--archetypes/collections/desktop/firefox.nix12
-rw-r--r--archetypes/collections/desktop/graphics.nix16
-rw-r--r--archetypes/collections/desktop/office.nix18
-rw-r--r--archetypes/collections/desktop/pipewire.nix14
-rw-r--r--archetypes/collections/desktop/printing.nix17
-rw-r--r--archetypes/collections/desktop/thumbnailers.nix23
-rw-r--r--archetypes/collections/desktop/utilities.nix32
-rw-r--r--archetypes/collections/desktop/video.nix17
-rw-r--r--archetypes/collections/desktop/xserver.nix34
-rw-r--r--archetypes/collections/development/default.nix45
-rw-r--r--archetypes/collections/development/docker.nix15
-rw-r--r--archetypes/collections/filesystems.nix7
-rw-r--r--archetypes/collections/fonts.nix16
-rw-r--r--archetypes/collections/neovim.nix18
-rw-r--r--archetypes/collections/nvidia.nix14
-rw-r--r--archetypes/collections/utilities.nix37
-rw-r--r--archetypes/collections/virtualization.nix21
-rw-r--r--archetypes/default.nix15
-rw-r--r--archetypes/profiles/btrfs/default.nix17
-rw-r--r--archetypes/profiles/cuda/default.nix26
-rw-r--r--archetypes/profiles/default.nix11
-rw-r--r--archetypes/profiles/desktop/default.nix144
-rw-r--r--archetypes/profiles/desktop/resources/fontconfig/90-commit-mono-options.conf17
-rw-r--r--archetypes/profiles/desktop/resources/fontconfig/90-tamzen-disable-anti-aliasing.conf14
-rw-r--r--archetypes/profiles/gnome/default.nix13
-rw-r--r--archetypes/profiles/headless/default.nix37
-rw-r--r--archetypes/profiles/pi/default.nix30
-rw-r--r--archetypes/profiles/zfs/default.nix33
34 files changed, 810 insertions, 0 deletions
diff --git a/archetypes/collections/bluetooth.nix b/archetypes/collections/bluetooth.nix
new file mode 100644
index 0000000..749a9f1
--- /dev/null
+++ b/archetypes/collections/bluetooth.nix
@@ -0,0 +1,12 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.bluetooth;
+in {
+ options._archetypes.collections.bluetooth = {
+ enable = lib.mkEnableOption "enables bluetooth and blueman";
+ };
+
+ config = lib.mkIf cfg.enable {
+ hardware.bluetooth.enable = true;
+ services.blueman.enable = config._archetypes.collections.desktop.utilities.enable; # FIXME
+ };
+}
diff --git a/archetypes/collections/desktop/cad.nix b/archetypes/collections/desktop/cad.nix
new file mode 100644
index 0000000..6b2c26b
--- /dev/null
+++ b/archetypes/collections/desktop/cad.nix
@@ -0,0 +1,21 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.desktop.cad;
+in {
+ options._archetypes.collections.desktop.cad = {
+ enable = lib.mkEnableOption "install cad and 3d printing software";
+ };
+
+ config = lib.mkIf cfg.enable {
+ environment.systemPackages = with pkgs; [
+ blender
+ freecad
+ prusa-slicer
+ ];
+ # TODO remove once #467783 is resolved
+ environment.sessionVariables = {
+ # Make GTK3 file-chooser settings discoverable
+ # per https://github.com/NixOS/nixpkgs/issues/467783#issuecomment-3648708206
+ GSETTINGS_SCHEMA_DIR ="${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}/glib-2.0/schemas";
+ };
+ };
+}
diff --git a/archetypes/collections/desktop/chromium.nix b/archetypes/collections/desktop/chromium.nix
new file mode 100644
index 0000000..b4638f0
--- /dev/null
+++ b/archetypes/collections/desktop/chromium.nix
@@ -0,0 +1,18 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.desktop.chromium;
+in {
+ options._archetypes.collections.desktop.chromium = {
+ enable = lib.mkEnableOption "install chromium browser";
+ package = lib.mkOption {
+ type = lib.types.package;
+ default = pkgs.ungoogled-chromium;
+ description = "chromium package to install";
+ };
+ };
+
+ config = lib.mkIf cfg.enable {
+ environment.systemPackages = [
+ cfg.package
+ ];
+ };
+}
diff --git a/archetypes/collections/desktop/crypto.nix b/archetypes/collections/desktop/crypto.nix
new file mode 100644
index 0000000..bfb9186
--- /dev/null
+++ b/archetypes/collections/desktop/crypto.nix
@@ -0,0 +1,13 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.desktop.crypto;
+in {
+ options._archetypes.collections.desktop.crypto = {
+ enable = lib.mkEnableOption "install crypto wallets";
+ };
+
+ config = lib.mkIf cfg.enable {
+ environment.systemPackages = with pkgs; [
+ unstable.sparrow
+ ];
+ };
+}
diff --git a/archetypes/collections/desktop/default.nix b/archetypes/collections/desktop/default.nix
new file mode 100644
index 0000000..6ac79dd
--- /dev/null
+++ b/archetypes/collections/desktop/default.nix
@@ -0,0 +1,17 @@
+{
+ imports = [
+ ./cad.nix
+ ./chromium.nix
+ ./crypto.nix
+ ./extra.nix
+ ./firefox.nix
+ ./graphics.nix
+ ./office.nix
+ ./pipewire.nix
+ ./printing.nix
+ ./thumbnailers.nix
+ ./utilities.nix
+ ./video.nix
+ ./xserver.nix
+ ];
+}
diff --git a/archetypes/collections/desktop/extra.nix b/archetypes/collections/desktop/extra.nix
new file mode 100644
index 0000000..5cf4221
--- /dev/null
+++ b/archetypes/collections/desktop/extra.nix
@@ -0,0 +1,16 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.desktop.extraUtilities;
+in {
+ options._archetypes.collections.desktop.extraUtilities = {
+ enable = lib.mkEnableOption "install extra desktop utilities";
+ };
+
+ config = lib.mkIf cfg.enable {
+ environment.systemPackages = with pkgs; [
+ jellyfin-mpv-shim
+ qbittorrent
+ remmina
+ sent
+ ];
+ };
+}
diff --git a/archetypes/collections/desktop/firefox.nix b/archetypes/collections/desktop/firefox.nix
new file mode 100644
index 0000000..02656f6
--- /dev/null
+++ b/archetypes/collections/desktop/firefox.nix
@@ -0,0 +1,12 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.desktop.firefox;
+in {
+ options._archetypes.collections.desktop.firefox = {
+ enable = lib.mkEnableOption "install firefox";
+ };
+
+ config = lib.mkIf cfg.enable {
+ programs.firefox.enable = true;
+ };
+}
+
diff --git a/archetypes/collections/desktop/graphics.nix b/archetypes/collections/desktop/graphics.nix
new file mode 100644
index 0000000..f4242d1
--- /dev/null
+++ b/archetypes/collections/desktop/graphics.nix
@@ -0,0 +1,16 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.desktop.graphics;
+in {
+ options._archetypes.collections.desktop.graphics = {
+ enable = lib.mkEnableOption "install graphic design software";
+ };
+
+ config = lib.mkIf cfg.enable {
+ environment.systemPackages = with pkgs; [
+ blender
+ geeqie
+ gimp3
+ inkscape
+ ];
+ };
+}
diff --git a/archetypes/collections/desktop/office.nix b/archetypes/collections/desktop/office.nix
new file mode 100644
index 0000000..23e6862
--- /dev/null
+++ b/archetypes/collections/desktop/office.nix
@@ -0,0 +1,18 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.desktop.office;
+in {
+ options._archetypes.collections.desktop.office = {
+ enable = lib.mkEnableOption "install office software";
+ };
+
+ config = lib.mkIf cfg.enable {
+ environment.systemPackages = with pkgs; [
+ hunspell # Spell checking in libreoffice
+ hunspellDicts.en_US
+ kdePackages.okular
+ libreoffice
+ pdfchain
+ thunderbird
+ ];
+ };
+}
diff --git a/archetypes/collections/desktop/pipewire.nix b/archetypes/collections/desktop/pipewire.nix
new file mode 100644
index 0000000..d80ac90
--- /dev/null
+++ b/archetypes/collections/desktop/pipewire.nix
@@ -0,0 +1,14 @@
+{ lib, config, ... }: let
+ cfg = config._archetypes.collections.desktop.pipewire;
+in {
+ options._archetypes.collections.desktop.pipewire = {
+ enable = lib.mkEnableOption "enables pipewire";
+ };
+
+ config = lib.mkIf cfg.enable {
+ services.pipewire = {
+ enable = true;
+ pulse.enable = true;
+ };
+ };
+}
diff --git a/archetypes/collections/desktop/printing.nix b/archetypes/collections/desktop/printing.nix
new file mode 100644
index 0000000..ed31048
--- /dev/null
+++ b/archetypes/collections/desktop/printing.nix
@@ -0,0 +1,17 @@
+{ lib, config, ... }: let
+ cfg = config._archetypes.collections.desktop.printing;
+in {
+ options._archetypes.collections.desktop.printing = {
+ enable = lib.mkEnableOption "enables printing and avahi service";
+ };
+
+ config = lib.mkIf cfg.enable {
+ services.printing.enable = true;
+
+ services.avahi = {
+ enable = true;
+ nssmdns4 = true;
+ openFirewall = true;
+ };
+ };
+}
diff --git a/archetypes/collections/desktop/thumbnailers.nix b/archetypes/collections/desktop/thumbnailers.nix
new file mode 100644
index 0000000..50e4aa7
--- /dev/null
+++ b/archetypes/collections/desktop/thumbnailers.nix
@@ -0,0 +1,23 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.desktop.thumbnailers;
+in {
+ options._archetypes.collections.desktop.thumbnailers = {
+ enable = lib.mkEnableOption "install thumbnailers for graphical file managers";
+ };
+
+ config = lib.mkIf cfg.enable {
+ # https://wiki.nixos.org/wiki/Thumbnails
+ # Thumbnailers created in /run/current-system/sw/share/thumbnailers
+ environment.systemPackages = with pkgs; [
+ # Video
+ ffmpegthumbnailer
+ # Images
+ gdk-pixbuf
+ # HEIF images
+ libheif
+ libheif.out
+ # RAW images
+ nufraw-thumbnailer
+ ];
+ };
+}
diff --git a/archetypes/collections/desktop/utilities.nix b/archetypes/collections/desktop/utilities.nix
new file mode 100644
index 0000000..479145b
--- /dev/null
+++ b/archetypes/collections/desktop/utilities.nix
@@ -0,0 +1,32 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.desktop.utilities;
+in {
+ options._archetypes.collections.desktop.utilities = {
+ enable = lib.mkEnableOption "install basic desktop utilities";
+ };
+
+ config = lib.mkIf cfg.enable {
+ environment.systemPackages = with pkgs; [
+ arandr
+ dex # Execute .desktop files
+ dmenu
+ gammastep
+ libnotify
+ lowbat
+ mpv
+ nsxiv
+ pavolctld
+ pavucontrol
+ pcmanfm
+ qdirstat
+ qdiskinfo
+ scrot
+ st
+ wpa_supplicant_gui
+ zathura
+ ];
+
+ programs.localsend.enable = true; # Installs & opens firewall
+ services.gvfs.enable = true; # GVfs allows for mounting drives in a graphical file manager
+ };
+}
diff --git a/archetypes/collections/desktop/video.nix b/archetypes/collections/desktop/video.nix
new file mode 100644
index 0000000..cce6516
--- /dev/null
+++ b/archetypes/collections/desktop/video.nix
@@ -0,0 +1,17 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.desktop.video;
+in {
+ options._archetypes.collections.desktop.video = {
+ enable = lib.mkEnableOption "install video capture and editing software";
+ };
+
+ config = lib.mkIf cfg.enable {
+ environment.systemPackages = with pkgs; [
+ dvgrab
+ ffmpeg
+ mpv
+ obs-studio
+ vlc
+ ];
+ };
+}
diff --git a/archetypes/collections/desktop/xserver.nix b/archetypes/collections/desktop/xserver.nix
new file mode 100644
index 0000000..9d62048
--- /dev/null
+++ b/archetypes/collections/desktop/xserver.nix
@@ -0,0 +1,34 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.desktop.xserver;
+in {
+ options._archetypes.collections.desktop.xserver = {
+ enable = lib.mkEnableOption "installs xserver";
+ utilities.enable = lib.mkEnableOption "installs basic xserver utilities";
+ };
+
+ config = lib.mkIf cfg.enable {
+ services = {
+ xserver = {
+ enable = true;
+ displayManager.startx.enable = true;
+ enableTearFree = true;
+ };
+ libinput.enable = true; # Enable touchpad support
+ };
+
+ # Install basic X utilities
+ environment.systemPackages = with pkgs; lib.optionals cfg.utilities.enable [
+ setxkbmap
+ unclutter-desktop-entry
+ unclutter-xfixes
+ xcape
+ xclip
+ xdotool
+ xinput
+ xkill
+ xrandr
+ xset
+ xwallpaper
+ ];
+ };
+}
diff --git a/archetypes/collections/development/default.nix b/archetypes/collections/development/default.nix
new file mode 100644
index 0000000..87fe2d2
--- /dev/null
+++ b/archetypes/collections/development/default.nix
@@ -0,0 +1,45 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.development;
+ hugoFirewallPort = 1313;
+in {
+ imports = [
+ ./docker.nix
+ ];
+
+ options._archetypes.collections.development = {
+ utilities.enable = lib.mkEnableOption "install basic dev utilities";
+ android.enable = lib.mkEnableOption "install android dev tools";
+ c.enable = lib.mkEnableOption "install c dev tools";
+ lua.enable = lib.mkEnableOption "install lua dev tools";
+ web = {
+ hugo = {
+ enable = lib.mkEnableOption "install hugo";
+ openFirewall = lib.mkEnableOption "open the port ${hugoFirewallPort} for viewing content from hugo serve on other devices";
+ };
+ node.enable = lib.mkEnableOption "install node";
+ };
+ };
+
+ config = {
+ environment.systemPackages = with pkgs; [
+ git
+ python3
+ ] ++ lib.optionals cfg.android.enable [
+ #adb-sync
+ android-tools
+ ] ++ lib.optionals cfg.c.enable [
+ gcc
+ git
+ gnumake
+ pkg-config
+ ] ++ lib.optionals cfg.lua.enable [
+ lua
+ ] ++ lib.optionals cfg.web.hugo.enable [
+ hugo
+ ] ++ lib.optionals cfg.web.node.enable [
+ nodejs
+ ];
+
+ networking.firewall.allowedTCPPorts = lib.mkIf cfg.web.hugo.openFirewall [ hugoFirewallPort ];
+ };
+}
diff --git a/archetypes/collections/development/docker.nix b/archetypes/collections/development/docker.nix
new file mode 100644
index 0000000..0c9fce4
--- /dev/null
+++ b/archetypes/collections/development/docker.nix
@@ -0,0 +1,15 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.development.docker;
+in {
+ options._archetypes.collections.development.docker = {
+ enable = lib.mkEnableOption "enables docker";
+ };
+
+ config = lib.mkIf cfg.enable {
+ virtualisation.docker.enable = true;
+
+ environment.systemPackages = with pkgs; [
+ docker-compose
+ ];
+ };
+}
diff --git a/archetypes/collections/filesystems.nix b/archetypes/collections/filesystems.nix
new file mode 100644
index 0000000..00ab409
--- /dev/null
+++ b/archetypes/collections/filesystems.nix
@@ -0,0 +1,7 @@
+{ pkgs, ... }: {
+ environment.systemPackages = with pkgs; [
+ cryptsetup
+ exfat
+ ntfs3g
+ ];
+}
diff --git a/archetypes/collections/fonts.nix b/archetypes/collections/fonts.nix
new file mode 100644
index 0000000..136e31b
--- /dev/null
+++ b/archetypes/collections/fonts.nix
@@ -0,0 +1,16 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.fonts;
+in {
+ options._archetypes.collections.fonts = {
+ enable = lib.mkEnableOption "enables fonts";
+ };
+
+ config = lib.mkIf cfg.enable {
+ fonts.packages = with pkgs; [
+ commit-mono
+ inter
+ nerd-fonts.jetbrains-mono
+ tamzen
+ ];
+ };
+}
diff --git a/archetypes/collections/neovim.nix b/archetypes/collections/neovim.nix
new file mode 100644
index 0000000..2040d77
--- /dev/null
+++ b/archetypes/collections/neovim.nix
@@ -0,0 +1,18 @@
+{ lib, pkgs, ... }: let
+ cfg.neovimPackage = pkgs.unstable.neovim;
+
+ # Neovim package that includes aliases vi(m) -> nvim
+ neovim-aliases = pkgs.symlinkJoin {
+ name = "neovim-aliases";
+ paths = [ cfg.neovimPackage ];
+ postBuild = ''
+ ln -sf $out/bin/nvim $out/bin/vi
+ ln -sf $out/bin/nvim $out/bin/vim
+ '';
+ };
+in {
+ # NOTE: Don't use programs.neovim since that will build neovim from source
+ environment.systemPackages = with pkgs; [
+ neovim-aliases
+ ];
+}
diff --git a/archetypes/collections/nvidia.nix b/archetypes/collections/nvidia.nix
new file mode 100644
index 0000000..ce22e8b
--- /dev/null
+++ b/archetypes/collections/nvidia.nix
@@ -0,0 +1,14 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.nvidia;
+in {
+ options._archetypes.collections.nvidia = {
+ enable = lib.mkEnableOption "enables nvidia debugging packages, etc.";
+ };
+
+ config = lib.mkIf cfg.enable {
+ environment.systemPackages = with pkgs; [
+ config.hardware.nvidia.package # nvidia-smi
+ nvtopPackages.nvidia
+ ];
+ };
+}
diff --git a/archetypes/collections/utilities.nix b/archetypes/collections/utilities.nix
new file mode 100644
index 0000000..1597d75
--- /dev/null
+++ b/archetypes/collections/utilities.nix
@@ -0,0 +1,37 @@
+{ pkgs, ... }: {
+ environment.systemPackages = with pkgs; [
+ R
+ dash # TODO should be default /bin/sh
+ entr
+ fastfetch
+ ffmpeg
+ htop
+ jq
+ killall
+ #light # TODO find replacement
+ lm_sensors
+ mediainfo
+ nmap
+ openssl
+ p7zip
+ pciutils
+ powertop
+ pv
+ rsync
+ screen
+ smartmontools
+ sslscan
+ stress
+ testdisk
+ tmux
+ uhubctl
+ usbutils
+ vimv-rs
+ wget
+ wireguard-tools
+ xxhash
+ yt-dlp
+ ];
+
+ services.gpm.enable = true;
+}
diff --git a/archetypes/collections/virtualization.nix b/archetypes/collections/virtualization.nix
new file mode 100644
index 0000000..b91f6e1
--- /dev/null
+++ b/archetypes/collections/virtualization.nix
@@ -0,0 +1,21 @@
+{ pkgs, lib, config, ... }: let
+ cfg = config._archetypes.collections.virtualization;
+in {
+ options._archetypes.collections.virtualization = {
+ enable = lib.mkEnableOption "enables virtualization and virt-manager";
+ };
+
+ config = lib.mkIf cfg.enable {
+ virtualisation = {
+ spiceUSBRedirection.enable = true;
+ libvirtd.enable = true;
+ # Enable efi support with ovmf firmware
+ libvirtd.qemu = {
+ package = pkgs.qemu_kvm;
+ runAsRoot = true;
+ swtpm.enable = true;
+ };
+ };
+ programs.virt-manager.enable = config._archetypes.collections.desktop.utilities.enable; # FIXME
+ };
+}
diff --git a/archetypes/default.nix b/archetypes/default.nix
new file mode 100644
index 0000000..f306073
--- /dev/null
+++ b/archetypes/default.nix
@@ -0,0 +1,15 @@
+{
+ imports = [
+ ./collections/bluetooth.nix
+ ./collections/desktop
+ ./collections/development
+ ./collections/filesystems.nix
+ ./collections/fonts.nix
+ ./collections/neovim.nix
+ ./collections/nvidia.nix
+ ./collections/utilities.nix
+ ./collections/virtualization.nix
+
+ ./profiles
+ ];
+}
diff --git a/archetypes/profiles/btrfs/default.nix b/archetypes/profiles/btrfs/default.nix
new file mode 100644
index 0000000..88fad38
--- /dev/null
+++ b/archetypes/profiles/btrfs/default.nix
@@ -0,0 +1,17 @@
+{ lib, pkgs, ... }: let
+ mkBtrfs = lib.mkOverride 820;
+
+ # https://wiki.nixos.org/wiki/Btrfs
+ nixosConfig = {
+ services.btrfs = {
+ autoScrub.enable = mkBtrfs true;
+ };
+
+ # Make docker work with btrfs
+ virtualisation.docker.storageDriver = mkBtrfs "btrfs";
+ };
+
+ homeConfig = {};
+in {
+ imports = [ (lib._mkProfileArchetype "btrfs" nixosConfig homeConfig) ];
+}
diff --git a/archetypes/profiles/cuda/default.nix b/archetypes/profiles/cuda/default.nix
new file mode 100644
index 0000000..b57b854
--- /dev/null
+++ b/archetypes/profiles/cuda/default.nix
@@ -0,0 +1,26 @@
+{ lib, pkgs, ... }: let
+ mkCuda = lib.mkOverride 800;
+
+ nixosConfig = {
+ # Binary cache packages built with cudaSupport
+ nix.settings = {
+ substituters = mkCuda [ "https://cache.nixos-cuda.org" ];
+ trusted-public-keys = mkCuda [ "cache.nixos-cuda.org:74DUi4Ye579gUqzH4ziL9IyiJBlDpMRn9MBN8oNan9M=" ];
+ };
+
+ # Enable cudaSupport
+ nixpkgs.config.cudaSupport = mkCuda true;
+
+ _archetypes.collections = {
+ nvidia.enable = mkCuda true;
+ };
+
+ # Enable nvidia graphics
+ services.xserver.videoDrivers = mkCuda [ "nvidia" ]; # xserver.videoDrivers does not imply X
+ hardware.graphics.enable = mkCuda true;
+ };
+
+ homeConfig = {};
+in {
+ imports = [ (lib._mkProfileArchetype "cuda" nixosConfig homeConfig) ];
+}
diff --git a/archetypes/profiles/default.nix b/archetypes/profiles/default.nix
new file mode 100644
index 0000000..1664484
--- /dev/null
+++ b/archetypes/profiles/default.nix
@@ -0,0 +1,11 @@
+{
+ imports = [
+ ./gnome # 700
+ ./cuda # 800
+ ./zfs # 810
+ ./btrfs # 820
+ ./pi # 900
+ ./headless # 910
+ ./desktop # 920
+ ];
+}
diff --git a/archetypes/profiles/desktop/default.nix b/archetypes/profiles/desktop/default.nix
new file mode 100644
index 0000000..2f71791
--- /dev/null
+++ b/archetypes/profiles/desktop/default.nix
@@ -0,0 +1,144 @@
+{ lib, pkgs, ... }: let
+ mkDesktop = lib.mkOverride 920;
+
+ nixosConfig = {
+ _archetypes.collections = {
+ desktop = {
+ firefox.enable = mkDesktop true;
+ pipewire.enable = mkDesktop true;
+ printing.enable = mkDesktop true;
+ thumbnailers.enable = mkDesktop true;
+ utilities.enable = mkDesktop true;
+ xserver = {
+ enable = mkDesktop true;
+ utilities.enable = mkDesktop true;
+ };
+ };
+ development = {
+ utilities.enable = mkDesktop true;
+ };
+ fonts.enable = mkDesktop true;
+ };
+
+ security = {
+ polkit = {
+ enable = mkDesktop true;
+ _gnome.enable = mkDesktop true;
+ _allowUserPowerControls = mkDesktop true;
+ };
+ };
+
+ programs = {
+ _ddcutil.enable = mkDesktop true;
+ };
+
+ services = {
+ _geoclue2.enable = mkDesktop true;
+ xserver = {
+ windowManager._awesome.enable = mkDesktop true;
+ enableTearFree = mkDesktop true;
+ };
+ logind._safePowerKey.enable = mkDesktop true;
+ openssh = {
+ enable = mkDesktop true;
+ settings.X11Forwarding = mkDesktop true;
+ };
+ tlp.enable = mkDesktop true;
+
+ # Ensure video group can change backlight
+ udev.extraRules = mkDesktop ''
+ SUBSYSTEM=="backlight", ACTION=="add", RUN+="${pkgs.coreutils}/bin/chgrp video /sys/class/backlight/%k/brightness", RUN+="${pkgs.coreutils}/bin/chmod g+w /sys/class/backlight/%k/brightness"
+ '';
+ };
+
+ # Disable ipv6 by default
+ networking.enableIPv6 = mkDesktop false;
+
+ # Install dconf. Home-manager will break without it if gtk theme is changed
+ environment.systemPackages = [ pkgs.dconf ];
+ };
+
+ homeConfig = {
+ gtk = {
+ enable = mkDesktop true;
+ _mintTheme.enable = mkDesktop true;
+ font.name = mkDesktop "sans-serif";
+ cursorTheme.name = mkDesktop "Adwaita";
+ };
+
+ qt._gtkPlatformTheme.enable = mkDesktop true;
+
+ fonts.fontconfig = {
+ enable = mkDesktop true;
+ defaultFonts = {
+ # These fonts are added above in fonts collection
+ sansSerif = mkDesktop [ "Inter" ];
+ monospace = mkDesktop [ "CommitMono" ];
+ };
+ configFile = {
+ tamzen-disable-anti-aliasing = {
+ enable = true;
+ source = ./resources/fontconfig/90-tamzen-disable-anti-aliasing.conf;
+ };
+ commit-mono-options = {
+ enable = true;
+ source = ./resources/fontconfig/90-commit-mono-options.conf;
+ };
+ };
+ };
+
+ programs = {
+ _pcmanfm.openAsRootOption.enable = mkDesktop true;
+ _st = {
+ enable = mkDesktop true;
+ font = {
+ name = mkDesktop "JetBrainsMonoNL Nerd Font Mono";
+ # Default attrs
+ attrs = {
+ size = 12;
+ antialias = true;
+ autohint = true;
+ };
+ };
+ };
+ firefox._configure = mkDesktop true;
+ htop._configure = mkDesktop true;
+ zathura = {
+ enable = mkDesktop true;
+ options = {
+ selection-clipboard = mkDesktop "clipboard"; # Copy highlighted text
+ };
+ };
+ };
+
+ services = {
+ _gammastep.enable = true;
+ #polkit-gnome.enable = mkDesktop true; # Doesn't work on X
+ };
+
+ xdg = {
+ autostart = {
+ enable = mkDesktop true;
+ entries = mkDesktop [
+ "${pkgs.gammastep}/share/applications/gammastep-indicator.desktop"
+ "${pkgs.unclutter-desktop-entry}/share/applications/unclutter.desktop"
+ ];
+ };
+ };
+
+ xdg.mimeApps._defaultCategoryApplications = {
+ enable = true;
+ categoryApplications = {
+ audio = [ "mpv" ];
+ directory = [ "pcmanfm" ];
+ email = [ "thunderbird" ];
+ image = [ "nsxiv" ];
+ pdf = [ "org.pwmt.zathura-pdf-mupdf" ];
+ text = [ "nvim" ];
+ video = [ "mpv" ];
+ };
+ };
+ };
+in {
+ imports = [ (lib._mkProfileArchetype "desktop" nixosConfig homeConfig) ];
+}
diff --git a/archetypes/profiles/desktop/resources/fontconfig/90-commit-mono-options.conf b/archetypes/profiles/desktop/resources/fontconfig/90-commit-mono-options.conf
new file mode 100644
index 0000000..9c7373a
--- /dev/null
+++ b/archetypes/profiles/desktop/resources/fontconfig/90-commit-mono-options.conf
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+
+<fontconfig>
+ <description>Enable opentype features for CommitMono to make it match better with Inter as its monospace counterpart</description>
+ <match target="font">
+ <test name="family" compare="eq" ignore-blanks="true">
+ <string>CommitMono</string>
+ </test>
+ <edit name="fontfeatures" mode="append">
+ <string>ss03 on</string> <!-- smart case -->
+ <string>ss04 on</string> <!-- symbol spacing -->
+ <string>cv02 on</string> <!-- alt g -->
+ <string>cv06 on</string> <!-- alt 6 & 9 -->
+ </edit>
+ </match>
+</fontconfig>
diff --git a/archetypes/profiles/desktop/resources/fontconfig/90-tamzen-disable-anti-aliasing.conf b/archetypes/profiles/desktop/resources/fontconfig/90-tamzen-disable-anti-aliasing.conf
new file mode 100644
index 0000000..5bf94d7
--- /dev/null
+++ b/archetypes/profiles/desktop/resources/fontconfig/90-tamzen-disable-anti-aliasing.conf
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
+
+<fontconfig>
+ <description>Disable anti-aliasing for Tamzen since it is a bitmap font</description>
+ <match target="pattern">
+ <test name="family" compare="eq" qual="any">
+ <string>Tamzen</string>
+ </test>
+ <edit name="antialias" mode="assign">
+ <bool>false</bool>
+ </edit>
+ </match>
+</fontconfig>
diff --git a/archetypes/profiles/gnome/default.nix b/archetypes/profiles/gnome/default.nix
new file mode 100644
index 0000000..6b7184b
--- /dev/null
+++ b/archetypes/profiles/gnome/default.nix
@@ -0,0 +1,13 @@
+{ lib, pkgs, ... }: let
+ mkGnome = lib.mkOverride 700;
+
+ nixosConfig = {
+ services.displayManager.gdm.enable = mkGnome true;
+ services.desktopManager.gnome.enable = mkGnome true;
+ services.tlp.enable = mkGnome false; # Conflicts with power-profiles-daemon
+ };
+
+ homeConfig = {};
+in {
+ imports = [ (lib._mkProfileArchetype "gnome" nixosConfig homeConfig) ];
+}
diff --git a/archetypes/profiles/headless/default.nix b/archetypes/profiles/headless/default.nix
new file mode 100644
index 0000000..ac1eb80
--- /dev/null
+++ b/archetypes/profiles/headless/default.nix
@@ -0,0 +1,37 @@
+{ lib, ... }: let
+ mkHeadless = lib.mkOverride 910;
+
+ nixosConfig = {
+ _archetypes.collections = {
+ development = {
+ utilities.enable = mkHeadless true;
+ };
+ };
+
+ programs = {
+ _ddcutil.enable = mkHeadless true;
+ };
+
+ services = {
+ openssh.enable = mkHeadless true;
+ smartd.enable = mkHeadless true;
+ };
+
+ # Disable ipv6 by default
+ networking.enableIPv6 = mkHeadless false;
+ };
+
+ homeConfig = {
+ # Disable fontconfig features explicitly to avoid warnings
+ fonts.fontconfig = {
+ subpixelRendering = mkHeadless "none";
+ hinting = mkHeadless "none";
+ };
+
+ programs = {
+ htop._configure = mkHeadless true;
+ };
+ };
+in {
+ imports = [ (lib._mkProfileArchetype "headless" nixosConfig homeConfig) ];
+}
diff --git a/archetypes/profiles/pi/default.nix b/archetypes/profiles/pi/default.nix
new file mode 100644
index 0000000..639111a
--- /dev/null
+++ b/archetypes/profiles/pi/default.nix
@@ -0,0 +1,30 @@
+{ lib, pkgs, ... }: let
+ mkPi = lib.mkOverride 900;
+
+ nixosConfig = {
+ boot.loader = {
+ # Use the extlinux boot loader. (NixOS wants to enable GRUB by default)
+ grub.enable = false;
+ # Enables the generation of /boot/extlinux/extlinux.conf
+ generic-extlinux-compatible.enable = true;
+ };
+ };
+
+ homeConfig = {
+ # Use raspian logo in fastfetch
+ programs.fastfetch.settings = {
+ logo.source = mkPi "raspbian";
+ # Default options for the rest of this
+ # TODO figure out how to just override logo and keep defaults w/config file
+ modules = [
+ "title" "separator" "os" "host" "kernel" "uptime" "packages"
+ "shell" "display" "de" "wm" "wmtheme" "theme" "icons" "font"
+ "cursor" "terminal" "terminalfont" "cpu" "gpu" "memory" "swap"
+ "disk" "localip" "battery" "poweradapter" "locale" "break"
+ "colors"
+ ];
+ };
+ };
+in {
+ imports = [ (lib._mkProfileArchetype "pi" nixosConfig homeConfig) ];
+}
diff --git a/archetypes/profiles/zfs/default.nix b/archetypes/profiles/zfs/default.nix
new file mode 100644
index 0000000..00f3c0b
--- /dev/null
+++ b/archetypes/profiles/zfs/default.nix
@@ -0,0 +1,33 @@
+{ lib, pkgs, ... }: let
+ mkZfs = lib.mkOverride 810;
+
+ # https://wiki.nixos.org/wiki/ZFS
+ nixosConfig = {
+ boot._loader = {
+ grub.zfsSupport = mkZfs true;
+ mode = mkZfs "efi";
+ };
+
+ boot.supportedFilesystems = [ "zfs" ];
+
+ services.zfs = {
+ trim.enable = mkZfs true;
+ autoSnapshot.enable = mkZfs true;
+ autoScrub.enable = mkZfs true;
+ };
+
+ # Make docker work with zfs
+ virtualisation.docker.storageDriver = mkZfs "zfs";
+
+ # Ensure root pools are safely imported (default after 26.11)
+ # NOTE: If NixOS fails to boot because it cannot import the root pool,
+ # you should boot with the zfs_force=1 option as a kernel parameter
+ # (e.g. by manually editing the kernel params via your bootloader). You
+ # should only need to do this after unclean shutdowns.
+ boot.zfs.forceImportRoot = mkZfs false;
+ };
+
+ homeConfig = {};
+in {
+ imports = [ (lib._mkProfileArchetype "zfs" nixosConfig homeConfig) ];
+}