diff --git a/modules/core/dendritic.nix b/modules/den.nix similarity index 100% rename from modules/core/dendritic.nix rename to modules/den.nix diff --git a/modules/hosts/_hw/box.nix b/modules/hosts/_hw/box.nix new file mode 100644 index 0000000..2a700a0 --- /dev/null +++ b/modules/hosts/_hw/box.nix @@ -0,0 +1,33 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/ce146931-5f62-438c-894c-63460b5015b9"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/59C5-C9CA"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/b9f09747-0d4c-42f8-9885-8199e954d1b8"; } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/modules/hosts/_hw/styx.nix b/modules/hosts/_hw/styx.nix new file mode 100644 index 0000000..7e194f0 --- /dev/null +++ b/modules/hosts/_hw/styx.nix @@ -0,0 +1,31 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usbhid" "uas" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/b9bd7c42-1b25-42e1-8fe0-519a75f3a1f5"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/D1BE-A7F3"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = [ ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/modules/hosts/defaults.nix b/modules/hosts/default.nix similarity index 100% rename from modules/hosts/defaults.nix rename to modules/hosts/default.nix diff --git a/modules/roles.nix b/modules/roles.nix new file mode 100644 index 0000000..804845e --- /dev/null +++ b/modules/roles.nix @@ -0,0 +1,51 @@ +{ den, ... }: { + den.aspects.desktop = { + includes = with den.aspects; [ + system.desktop.cosmic + system.audio + system.swap + system.virtualisation + system.kernel + system.fonts + system.theme.stylix + system.flatpak + system.compat + system.janitor + + software.browsers + software.cad + software.dev + software.editors + software.files + software.gaming + software.media + software.monitor + software.music + software.net + software.office + software.security + software.social + software.terminal + ]; + + nixos.programs.ydotool.enable = true; + }; + + den.aspects.server = { + includes = with den.aspects; [ + services.cloudflared + services.searxng + services.copyparty + services.glances + services.invidious + services.mailserver + # services.matrix + # services.bugtv + services.vscode-server + services.gitea + # services.omnisearch + services.slskd + services.mpd + ]; + }; +} diff --git a/modules/services/cloudflared.nix b/modules/services/cloudflared.nix new file mode 100644 index 0000000..9f6b894 --- /dev/null +++ b/modules/services/cloudflared.nix @@ -0,0 +1,33 @@ +{ + den.quirks.tunnel.description = "cloudflared ingress: { subdomain, port }"; + + # per host: den.hosts...cloudflared = { uuid = "..."; protocol = "http2"; # optional }; + den.aspects.services.cloudflared = { + nixos = { tunnel, host, pkgs, lib, config, ... }: let + inherit (host.cloudflared) uuid; + inherit (host) domain; + user = host.owner; + in { + environment.systemPackages = [ pkgs.cloudflared ]; + environment.etc."cloudflared/${uuid}.json".source = "${config.users.users.${user}.home}/.cloudflared/${uuid}.json"; + + services.cloudflared = { + enable = true; + + tunnels.${uuid} = { + credentialsFile = "/etc/cloudflared/${uuid}.json"; + default = "http_status:404"; + + ingress = lib.listToAttrs (map (t: { + name = "${t.subdomain}.${domain}"; + value = "http://127.0.0.1:${toString t.port}"; + }) tunnel); + }; + }; + + systemd.services."cloudflared-tunnel-${uuid}".environment = lib.mkIf (host.cloudflared ? protocol) { + TUNNEL_TRANSPORT_PROTOCOL = lib.mkForce host.cloudflared.protocol; + }; + }; + }; +} diff --git a/modules/services/gitea/gitea.nix b/modules/services/gitea.nix similarity index 100% rename from modules/services/gitea/gitea.nix rename to modules/services/gitea.nix diff --git a/modules/software/llm/ollama.nix b/modules/services/llama.nix similarity index 100% rename from modules/software/llm/ollama.nix rename to modules/services/llama.nix diff --git a/modules/software/music/mpd.nix b/modules/services/mpd.nix similarity index 100% rename from modules/software/music/mpd.nix rename to modules/services/mpd.nix diff --git a/modules/software/utilities/addons/quad_remesher_1_4/QuadRemesher_Version.txt b/modules/software/cad/addons/quad_remesher_1_4/QuadRemesher_Version.txt similarity index 100% rename from modules/software/utilities/addons/quad_remesher_1_4/QuadRemesher_Version.txt rename to modules/software/cad/addons/quad_remesher_1_4/QuadRemesher_Version.txt diff --git a/modules/software/utilities/addons/quad_remesher_1_4/__init__.py b/modules/software/cad/addons/quad_remesher_1_4/__init__.py similarity index 100% rename from modules/software/utilities/addons/quad_remesher_1_4/__init__.py rename to modules/software/cad/addons/quad_remesher_1_4/__init__.py diff --git a/modules/software/utilities/addons/quad_remesher_1_4/qr_exe.py b/modules/software/cad/addons/quad_remesher_1_4/qr_exe.py similarity index 100% rename from modules/software/utilities/addons/quad_remesher_1_4/qr_exe.py rename to modules/software/cad/addons/quad_remesher_1_4/qr_exe.py diff --git a/modules/software/utilities/addons/quad_remesher_1_4/qr_operators.py b/modules/software/cad/addons/quad_remesher_1_4/qr_operators.py similarity index 100% rename from modules/software/utilities/addons/quad_remesher_1_4/qr_operators.py rename to modules/software/cad/addons/quad_remesher_1_4/qr_operators.py diff --git a/modules/software/utilities/cad.nix b/modules/software/cad/blender.nix similarity index 100% rename from modules/software/utilities/cad.nix rename to modules/software/cad/blender.nix diff --git a/modules/software/cad/plasticity.nix b/modules/software/cad/plasticity.nix new file mode 100644 index 0000000..da6f86f --- /dev/null +++ b/modules/software/cad/plasticity.nix @@ -0,0 +1,6 @@ +{ den, ... }: { + den.aspects.software.cad = { + includes = [ (den.batteries.unfree [ "plasticity" ]) ]; + homeManager = { pkgs, ... }: { home.packages = [ pkgs.plasticity ]; }; + }; +} diff --git a/modules/software/cli/default.nix b/modules/software/cli/default.nix new file mode 100644 index 0000000..d1b3a85 --- /dev/null +++ b/modules/software/cli/default.nix @@ -0,0 +1,28 @@ +{ + den.aspects.software.cli.nixos = { pkgs, ... }: { + environment.systemPackages = with pkgs; [ + # nix + comma + home-manager + nh + nix-index + nix-output-monitor + nix-prefetch + nvd + # dev + git + nil + nixd + nixfmt + # editors + micro + # net + inetutils + wget + # files + psmisc + tree + unzip + ]; + }; +} diff --git a/modules/software/llm/opencode.nix b/modules/software/cli/opencode.nix similarity index 100% rename from modules/software/llm/opencode.nix rename to modules/software/cli/opencode.nix diff --git a/modules/software/dev.nix b/modules/software/dev.nix new file mode 100644 index 0000000..fd86de7 --- /dev/null +++ b/modules/software/dev.nix @@ -0,0 +1,8 @@ +{ + den.aspects.software.dev.homeManager = { pkgs, ... }: { + home.packages = with pkgs; [ + jdk25 + python314Packages.pyside6 + ]; + }; +} diff --git a/modules/software/editors.nix b/modules/software/editors.nix new file mode 100644 index 0000000..238f7d3 --- /dev/null +++ b/modules/software/editors.nix @@ -0,0 +1,8 @@ +{ + den.aspects.software.editors.homeManager = { pkgs, ... }: { + home.packages = with pkgs; [ + zed-editor + #arduino-ide + ]; + }; +} diff --git a/modules/software/files.nix b/modules/software/files.nix new file mode 100644 index 0000000..36b5d83 --- /dev/null +++ b/modules/software/files.nix @@ -0,0 +1,14 @@ +{ + den.aspects.software.files = { + nixos = { pkgs, ... }: { + environment.systemPackages = [ pkgs.file-roller ]; + }; + + homeManager = { pkgs, ... }: { + home.packages = with pkgs; [ + impression + baobab + ]; + }; + }; +} diff --git a/modules/software/gaming/path-of-building.nix b/modules/software/gaming/path-of-building.nix new file mode 100644 index 0000000..f632aab --- /dev/null +++ b/modules/software/gaming/path-of-building.nix @@ -0,0 +1,3 @@ +{ + den.aspects.software.gaming.nixos.services.flatpak.packages = [ "community.pathofbuilding.PathOfBuilding" ]; +} diff --git a/modules/software/gaming/sober.nix b/modules/software/gaming/sober.nix new file mode 100644 index 0000000..d4569cc --- /dev/null +++ b/modules/software/gaming/sober.nix @@ -0,0 +1,3 @@ +{ + den.aspects.software.gaming.nixos.services.flatpak.packages = [ "org.vinegarhq.Sober" ]; +} diff --git a/modules/software/media.nix b/modules/software/media.nix new file mode 100644 index 0000000..b1ff412 --- /dev/null +++ b/modules/software/media.nix @@ -0,0 +1,14 @@ +{ + den.aspects.software.media = { + nixos = { pkgs, ... }: { + environment.systemPackages = [ pkgs.wl-screenrec ]; + }; + + homeManager = { pkgs, ... }: { + home.packages = with pkgs; [ + kooha + loupe + ]; + }; + }; +} diff --git a/modules/software/monitor.nix b/modules/software/monitor.nix new file mode 100644 index 0000000..1d00aa5 --- /dev/null +++ b/modules/software/monitor.nix @@ -0,0 +1,11 @@ +{ + den.aspects.software.monitor = { + nixos = { pkgs, ... }: { + environment.systemPackages = [ pkgs.firmware-updater ]; + }; + + homeManager = { pkgs, ... }: { + home.packages = [ pkgs.mission-center ]; + }; + }; +} diff --git a/modules/software/music/player.nix b/modules/software/music/default.nix similarity index 100% rename from modules/software/music/player.nix rename to modules/software/music/default.nix diff --git a/modules/software/utilities/sshuttle.nix b/modules/software/net.nix similarity index 100% rename from modules/software/utilities/sshuttle.nix rename to modules/software/net.nix diff --git a/modules/software/office.nix b/modules/software/office.nix new file mode 100644 index 0000000..b4335ed --- /dev/null +++ b/modules/software/office.nix @@ -0,0 +1,9 @@ +{ den, ... }: { + den.aspects.software.office = { + includes = [ (den.batteries.unfree [ "obsidian" ]) ]; + + homeManager = { pkgs, ... }: { + home.packages = [ pkgs.obsidian ]; + }; + }; +} diff --git a/modules/software/security.nix b/modules/software/security.nix new file mode 100644 index 0000000..8a1005f --- /dev/null +++ b/modules/software/security.nix @@ -0,0 +1,5 @@ +{ + den.aspects.software.security.homeManager = { pkgs, ... }: { + home.packages = [ pkgs.authenticator ]; + }; +} diff --git a/modules/software/utilities/fetch.nix b/modules/software/shell/fetch.nix similarity index 100% rename from modules/software/utilities/fetch.nix rename to modules/software/shell/fetch.nix diff --git a/modules/software/shell/fish.nix b/modules/software/shell/fish.nix new file mode 100644 index 0000000..75a0021 --- /dev/null +++ b/modules/software/shell/fish.nix @@ -0,0 +1,29 @@ +{ + den.aspects.software.shell.nixos = { pkgs, host, ... }: { + programs.fish = { + shellAliases = { + box = "ssh box.${host.domain}"; + unbox = "sh -c 'ssh -N -L \"$1\":0.0.0.0:\"$1\" box.${host.domain} &' --"; + rebox = "sh -c 'fuser -k \"$1\"/tcp' --"; + dock = "sh -c 'ssh -N -D \"$1\" box.${host.domain} &' --"; + + vpn = "sshuttle --dns --python python3 -r box.${host.domain} 0/0"; + + pico = "ssh pico.sh"; + + ns = "nh os switch ~/nix --impure -H (hostname)"; + rebuild = "ns"; + }; + + shellInit = '' + function tssh + ssh (tailscale status | awk -v host=$argv[1] '$2 == host {print $1}') + end + ''; + }; + + environment.systemPackages = with pkgs.fishPlugins; [ + sponge + ]; + }; +} diff --git a/modules/software/social/default.nix b/modules/software/social/default.nix new file mode 100644 index 0000000..4f23a07 --- /dev/null +++ b/modules/software/social/default.nix @@ -0,0 +1,7 @@ +{ + den.aspects.software.social.homeManager = { pkgs, ... }: { + home.packages = with pkgs; [ + geary + ]; + }; +} diff --git a/modules/software/terminal.nix b/modules/software/terminal.nix new file mode 100644 index 0000000..b29b54d --- /dev/null +++ b/modules/software/terminal.nix @@ -0,0 +1,11 @@ +{ + den.aspects.software.terminal.homeManager = { + programs.ghostty = { + enable = true; + + settings = { + window-decoration = "none"; + }; + }; + }; +} diff --git a/modules/core/audio/alc897.nix b/modules/system/audio/alc897.nix similarity index 100% rename from modules/core/audio/alc897.nix rename to modules/system/audio/alc897.nix diff --git a/modules/core/audio/audio.nix b/modules/system/audio/audio.nix similarity index 100% rename from modules/core/audio/audio.nix rename to modules/system/audio/audio.nix diff --git a/modules/core/boot.nix b/modules/system/base/boot.nix similarity index 100% rename from modules/core/boot.nix rename to modules/system/base/boot.nix diff --git a/modules/core/kernel.nix b/modules/system/base/kernel.nix similarity index 100% rename from modules/core/kernel.nix rename to modules/system/base/kernel.nix diff --git a/modules/core/locale.nix b/modules/system/base/locale.nix similarity index 100% rename from modules/core/locale.nix rename to modules/system/base/locale.nix diff --git a/modules/core/security.nix b/modules/system/base/security.nix similarity index 100% rename from modules/core/security.nix rename to modules/system/base/security.nix diff --git a/modules/core/swap.nix b/modules/system/base/swap.nix similarity index 100% rename from modules/core/swap.nix rename to modules/system/base/swap.nix diff --git a/modules/core/virtualisation.nix b/modules/system/base/virtualisation.nix similarity index 100% rename from modules/core/virtualisation.nix rename to modules/system/base/virtualisation.nix diff --git a/modules/system/compat/default.nix b/modules/system/compat/default.nix new file mode 100644 index 0000000..076fcc8 --- /dev/null +++ b/modules/system/compat/default.nix @@ -0,0 +1,19 @@ +{ inputs, ... }: { + flake-file.inputs.nix-alien = { + url = "github:thiagokokada/nix-alien"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + den.aspects.system.compat.nixos = { pkgs, ... }: { + environment.systemPackages = with pkgs; [ + wine64 + wineWow64Packages.full + appimage-run + inputs.nix-alien.packages.${pkgs.stdenv.hostPlatform.system}.nix-alien + ]; + + programs.appimage = { + enable = true; + binfmt = true; + }; + }; +} diff --git a/modules/software/compatibility/nix-ld.nix b/modules/system/compat/nix-ld.nix similarity index 100% rename from modules/software/compatibility/nix-ld.nix rename to modules/system/compat/nix-ld.nix diff --git a/modules/core/desktop/cosmic.nix b/modules/system/desktop/cosmic.nix similarity index 100% rename from modules/core/desktop/cosmic.nix rename to modules/system/desktop/cosmic.nix diff --git a/modules/core/desktop/neu.nix b/modules/system/desktop/neu.nix similarity index 100% rename from modules/core/desktop/neu.nix rename to modules/system/desktop/neu.nix diff --git a/modules/core/desktop/niri.nix b/modules/system/desktop/niri.nix similarity index 100% rename from modules/core/desktop/niri.nix rename to modules/system/desktop/niri.nix diff --git a/modules/core/desktop/noctalia.nix b/modules/system/desktop/noctalia.nix similarity index 100% rename from modules/core/desktop/noctalia.nix rename to modules/system/desktop/noctalia.nix diff --git a/modules/core/desktop/umbriel.nix b/modules/system/desktop/umbriel.nix similarity index 100% rename from modules/core/desktop/umbriel.nix rename to modules/system/desktop/umbriel.nix diff --git a/modules/software/flatpak.nix b/modules/system/flatpak.nix similarity index 100% rename from modules/software/flatpak.nix rename to modules/system/flatpak.nix diff --git a/modules/software/fonts.nix b/modules/system/fonts.nix similarity index 100% rename from modules/software/fonts.nix rename to modules/system/fonts.nix diff --git a/modules/core/graphics/amdgpu.nix b/modules/system/graphics/amdgpu.nix similarity index 100% rename from modules/core/graphics/amdgpu.nix rename to modules/system/graphics/amdgpu.nix diff --git a/modules/core/graphics/nvidia.nix b/modules/system/graphics/nvidia.nix similarity index 100% rename from modules/core/graphics/nvidia.nix rename to modules/system/graphics/nvidia.nix diff --git a/modules/core/autocpufreq.nix b/modules/system/hardware.nix similarity index 100% rename from modules/core/autocpufreq.nix rename to modules/system/hardware.nix diff --git a/modules/software/janitor/janitor-backend.nix b/modules/system/janitor/backend.nix similarity index 100% rename from modules/software/janitor/janitor-backend.nix rename to modules/system/janitor/backend.nix diff --git a/modules/software/janitor/janitor.nix b/modules/system/janitor/default.nix similarity index 100% rename from modules/software/janitor/janitor.nix rename to modules/system/janitor/default.nix diff --git a/modules/core/network/cloudflare-warp.nix b/modules/system/network/cloudflare-warp.nix similarity index 100% rename from modules/core/network/cloudflare-warp.nix rename to modules/system/network/cloudflare-warp.nix diff --git a/modules/core/network/dns.nix b/modules/system/network/dns.nix similarity index 100% rename from modules/core/network/dns.nix rename to modules/system/network/dns.nix diff --git a/modules/core/network/openssh.nix b/modules/system/network/openssh.nix similarity index 100% rename from modules/core/network/openssh.nix rename to modules/system/network/openssh.nix diff --git a/modules/core/infra/openvpn.nix b/modules/system/network/openvpn.nix similarity index 100% rename from modules/core/infra/openvpn.nix rename to modules/system/network/openvpn.nix diff --git a/modules/core/infra/syncthing.nix b/modules/system/network/syncthing.nix similarity index 100% rename from modules/core/infra/syncthing.nix rename to modules/system/network/syncthing.nix diff --git a/modules/core/infra/tailscale.nix b/modules/system/network/tailscale.nix similarity index 100% rename from modules/core/infra/tailscale.nix rename to modules/system/network/tailscale.nix diff --git a/modules/core/theme/catppuccin.nix b/modules/system/theme/catppuccin.nix similarity index 100% rename from modules/core/theme/catppuccin.nix rename to modules/system/theme/catppuccin.nix diff --git a/modules/core/theme/stylix.nix b/modules/system/theme/stylix.nix similarity index 100% rename from modules/core/theme/stylix.nix rename to modules/system/theme/stylix.nix diff --git a/modules/core/theme/stylus.nix b/modules/system/theme/stylus.nix similarity index 100% rename from modules/core/theme/stylus.nix rename to modules/system/theme/stylus.nix