From 7915f78ee382316ae5bf2a7d07d34f1c2ddf5897 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Fri, 14 Feb 2025 13:04:04 -0600 Subject: [PATCH] WIP! --- flake.lock | 704 +--------------- flake.nix | 776 +---------------- {nix/lib => lib}/colors.nix | 0 lib/default.nix | 11 + {nix => lib}/disko/default.nix | 5 +- {nix/lib => lib}/internal.md | 0 .../modules/home}/default.nix | 22 +- .../modules/home}/eww/eww.scss | 0 .../modules/home}/eww/eww.yuck | 0 .../home}/eww/scripts/battery-time.bash | 0 .../home}/eww/scripts/hypr-workspaces.bash | 0 .../home}/eww/scripts/workspaces/.gitignore | 0 .../home}/eww/scripts/workspaces/default.nix | 0 .../eww/scripts/workspaces/src/.gitignore | 0 .../eww/scripts/workspaces/src/Cargo.lock | 0 .../eww/scripts/workspaces/src/Cargo.toml | 0 .../home}/eww/scripts/workspaces/src/main.rs | 0 .../home}/fish/interactiveShellInit.fish | 0 .../modules/home}/fish/shellInit.fish | 0 .../modules/home}/ghostty/config | 0 .../themes/catppuccin-mocha-sapphire-custom | 0 .../modules/home}/hyprland.nix | 0 .../modules/home}/kitty.nix | 0 .../modules/home}/niri/config.kdl | 0 .../modules/home}/plasma-manager.nix | 0 .../modules/home}/scripts/common/bin/? | 0 .../modules/home}/scripts/common/bin/N | 0 .../modules/home}/scripts/common/bin/archive | 0 .../modules/home}/scripts/common/bin/at | 0 .../modules/home}/scripts/common/bin/bp | 0 .../common/bin/check-domain-availability | 0 .../home}/scripts/common/bin/check-port | 0 .../modules/home}/scripts/common/bin/clip | 0 .../modules/home}/scripts/common/bin/clipshot | 0 .../scripts/common/bin/copy-git-forge-url | 0 .../home}/scripts/common/bin/countdown | 0 .../modules/home}/scripts/common/bin/dns | 0 .../home}/scripts/common/bin/dns-cleaner | 0 .../home}/scripts/common/bin/dns-deleter | 0 .../scripts/common/bin/dns-deleter-matching | 0 .../home}/scripts/common/bin/docker-compose | 0 .../home}/scripts/common/bin/editscrot | 0 .../scripts/common/bin/email-via-mailgun-smtp | 0 .../modules/home}/scripts/common/bin/emoji | 0 .../modules/home}/scripts/common/bin/ezln | 0 .../modules/home}/scripts/common/bin/field | 0 .../modules/home}/scripts/common/bin/getip | 0 .../home}/scripts/common/bin/git-authors | 0 .../home}/scripts/common/bin/gitforge-url.ts | 0 .../home}/scripts/common/bin/glancepath | 0 .../home}/scripts/common/bin/good-morning | 0 .../home}/scripts/common/bin/has_command | 0 .../home}/scripts/common/bin/is_wayland | 0 .../modules/home}/scripts/common/bin/j | 0 .../home}/scripts/common/bin/k8s-yaml-diff | 0 .../home}/scripts/common/bin/k8s-yaml-sort | 0 .../home}/scripts/common/bin/keyrepeat | 0 .../modules/home}/scripts/common/bin/kubeline | 0 .../modules/home}/scripts/common/bin/kubfc | 0 .../modules/home}/scripts/common/bin/kubfn | 0 .../modules/home}/scripts/common/bin/launch | 0 .../modules/home}/scripts/common/bin/linewise | 0 .../scripts/common/bin/maybe_source_env_file | 0 .../modules/home}/scripts/common/bin/nd | 0 .../modules/home}/scripts/common/bin/nf | 0 .../modules/home}/scripts/common/bin/note | 0 .../modules/home}/scripts/common/bin/nsync | 0 .../modules/home}/scripts/common/bin/nvimdiff | 0 .../scripts/common/bin/open-in-git-forge | 0 .../scripts/common/bin/optimize-photo-for-web | 0 .../common/bin/pass-migrate-to-pass-otp | 0 .../modules/home}/scripts/common/bin/pipeline | 0 .../modules/home}/scripts/common/bin/poll | 0 .../home}/scripts/common/bin/pr-for-commit | 0 .../home}/scripts/common/bin/readme.md | 0 .../modules/home}/scripts/common/bin/remote | 0 .../home}/scripts/common/bin/resource-usage | 0 .../modules/home}/scripts/common/bin/s | 0 .../modules/home}/scripts/common/bin/scn | 0 .../home}/scripts/common/bin/screenshot | 0 .../modules/home}/scripts/common/bin/scrup | 0 .../modules/home}/scripts/common/bin/scwd | 0 .../modules/home}/scripts/common/bin/setbg | 0 .../home}/scripts/common/bin/source_if_exists | 0 .../modules/home}/scripts/common/bin/spark | 0 .../modules/home}/scripts/common/bin/sw | 0 .../modules/home}/scripts/common/bin/t | 0 .../modules/home}/scripts/common/bin/td | 0 .../modules/home}/scripts/common/bin/tdf | 0 .../common/bin/terminal-rendering-test | 0 .../modules/home}/scripts/common/bin/termrec | 0 .../modules/home}/scripts/common/bin/tls | 0 .../home}/scripts/common/bin/tmux-edit-buffer | 0 .../scripts/common/bin/tmux-lyte-session | 0 .../home}/scripts/common/bin/tmux-save-buffer | 0 .../home}/scripts/common/bin/tmux-session-dir | 0 .../scripts/common/bin/tmux-session-preview | 0 .../home}/scripts/common/bin/tmuxswitcher | 0 .../home}/scripts/common/bin/unarchive | 0 .../modules/home}/scripts/common/bin/weather | 0 .../modules/home}/scripts/common/bin/yamldiff | 0 .../home}/scripts/linux/bin/restartbar | 0 .../modules/home}/scripts/linux/bin/startbar | 0 .../modules/home}/sway-laptop.nix | 0 .../modules/home}/sway.nix | 0 .../modules/home}/swaylock.nix | 0 .../modules/home}/waybar.nix | 0 .../colors/catppuccin-mocha-sapphire.toml | 0 .../modules/home}/wezterm/wezterm.lua | 0 {nix => lib}/modules/nixos/conduwuit.nix | 0 {nix => lib}/modules/nixos/default.nix | 785 ++++++------------ .../nixos/deno-netlify-ddns-client.nix | 0 {nix => lib}/modules/nixos/gnome.nix | 0 lib/modules/nixos/shell-config.nix | 71 ++ lib/overlays/default.nix | 38 + {nix => lib}/templates/.gitignore | 0 {nix => lib}/templates/default.nix | 0 {nix => lib}/templates/deno/.envrc | 0 {nix => lib}/templates/deno/.gitignore | 0 .../templates/deno/.helix/languages.toml | 0 {nix => lib}/templates/deno/deno.json | 0 {nix => lib}/templates/deno/flake.nix | 0 {nix => lib}/templates/deno/mod.ts | 0 {nix => lib}/templates/elixir/.envrc | 0 {nix => lib}/templates/elixir/.gitignore | 0 {nix => lib}/templates/elixir/flake.nix | 0 .../templates/elixir/nix/boilerplate.nix | 0 {nix => lib}/templates/elixir/nix/checks.nix | 0 .../templates/elixir/nix/overlays.nix | 0 .../templates/elixir/nix/packages.nix | 0 {nix => lib}/templates/elixir/nix/shells.nix | 0 {nix => lib}/templates/gleam/.envrc | 0 {nix => lib}/templates/gleam/.gitignore.flake | 0 {nix => lib}/templates/gleam/flake.nix | 0 {nix => lib}/templates/godot/.envrc | 0 {nix => lib}/templates/godot/.gitignore | 0 .../templates/godot/.helix/languages.toml | 0 {nix => lib}/templates/godot/flake.nix | 0 {nix => lib}/templates/nim/.envrc | 0 {nix => lib}/templates/nim/.gitignore | 0 {nix => lib}/templates/nim/flake.nix | 0 {nix => lib}/templates/nix-flake/.envrc | 0 {nix => lib}/templates/nix-flake/.gitignore | 0 .../templates/nix-flake/.helix/languages.toml | 0 {nix => lib}/templates/nix-flake/flake.nix | 0 {nix => lib}/templates/rust/.envrc | 0 {nix => lib}/templates/rust/.gitignore | 0 {nix => lib}/templates/rust/flake.nix | 0 .../templates/rust/nix/boilerplate.nix | 0 {nix => lib}/templates/rust/nix/checks.nix | 0 {nix => lib}/templates/rust/nix/packages.nix | 0 {nix => lib}/templates/rust/nix/shells.nix | 0 nix/boilerplate.nix | 29 - nix/constants.nix | 2 +- nix/machines.nix | 438 ++++++++++ nix/nixos/dragon.nix | 177 ---- nix/overlays/default.nix | 36 - nix/packages/default.nix | 8 - nix/users.nix | 26 + {nix/packages => packages}/bitwarden.json | 0 packages/checks/default.nix | 12 + packages/default.nix | 25 + {nix/nixos => packages/hosts}/base.nix | 0 {nix/nixos => packages/hosts}/beefcake.nix | 0 {nix/nixos => packages/hosts}/bigtower.nix | 0 packages/hosts/default.nix | 177 ++++ packages/hosts/dragon.nix | 49 ++ .../hosts}/factorio-versions.json | 0 {nix/nixos => packages/hosts}/foxtrot.nix | 0 {nix/nixos => packages/hosts}/htpc.nix | 0 {nix/nixos => packages/hosts}/htpifour.nix | 0 {nix/nixos => packages/hosts}/rascal.nix | 0 {nix/nixos => packages/hosts}/router.nix | 0 {nix/nixos => packages/hosts}/thablet.nix | 0 {nix/nixos => packages/hosts}/thinker.nix | 0 .../packages => packages}/iosevkaLyteTerm.nix | 0 .../iosevkaLyteTermSubset.nix | 0 packages/shells/default.nix | 13 + 178 files changed, 1151 insertions(+), 2253 deletions(-) rename {nix/lib => lib}/colors.nix (100%) create mode 100644 lib/default.nix rename {nix => lib}/disko/default.nix (99%) rename {nix/lib => lib}/internal.md (100%) rename {nix/modules/home-manager => lib/modules/home}/default.nix (99%) rename {nix/modules/home-manager => lib/modules/home}/eww/eww.scss (100%) rename {nix/modules/home-manager => lib/modules/home}/eww/eww.yuck (100%) rename {nix/modules/home-manager => lib/modules/home}/eww/scripts/battery-time.bash (100%) rename {nix/modules/home-manager => lib/modules/home}/eww/scripts/hypr-workspaces.bash (100%) rename {nix/modules/home-manager => lib/modules/home}/eww/scripts/workspaces/.gitignore (100%) rename {nix/modules/home-manager => lib/modules/home}/eww/scripts/workspaces/default.nix (100%) rename {nix/modules/home-manager => lib/modules/home}/eww/scripts/workspaces/src/.gitignore (100%) rename {nix/modules/home-manager => lib/modules/home}/eww/scripts/workspaces/src/Cargo.lock (100%) rename {nix/modules/home-manager => lib/modules/home}/eww/scripts/workspaces/src/Cargo.toml (100%) rename {nix/modules/home-manager => lib/modules/home}/eww/scripts/workspaces/src/main.rs (100%) rename {nix/modules/home-manager => lib/modules/home}/fish/interactiveShellInit.fish (100%) rename {nix/modules/home-manager => lib/modules/home}/fish/shellInit.fish (100%) rename {nix/modules/home-manager => lib/modules/home}/ghostty/config (100%) rename {nix/modules/home-manager => lib/modules/home}/ghostty/themes/catppuccin-mocha-sapphire-custom (100%) rename {nix/modules/home-manager => lib/modules/home}/hyprland.nix (100%) rename {nix/modules/home-manager => lib/modules/home}/kitty.nix (100%) rename {nix/modules/home-manager => lib/modules/home}/niri/config.kdl (100%) rename {nix/modules/home-manager => lib/modules/home}/plasma-manager.nix (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/? (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/N (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/archive (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/at (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/bp (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/check-domain-availability (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/check-port (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/clip (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/clipshot (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/copy-git-forge-url (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/countdown (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/dns (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/dns-cleaner (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/dns-deleter (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/dns-deleter-matching (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/docker-compose (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/editscrot (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/email-via-mailgun-smtp (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/emoji (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/ezln (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/field (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/getip (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/git-authors (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/gitforge-url.ts (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/glancepath (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/good-morning (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/has_command (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/is_wayland (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/j (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/k8s-yaml-diff (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/k8s-yaml-sort (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/keyrepeat (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/kubeline (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/kubfc (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/kubfn (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/launch (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/linewise (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/maybe_source_env_file (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/nd (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/nf (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/note (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/nsync (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/nvimdiff (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/open-in-git-forge (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/optimize-photo-for-web (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/pass-migrate-to-pass-otp (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/pipeline (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/poll (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/pr-for-commit (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/readme.md (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/remote (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/resource-usage (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/s (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/scn (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/screenshot (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/scrup (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/scwd (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/setbg (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/source_if_exists (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/spark (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/sw (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/t (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/td (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/tdf (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/terminal-rendering-test (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/termrec (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/tls (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/tmux-edit-buffer (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/tmux-lyte-session (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/tmux-save-buffer (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/tmux-session-dir (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/tmux-session-preview (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/tmuxswitcher (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/unarchive (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/weather (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/common/bin/yamldiff (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/linux/bin/restartbar (100%) rename {nix/modules/home-manager => lib/modules/home}/scripts/linux/bin/startbar (100%) rename {nix/modules/home-manager => lib/modules/home}/sway-laptop.nix (100%) rename {nix/modules/home-manager => lib/modules/home}/sway.nix (100%) rename {nix/modules/home-manager => lib/modules/home}/swaylock.nix (100%) rename {nix/modules/home-manager => lib/modules/home}/waybar.nix (100%) rename {nix/modules/home-manager => lib/modules/home}/wezterm/colors/catppuccin-mocha-sapphire.toml (100%) rename {nix/modules/home-manager => lib/modules/home}/wezterm/wezterm.lua (100%) rename {nix => lib}/modules/nixos/conduwuit.nix (100%) rename {nix => lib}/modules/nixos/default.nix (61%) rename {nix => lib}/modules/nixos/deno-netlify-ddns-client.nix (100%) rename {nix => lib}/modules/nixos/gnome.nix (100%) create mode 100644 lib/modules/nixos/shell-config.nix create mode 100644 lib/overlays/default.nix rename {nix => lib}/templates/.gitignore (100%) rename {nix => lib}/templates/default.nix (100%) rename {nix => lib}/templates/deno/.envrc (100%) rename {nix => lib}/templates/deno/.gitignore (100%) rename {nix => lib}/templates/deno/.helix/languages.toml (100%) rename {nix => lib}/templates/deno/deno.json (100%) rename {nix => lib}/templates/deno/flake.nix (100%) rename {nix => lib}/templates/deno/mod.ts (100%) rename {nix => lib}/templates/elixir/.envrc (100%) rename {nix => lib}/templates/elixir/.gitignore (100%) rename {nix => lib}/templates/elixir/flake.nix (100%) rename {nix => lib}/templates/elixir/nix/boilerplate.nix (100%) rename {nix => lib}/templates/elixir/nix/checks.nix (100%) rename {nix => lib}/templates/elixir/nix/overlays.nix (100%) rename {nix => lib}/templates/elixir/nix/packages.nix (100%) rename {nix => lib}/templates/elixir/nix/shells.nix (100%) rename {nix => lib}/templates/gleam/.envrc (100%) rename {nix => lib}/templates/gleam/.gitignore.flake (100%) rename {nix => lib}/templates/gleam/flake.nix (100%) rename {nix => lib}/templates/godot/.envrc (100%) rename {nix => lib}/templates/godot/.gitignore (100%) rename {nix => lib}/templates/godot/.helix/languages.toml (100%) rename {nix => lib}/templates/godot/flake.nix (100%) rename {nix => lib}/templates/nim/.envrc (100%) rename {nix => lib}/templates/nim/.gitignore (100%) rename {nix => lib}/templates/nim/flake.nix (100%) rename {nix => lib}/templates/nix-flake/.envrc (100%) rename {nix => lib}/templates/nix-flake/.gitignore (100%) rename {nix => lib}/templates/nix-flake/.helix/languages.toml (100%) rename {nix => lib}/templates/nix-flake/flake.nix (100%) rename {nix => lib}/templates/rust/.envrc (100%) rename {nix => lib}/templates/rust/.gitignore (100%) rename {nix => lib}/templates/rust/flake.nix (100%) rename {nix => lib}/templates/rust/nix/boilerplate.nix (100%) rename {nix => lib}/templates/rust/nix/checks.nix (100%) rename {nix => lib}/templates/rust/nix/packages.nix (100%) rename {nix => lib}/templates/rust/nix/shells.nix (100%) create mode 100644 nix/machines.nix delete mode 100644 nix/nixos/dragon.nix delete mode 100644 nix/overlays/default.nix delete mode 100644 nix/packages/default.nix create mode 100644 nix/users.nix rename {nix/packages => packages}/bitwarden.json (100%) create mode 100644 packages/checks/default.nix create mode 100644 packages/default.nix rename {nix/nixos => packages/hosts}/base.nix (100%) rename {nix/nixos => packages/hosts}/beefcake.nix (100%) rename {nix/nixos => packages/hosts}/bigtower.nix (100%) create mode 100644 packages/hosts/default.nix create mode 100644 packages/hosts/dragon.nix rename {nix/nixos => packages/hosts}/factorio-versions.json (100%) rename {nix/nixos => packages/hosts}/foxtrot.nix (100%) rename {nix/nixos => packages/hosts}/htpc.nix (100%) rename {nix/nixos => packages/hosts}/htpifour.nix (100%) rename {nix/nixos => packages/hosts}/rascal.nix (100%) rename {nix/nixos => packages/hosts}/router.nix (100%) rename {nix/nixos => packages/hosts}/thablet.nix (100%) rename {nix/nixos => packages/hosts}/thinker.nix (100%) rename {nix/packages => packages}/iosevkaLyteTerm.nix (100%) rename {nix/packages => packages}/iosevkaLyteTermSubset.nix (100%) create mode 100644 packages/shells/default.nix diff --git a/flake.lock b/flake.lock index f743aa6..db01ec5 100644 --- a/flake.lock +++ b/flake.lock @@ -1,38 +1,5 @@ { "nodes": { - "aquamarine": { - "inputs": { - "hyprutils": [ - "hyprland", - "hyprutils" - ], - "hyprwayland-scanner": [ - "hyprland", - "hyprwayland-scanner" - ], - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1738183445, - "narHash": "sha256-C1He3N1SA8D2u+TSlldbA9wiYwDvXI4GxX3zKaeD7qU=", - "owner": "hyprwm", - "repo": "aquamarine", - "rev": "48a000cf35dd10bfeb231152735aebbe875f4b74", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "aquamarine", - "type": "github" - } - }, "crane": { "locked": { "lastModified": 1737563566, @@ -117,22 +84,6 @@ "type": "github" } }, - "flake-compat_4": { - "flake": false, - "locked": { - "lastModified": 1696426674, - "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, "flake-utils": { "inputs": { "systems": "systems" @@ -169,41 +120,6 @@ "type": "github" } }, - "flake-utils_3": { - "inputs": { - "systems": "systems_5" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "freetype2": { - "flake": false, - "locked": { - "lastModified": 1723459814, - "narHash": "sha256-4l90lDtpgm5xlh2m7ifrqNy373DTRTULRkAzicrM93c=", - "owner": "freetype", - "repo": "freetype", - "rev": "42608f77f20749dd6ddc9e0536788eaad70ea4b5", - "type": "github" - }, - "original": { - "owner": "freetype", - "ref": "VER-2-13-3", - "repo": "freetype", - "type": "github" - } - }, "ghostty": { "inputs": { "flake-compat": "flake-compat", @@ -234,7 +150,7 @@ "flake-compat": "flake-compat_2", "gitignore": "gitignore", "nixpkgs": [ - "nixpkgs" + "nixpkgs-unstable" ] }, "locked": { @@ -253,8 +169,8 @@ }, "git-hooks_2": { "inputs": { - "flake-compat": "flake-compat_4", - "gitignore": "gitignore_3", + "flake-compat": "flake-compat_3", + "gitignore": "gitignore_2", "nixpkgs": [ "slippi", "nixpkgs" @@ -297,28 +213,6 @@ } }, "gitignore_2": { - "inputs": { - "nixpkgs": [ - "hyprland", - "pre-commit-hooks", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1709087332, - "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", - "type": "github" - } - }, - "gitignore_3": { "inputs": { "nixpkgs": [ "slippi", @@ -342,36 +236,19 @@ }, "hardware": { "locked": { - "lastModified": 1735388221, - "narHash": "sha256-e5IOgjQf0SZcFCEV/gMGrsI0gCJyqOKShBQU0iiM3Kg=", - "owner": "nixos", + "lastModified": 1738816619, + "narHash": "sha256-5yRlg48XmpcX5b5HesdGMOte+YuCy9rzQkJz+imcu6I=", + "owner": "NixOS", "repo": "nixos-hardware", - "rev": "7c674c6734f61157e321db595dbfcd8523e04e19", + "rev": "2eccff41bab80839b1d25b303b53d339fbb07087", "type": "github" }, "original": { - "owner": "nixos", + "owner": "NixOS", "repo": "nixos-hardware", "type": "github" } }, - "harfbuzz": { - "flake": false, - "locked": { - "lastModified": 1719502711, - "narHash": "sha256-2ieCf3ftNk851FZBDPVl+7QHWBqD729KiUxUyxi26Yg=", - "owner": "harfbuzz", - "repo": "harfbuzz", - "rev": "9c03576c49db6e7207d9bcdfe3abd170a809157f", - "type": "github" - }, - "original": { - "owner": "harfbuzz", - "ref": "9.0.0", - "repo": "harfbuzz", - "type": "github" - } - }, "helix": { "inputs": { "crane": "crane", @@ -437,347 +314,6 @@ "type": "github" } }, - "hyprcursor": { - "inputs": { - "hyprlang": [ - "hyprland", - "hyprlang" - ], - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1738178255, - "narHash": "sha256-+D6Nu2ewXbMTFzx/Q4jDOo+LAOUPr0cxQJg5k33daIE=", - "owner": "hyprwm", - "repo": "hyprcursor", - "rev": "dcadd3398abe146d60c67e0d9ee6e27b301cae82", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprcursor", - "type": "github" - } - }, - "hyprgraphics": { - "inputs": { - "hyprutils": [ - "hyprland", - "hyprutils" - ], - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1738018829, - "narHash": "sha256-5Ol5iahMlELx3lWuChyZsqqLk6sP6aqaJCJFw92OZGo=", - "owner": "hyprwm", - "repo": "hyprgraphics", - "rev": "12cd7034e441a5ebfdef1a090c0788413b4a635b", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprgraphics", - "type": "github" - } - }, - "hyprgrass": { - "inputs": { - "hyprland": [ - "hyprland" - ] - }, - "locked": { - "lastModified": 1737873323, - "narHash": "sha256-khgZJjtm+sLq0nWtugtvrRtNJ19Qnk4JnEs19VMk0Qw=", - "owner": "horriblename", - "repo": "hyprgrass", - "rev": "ff3eb4c9147c89f04533bd2e2fe42e94232bc3b0", - "type": "github" - }, - "original": { - "owner": "horriblename", - "repo": "hyprgrass", - "type": "github" - } - }, - "hyprland": { - "inputs": { - "aquamarine": "aquamarine", - "hyprcursor": "hyprcursor", - "hyprgraphics": "hyprgraphics", - "hyprland-protocols": "hyprland-protocols", - "hyprland-qtutils": "hyprland-qtutils", - "hyprlang": "hyprlang", - "hyprutils": "hyprutils", - "hyprwayland-scanner": "hyprwayland-scanner", - "nixpkgs": [ - "nixpkgs-unstable" - ], - "pre-commit-hooks": "pre-commit-hooks", - "systems": "systems_3", - "xdph": "xdph" - }, - "locked": { - "lastModified": 1738236612, - "narHash": "sha256-fJ6VwFCp1w/CA+ONo9Ix+0JuGef5kHnfy/KWzOpSkWc=", - "owner": "hyprwm", - "repo": "Hyprland", - "rev": "32c0fa2f2fe02254d5887b38cf2cffa72ddfd769", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "Hyprland", - "type": "github" - } - }, - "hyprland-protocols": { - "inputs": { - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1737556638, - "narHash": "sha256-laKgI3mr2qz6tas/q3tuGPxMdsGhBi/w+HO+hO2f1AY=", - "owner": "hyprwm", - "repo": "hyprland-protocols", - "rev": "4c75dd5c015c8a0e5a34c6d02a018a650f57feb5", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprland-protocols", - "type": "github" - } - }, - "hyprland-qt-support": { - "inputs": { - "hyprlang": [ - "hyprland", - "hyprland-qtutils", - "hyprlang" - ], - "nixpkgs": [ - "hyprland", - "hyprland-qtutils", - "nixpkgs" - ], - "systems": [ - "hyprland", - "hyprland-qtutils", - "systems" - ] - }, - "locked": { - "lastModified": 1737634706, - "narHash": "sha256-nGCibkfsXz7ARx5R+SnisRtMq21IQIhazp6viBU8I/A=", - "owner": "hyprwm", - "repo": "hyprland-qt-support", - "rev": "8810df502cdee755993cb803eba7b23f189db795", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprland-qt-support", - "type": "github" - } - }, - "hyprland-qtutils": { - "inputs": { - "hyprland-qt-support": "hyprland-qt-support", - "hyprlang": [ - "hyprland", - "hyprlang" - ], - "hyprutils": [ - "hyprland", - "hyprland-qtutils", - "hyprlang", - "hyprutils" - ], - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1737981711, - "narHash": "sha256-lh6cL5D8nPplB3WovCQjLUZ7k7MViiBrMlpkfm4R7/c=", - "owner": "hyprwm", - "repo": "hyprland-qtutils", - "rev": "96bf0677fa9cd13508294e3d4559dfbbc8beff73", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprland-qtutils", - "type": "github" - } - }, - "hyprlang": { - "inputs": { - "hyprutils": [ - "hyprland", - "hyprutils" - ], - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1737634606, - "narHash": "sha256-W7W87Cv6wqZ9PHegI6rH1+ve3zJPiyevMFf0/HwdbCQ=", - "owner": "hyprwm", - "repo": "hyprlang", - "rev": "f41271d35cc0f370d300413d756c2677f386af9d", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprlang", - "type": "github" - } - }, - "hyprutils": { - "inputs": { - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1737978343, - "narHash": "sha256-TfFS0HCEJh63Kahrkp1h9hVDMdLU8a37Zz+IFucxyfA=", - "owner": "hyprwm", - "repo": "hyprutils", - "rev": "6a8bc9d2a4451df12f5179dc0b1d2d46518a90ab", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprutils", - "type": "github" - } - }, - "hyprwayland-scanner": { - "inputs": { - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1735493474, - "narHash": "sha256-fktzv4NaqKm94VAkAoVqO/nqQlw+X0/tJJNAeCSfzK4=", - "owner": "hyprwm", - "repo": "hyprwayland-scanner", - "rev": "de913476b59ee88685fdc018e77b8f6637a2ae0b", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "hyprwayland-scanner", - "type": "github" - } - }, - "iio-hyprland": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ], - "systems": "systems_4" - }, - "locked": { - "lastModified": 1727632156, - "narHash": "sha256-gfH/jcrmI27OEge8OGPe7JpC0jrQJuX7v9hM/ObjjW8=", - "owner": "JeanSchoeller", - "repo": "iio-hyprland", - "rev": "bd6be6b7e0fbc8ca1a5ccbf536602838e52c347e", - "type": "github" - }, - "original": { - "owner": "JeanSchoeller", - "repo": "iio-hyprland", - "type": "github" - } - }, - "jovian": { - "inputs": { - "nix-github-actions": "nix-github-actions", - "nixpkgs": [ - "nixpkgs-unstable" - ] - }, - "locked": { - "lastModified": 1735931035, - "narHash": "sha256-f3WRxasPYVKzrvAlLq+/3FRHQVfxVf5xxf0WWwnO99k=", - "owner": "Jovian-Experiments", - "repo": "Jovian-NixOS", - "rev": "7e530766a5fd9b7577296fedd655f3255f7495d8", - "type": "github" - }, - "original": { - "owner": "Jovian-Experiments", - "ref": "development", - "repo": "Jovian-NixOS", - "type": "github" - } - }, - "libpng": { - "flake": false, - "locked": { - "lastModified": 1726173884, - "narHash": "sha256-gBfHgGaqVYdmhWXoNKZzPyGzyw2rr3zp+DjWmfC41jk=", - "owner": "pnggroup", - "repo": "libpng", - "rev": "f5e92d76973a7a53f517579bc95d61483bf108c0", - "type": "github" - }, - "original": { - "owner": "pnggroup", - "ref": "v1.6.44", - "repo": "libpng", - "type": "github" - } - }, "mobile-nixos": { "flake": false, "locked": { @@ -794,39 +330,17 @@ "type": "github" } }, - "nix-github-actions": { - "inputs": { - "nixpkgs": [ - "jovian", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1729697500, - "narHash": "sha256-VFTWrbzDlZyFHHb1AlKRiD/qqCJIripXKiCSFS8fAOY=", - "owner": "zhaofengli", - "repo": "nix-github-actions", - "rev": "e418aeb728b6aa5ca8c5c71974e7159c2df1d8cf", - "type": "github" - }, - "original": { - "owner": "zhaofengli", - "ref": "matrix-name", - "repo": "nix-github-actions", - "type": "github" - } - }, "nixpkgs": { "locked": { - "lastModified": 1739055578, - "narHash": "sha256-2MhC2Bgd06uI1A0vkdNUyDYsMD0SLNGKtD8600mZ69A=", - "owner": "nixos", + "lastModified": 1739357830, + "narHash": "sha256-9xim3nJJUFbVbJCz48UP4fGRStVW5nv4VdbimbKxJ3I=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "a45fa362d887f4d4a7157d95c28ca9ce2899b70e", + "rev": "0ff09db9d034a04acd4e8908820ba0b410d7a33a", "type": "github" }, "original": { - "owner": "nixos", + "owner": "NixOS", "ref": "nixos-24.11", "repo": "nixpkgs", "type": "github" @@ -850,43 +364,20 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1736042175, - "narHash": "sha256-jdd5UWtLVrNEW8K6u5sy5upNAFmF3S4Y+OIeToqJ1X8=", - "owner": "nixos", + "lastModified": 1739451785, + "narHash": "sha256-3ebRdThRic9bHMuNi2IAA/ek9b32bsy8F5R4SvGTIog=", + "owner": "NixOS", "repo": "nixpkgs", - "rev": "bf689c40d035239a489de5997a4da5352434632e", + "rev": "1128e89fd5e11bb25aedbfc287733c6502202ea9", "type": "github" }, "original": { - "owner": "nixos", + "owner": "NixOS", "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, - "pre-commit-hooks": { - "inputs": { - "flake-compat": "flake-compat_3", - "gitignore": "gitignore_2", - "nixpkgs": [ - "hyprland", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1737465171, - "narHash": "sha256-R10v2hoJRLq8jcL4syVFag7nIGE7m13qO48wRIukWNg=", - "owner": "cachix", - "repo": "git-hooks.nix", - "rev": "9364dc02281ce2d37a1f55b6e51f7c0f65a75f17", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "git-hooks.nix", - "type": "github" - } - }, "root": { "inputs": { "disko": "disko", @@ -896,16 +387,11 @@ "helix": "helix", "home-manager": "home-manager", "home-manager-unstable": "home-manager-unstable", - "hyprgrass": "hyprgrass", - "hyprland": "hyprland", - "iio-hyprland": "iio-hyprland", - "jovian": "jovian", "mobile-nixos": "mobile-nixos", "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable", "slippi": "slippi", - "sops-nix": "sops-nix", - "wezterm": "wezterm" + "sops-nix": "sops-nix" } }, "rust-overlay": { @@ -929,27 +415,6 @@ "type": "github" } }, - "rust-overlay_2": { - "inputs": { - "nixpkgs": [ - "wezterm", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1735871325, - "narHash": "sha256-6Ta5E4mhSfCP6LdkzkG2+BciLOCPeLKuYTJ6lOHW+mI=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "a599f011db521766cbaf7c2f5874182485554f00", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, "slippi": { "inputs": { "git-hooks": "git-hooks_2", @@ -1024,120 +489,6 @@ "type": "github" } }, - "systems_3": { - "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", - "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default-linux", - "type": "github" - } - }, - "systems_4": { - "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", - "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default-linux", - "type": "github" - } - }, - "systems_5": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "wezterm": { - "inputs": { - "flake-utils": "flake-utils_3", - "freetype2": "freetype2", - "harfbuzz": "harfbuzz", - "libpng": "libpng", - "nixpkgs": [ - "nixpkgs-unstable" - ], - "rust-overlay": "rust-overlay_2", - "zlib": "zlib" - }, - "locked": { - "dir": "nix", - "lastModified": 1737758457, - "narHash": "sha256-Z50/JcMQI2R9ttEd20gXEhuAXvAI0yp3bM7j6/Xoi+A=", - "owner": "wez", - "repo": "wezterm", - "rev": "4bf0007cefff7f1ad139d89b54f074d5ad7d2184", - "type": "github" - }, - "original": { - "dir": "nix", - "owner": "wez", - "repo": "wezterm", - "type": "github" - } - }, - "xdph": { - "inputs": { - "hyprland-protocols": [ - "hyprland", - "hyprland-protocols" - ], - "hyprlang": [ - "hyprland", - "hyprlang" - ], - "hyprutils": [ - "hyprland", - "hyprutils" - ], - "hyprwayland-scanner": [ - "hyprland", - "hyprwayland-scanner" - ], - "nixpkgs": [ - "hyprland", - "nixpkgs" - ], - "systems": [ - "hyprland", - "systems" - ] - }, - "locked": { - "lastModified": 1737634991, - "narHash": "sha256-dBAnb7Kbnier30cA7AgxVSxxARmxKZ1vHZT33THSIr8=", - "owner": "hyprwm", - "repo": "xdg-desktop-portal-hyprland", - "rev": "e09dfe2726c8008f983e45a0aa1a3b7416aaeb8a", - "type": "github" - }, - "original": { - "owner": "hyprwm", - "repo": "xdg-desktop-portal-hyprland", - "type": "github" - } - }, "zig": { "inputs": { "flake-compat": [ @@ -1162,23 +513,6 @@ "repo": "zig-overlay", "type": "github" } - }, - "zlib": { - "flake": false, - "locked": { - "lastModified": 1705948357, - "narHash": "sha256-TkPLWSN5QcPlL9D0kc/yhH0/puE9bFND24aj5NVDKYs=", - "owner": "madler", - "repo": "zlib", - "rev": "51b7f2abdade71cd9bb0e7a373ef2610ec6f9daf", - "type": "github" - }, - "original": { - "owner": "madler", - "ref": "v1.3.1", - "repo": "zlib", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index dcab732..2617159 100644 --- a/flake.nix +++ b/flake.nix @@ -1,769 +1,33 @@ { - outputs = { - self, - nixpkgs-unstable, - home-manager-unstable, - nixpkgs, - home-manager, - disko, - sops-nix, - git-hooks, - helix, - hardware, - # nnf, - # hyprland, - slippi, - ghostty, - }: let - inherit (self) outputs; - inherit (outputs) nixosModules homeManagerModules overlays; + outputs = inputs: let + lib = import ./lib inputs; + in + { + packages = lib.genPkgs inputs.nixpkgs-unstable (import ./packages); - /* - moduleArgs = { - # inherit style; - inherit helix slippi hyprland hardware disko home-manager; - inherit (outputs) nixosModules homeManagerModules diskoConfigurations overlays; - }; - */ + nixosConfigurations = import ./packages/hosts inputs; + # homeConfigurations = import ./packages/users; - pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAPLXOjupz3ScYjgrF+ehrbp9OvGAWQLI6fplX6w9Ijb daniel@lyte.dev"; - in { - /* - kind of a quirk, but package definitions are actually in the "additions" - overlay I did this to work around some recursion problems - TODO: https://discourse.nixos.org/t/infinite-recursion-getting-started-with-overlays/48880 - */ - packages = genPkgs (pkgs: {inherit (pkgs) iosevkaLyteTerm iosevkaLyteTermSubset nix-base-container-image;}); - diskoConfigurations = import ./disko {inherit (nixpkgs) lib;}; - templates = import ./templates; - formatter = genPkgs (p: p.alejandra); + templates = import ./lib/templates; - checks = genPkgs ({system, ...}: { - git-hooks = git-hooks.lib.${system}.run { - src = ./.; - hooks = { - alejandra.enable = true; - }; - }; - }); + diskoConfigurations = import ./lib/disko inputs; + checks = import ./packages/checks; + devShells = import ./packages/shells; - devShells = genPkgs ({ - system, - pkgs, - mkShell, - ... - }: { - default = mkShell { - inherit (outputs.checks.${system}.git-hooks) shellHook; - packages = with pkgs; [ - lua-language-server - nodePackages.bash-language-server - ]; - }; - }); + nixosModules = import ./lib/modules/nixos inputs; + homeManagerModules = import ./lib/modules/home inputs; - overlays = { - # the default overlay composes all the other overlays together - default = final: prev: { - overlays = with overlays; [ - additions - modifications - unstable-packages - ]; - }; + # overlays = import ./lib/overlays inputs; - additions = final: prev: let - iosevkaLyteTerm = prev.callPackage ./packages/iosevkaLyteTerm.nix {}; - in { - inherit iosevkaLyteTerm; - iosevkaLyteTermSubset = prev.callPackage ./packages/iosevkaLyteTermSubset.nix { - inherit iosevkaLyteTerm; - }; - conduwuit = prev.callPackage ./packages/conduwuit.nix {}; - nix-base-container-image = final.dockerTools.buildImageWithNixDb { - name = "git.lyte.dev/lytedev/nix"; - tag = "latest"; - - copyToRoot = with final; [ - bash - coreutils - curl - gawk - gitFull - git-lfs - gnused - nodejs - wget - sudo - nixVersions.stable - cacert - gnutar - gzip - openssh - xz - (pkgs.writeTextFile { - name = "nix.conf"; - destination = "/etc/nix/nix.conf"; - text = '' - accept-flake-config = true - experimental-features = nix-command flakes - build-users-group = - substituters = https://nix.h.lyte.dev https://cache.nixos.org/ - trusted-substituters = https://nix.h.lyte.dev https://cache.nixos.org/ - trusted-public-keys = h.lyte.dev:HeVWtne31ZG8iMf+c15VY3/Mky/4ufXlfTpT8+4Xbs0= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - ''; - }) - ]; - - extraCommands = '' - # enable /usr/bin/env for scripts - mkdir -p usr - ln -s ../bin usr/bin - - # create /tmp - mkdir -p tmp - - # create HOME - mkdir -vp root - ''; - config = { - Cmd = ["/bin/bash"]; - Env = [ - "LANG=en_GB.UTF-8" - "ENV=/etc/profile.d/nix.sh" - "BASH_ENV=/etc/profile.d/nix.sh" - "NIX_BUILD_SHELL=/bin/bash" - "PAGER=cat" - "PATH=/usr/bin:/bin" - "SSL_CERT_FILE=${final.cacert}/etc/ssl/certs/ca-bundle.crt" - "USER=root" - ]; - }; - }; - }; - - modifications = final: prev: let - helix-input = helix; - wezterm-input = wezterm; - ghostty-input = ghostty; - hyprland-input = hyprland; - in rec { - helix = helix-input.outputs.packages.${prev.system}.helix; - final.helix = helix; - ghostty = ghostty-input.outputs.packages.${prev.system}.ghostty; - final.ghostty = ghostty; - /* - TODO: would love to use a current wezterm build so I can make use of ssh/mux functionality without breakage - source: https://github.com/wez/wezterm/issues/3771 - not-yet-merged (abandoned?): https://github.com/wez/wezterm/pull/4737 - I did try using the latest code via the flake, but alas it did not resolve my issues with mux'ing - */ - wezterm = wezterm-input.outputs.packages.${prev.system}.default; - # wezterm = (import nixpkgs {inherit (prev) system;}).wezterm; - final.wezterm = wezterm; - - hyprland = hyprland-input.outputs.packages.${prev.system}.default; - final.hyprland = hyprland; - - bitwarden = prev.bitwarden.overrideAttrs (old: { - preBuild = '' - ${old.preBuild} - pushd apps/desktop/desktop_native/proxy - cargo build --bin desktop_proxy --release - popd - ''; - - postInstall = '' - mkdir -p $out/bin - cp -r apps/desktop/desktop_native/target/release/desktop_proxy $out/bin - mkdir -p $out/lib/mozilla/native-messaging-hosts - substituteAll ${./packages/bitwarden.json} $out/lib/mozilla/native-messaging-hosts/com.8bit.bitwarden.json - ''; - }); - final.bitwarden = bitwarden; - - # zellij = prev.zellij.overrideAttrs rec { - # version = "0.41.0"; - # src = prev.fetchFromGitHub { - # owner = "zellij-org"; - # repo = "zellij"; - # rev = "v0.41.0"; - # hash = "sha256-A+JVWYz0t9cVA8XZciOwDkCecsC2r5TU2O9i9rVg7do="; - # }; - # cargoDeps = prev.zellij.cargoDeps.overrideAttrs (prev.lib.const { - # name = "zellij-vendor.tar.gz"; - # inherit src; - # outputHash = "sha256-WxrMI7fV0pNsGjbNpXLr+xnMdWYkC4WxIeN4OK3ZPIE="; - # }); - # }; - # final.zellij = zellij; - }; - - unstable-packages = final: _prev: { - unstable-packages = import nixpkgs-unstable { - system = final.system; - config.allowUnfree = true; - }; - }; - }; - - nixosModules = import ./modules/nixos { - inherit home-manager home-manager-unstable helix nixosModules homeManagerModules pubkey overlays style sops-nix disko; - flakeInputs = self.inputs; - }; - - homeManagerModules = import ./modules/home-manager { - inherit home-manager home-manager-unstable helix nixosModules homeManagerModules pubkey overlays style; - inherit (nixpkgs) lib; - flakeInputs = self.inputs; - }; - - nixosConfigurations = { - beefcake = let - system = "x86_64-linux"; - in - nixpkgs.lib.nixosSystem { - inherit system; - modules = with nixosModules; [ - home-manager-defaults - conduwuit - - # TODO: disko? - hardware.nixosModules.common-cpu-intel - - outputs.nixosModules.deno-netlify-ddns-client - { - services.deno-netlify-ddns-client = { - enable = true; - username = "beefcake.h"; - # TODO: router doesn't even do ipv6 yet... - ipv6 = false; - }; - } - - family-users - common - podman - troubleshooting-tools - virtual-machines - virtual-machines-gui - linux - fonts - - ./nixos/beefcake.nix - - { - services.kanidm.package = (unstable.pkgsFor system).kanidm; - } - ]; - }; - - dragon = nixpkgs-unstable.lib.nixosSystem { - system = "x86_64-linux"; - modules = with nixosModules; [ - home-manager-unstable-defaults - - outputs.diskoConfigurations.unencrypted - hardware.nixosModules.common-cpu-amd - hardware.nixosModules.common-pc-ssd - - common - password-manager - wifi - graphical-workstation - virtual-machines - virtual-machines-gui - music-production - # plasma6 - gaming - slippi.nixosModules.default - - outputs.nixosModules.deno-netlify-ddns-client - { - services.deno-netlify-ddns-client = { - enable = true; - username = "dragon.h"; - # TODO: router doesn't even do ipv6 yet... - ipv6 = false; - }; - } - - ./nixos/dragon.nix - - { - home-manager.users.daniel = { - imports = with homeManagerModules; [ - niri - senpai - iex - cargo - firefox-no-tabs - linux-desktop-environment-config - slippi.homeManagerModules.default - ]; - }; - } - ]; - }; - - bigtower = nixpkgs-unstable.lib.nixosSystem { - system = "x86_64-linux"; - modules = with nixosModules; [ - home-manager-unstable-defaults - - hardware.nixosModules.common-pc-ssd - - common - # wifi - graphical-workstation - music-production - gaming - - ./nixos/bigtower.nix - - { - home-manager.users.daniel = { - imports = with homeManagerModules; [ - firefox-no-tabs - linux-desktop-environment-config - ]; - }; - } - ]; - }; - - htpc = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = with nixosModules; [ - home-manager-defaults - - hardware.nixosModules.common-pc-ssd - common - gaming - graphical-workstation - - ./nixos/htpc.nix - - { - home-manager.users.daniel = { - imports = with homeManagerModules; [ - linux-desktop-environment-config - ]; - }; - } - ]; - }; - - steamdeck1 = nixpkgs-unstable.lib.nixosSystem { - system = "x86_64-linux"; - modules = with nixosModules; [ - home-manager-unstable-defaults - - outputs.diskoConfigurations.unencrypted - hardware.nixosModules.common-pc-ssd - common - gaming - graphical-workstation - # plasma6 - - jovian.outputs.nixosModules.jovian - - { - networking.hostName = "steamdeck1"; - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - hardware.bluetooth.enable = true; - networking.networkmanager.enable = true; - - home-manager.users.daniel = { - imports = with homeManagerModules; [ - firefox-no-tabs - linux-desktop-environment-config - ]; - }; - } - ]; - }; - - foxtrot = nixpkgs-unstable.lib.nixosSystem { - system = "x86_64-linux"; - modules = with nixosModules; [ - home-manager-unstable-defaults - - outputs.diskoConfigurations.foxtrot - hardware.nixosModules.framework-13-7040-amd - - common - kde-connect - password-manager - graphical-workstation - # plasma6 - # virtual-machines - # virtual-machines-gui - laptop - gaming - cross-compiler - - ./nixos/foxtrot.nix - - ({pkgs, ...}: { - home-manager.users.daniel = { - imports = with homeManagerModules; [ - senpai - iex - niri - cargo - firefox-no-tabs - linux-desktop-environment-config - ]; - }; - environment.systemPackages = with pkgs; [ - fw-ectool - (writeShellApplication - { - name = "reset-wifi-module"; - runtimeInputs = with pkgs; [kmod]; - text = '' - modprobe -rv mt7921e - modprobe -v mt7921e - ''; - }) - (writeShellApplication - { - name = "perfmode"; - # we use command -v $cmd here because we only want to invoke these calls _if_ the related package is installed on the system - # otherwise, they will likely have no effect anyways - text = '' - command -v powerprofilesctl &>/dev/null && bash -x -c 'powerprofilesctl set balanced' - command -v swaymsg &>/dev/null && bash -x -c 'swaymsg output eDP-1 mode 2880x1920@120Hz' - ''; - }) - (writeShellApplication - { - name = "battmode"; - text = '' - command -v powerprofilesctl &>/dev/null && bash -x -c 'powerprofilesctl set power-saver' - command -v swaymsg &>/dev/null && bash -x -c 'swaymsg output eDP-1 mode 2880x1920@60Hz' - ''; - }) - ]; - }) - ]; - }; - - thablet = nixpkgs-unstable.lib.nixosSystem { - system = "x86_64-linux"; - modules = with nixosModules; [ - home-manager-unstable-defaults - { - _module.args = { - disk = "nvme0n1"; - esp = { - label = "ESP"; - size = "4G"; - name = "ESP"; - }; - }; - } - outputs.diskoConfigurations.standard - hardware.nixosModules.lenovo-thinkpad-x1-yoga - - common - password-manager - graphical-workstation - # plasma6 - music-production - laptop - touchscreen - gaming - - ./nixos/thablet.nix - - { - home-manager.users.daniel = { - imports = with homeManagerModules; [ - senpai - iex - cargo - firefox-no-tabs - linux-desktop-environment-config - # slippi.homeManagerModules.default - ]; - }; - } - ]; - }; + formatter = lib.genPkgs inputs.nixpkgs-unstable (p: p.nixfmt-rfc-style); /* - grablet = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = with nixosModules; [ - common - - outputs.diskoConfigurations.standard - hardware.nixosModules.common-cpu-intel-kaby-lake - hardware.nixosModules.common-pc-laptopp-ssd - graphical-workstation - laptop - gaming - - ./nixos/thablet.nix - - { - home-manager.users.daniel = { - imports = with homeManagerModules; [ - iex - cargo - linux-desktop-environment-config - ]; - }; - - powerManagement.cpuFreqGovernor = lib.mkDefault "performance"; - } - ]; - }; + TODO: nix-on-droid for phone terminal usage? mobile-nixos? + TODO: nix-darwin for work? + TODO: nixos ISO? */ - - thinker = nixpkgs-unstable.lib.nixosSystem { - system = "x86_64-linux"; - modules = with nixosModules; [ - home-manager-unstable-defaults - - { - _module.args = { - disks = ["/dev/nvme0n1"]; - swapSize = "32G"; - }; - } - outputs.diskoConfigurations.standard - hardware.nixosModules.lenovo-thinkpad-t480 - hardware.nixosModules.common-pc-laptop-ssd - - music-production - common - password-manager - graphical-workstation - # plasma6 - laptop - gaming - - ./nixos/thinker.nix - - { - home-manager.users.daniel = { - imports = with homeManagerModules; [ - senpai - iex - cargo - firefox-no-tabs - linux-desktop-environment-config - slippi.homeManagerModules.default - ]; - }; - } - ]; - }; - - musicbox = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = with nixosModules; [ - home-manager-defaults - - { - _module.args = { - disks = ["/dev/sda"]; - # swapSize = "8G"; - }; - esp = {}; - } - outputs.diskoConfigurations.unencrypted - hardware.nixosModules.common-pc-laptop-ssd - - music-production - common - graphical-workstation - wifi - - # ./nixos/musicbox.nix - - { - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - hardware.bluetooth.enable = true; - networking.networkmanager.enable = true; - - home-manager.users.daniel = { - imports = with homeManagerModules; [ - firefox-no-tabs - linux-desktop-environment-config - ]; - }; - } - ]; - }; - - rascal = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = with nixosModules; [ - home-manager-defaults - hardware.nixosModules.common-cpu-amd - common - linux - ./nixos/rascal.nix - ]; - }; - - router = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = with nixosModules; [ - home-manager-defaults - common - linux - troubleshooting-tools - - outputs.nixosModules.deno-netlify-ddns-client - { - services.deno-netlify-ddns-client = { - enable = true; - username = "router.h"; - # TODO: ipv6 - ipv6 = false; - }; - } - - /* - NOTE: maybe use this someday, but I think I need more concrete - networking knowledge before I know how to use it well. Additionally, - I can use my existing firewall configuration more easily if I manage - it directly. - nnf.nixosModules.default - */ - - ./nixos/router.nix - ]; - }; - - # pinephone-image = - # (import "${mobile-nixos}/lib/eval-with-configuration.nix" { - # configuration = with nixosModules; [ - # linux - # home-manager-defaults - - # # outputs.diskoConfigurations.unencrypted # can I even disko with an image-based installation? - # common - # wifi - - # # TODO: how do I get a minimally useful mobile environment? - # # for me, this means an on-screen keyboard and suspend support I think? - # # I can live in a tty if needed and graphical stuff can all evolve later - # # not worried about modem - # # maybe/hopefully I can pull in or define my own sxmo via nix? - # ]; - # device = "pine64-pinephone"; - # pkgs = pkgsFor "aarch64-linux"; - # }) - # .outputs - # .disk-image; - - pinephone = let - inherit (nixpkgs-unstable) lib; - in - lib.nixosSystem { - system = "aarch64-linux"; - # lib.nixosSystem { - - modules = with nixosModules; [ - { - imports = [ - (import "${mobile-nixos}/lib/configuration.nix" { - device = "pine64-pinephone"; - }) - ]; - - # nixpkgs.hostPlatform.system = "aarch64-linux"; - nixpkgs.buildPlatform = "x86_64-linux"; - - # TODO: quirk: since the pinephone kernel doesn't seem to have "rpfilter" support, firewall ain't working - networking.firewall.enable = lib.mkForce false; - - # TODO: quirk: since git send-email requires perl support, which we don't seem to have on the pinephone, we're just disabling git for now - # TODO: would likely be easier/better to somehow ignore the assertion? probably a way to do that... - programs.git.enable = lib.mkForce false; - - # this option is conflicted, presumably due to some assumption in my defaults/common config - # the sd-image module we're importing above has this set to true, so we better go with that? - # that said, I think the mobile-nixos bootloader module has this set to false, so... - # TODO: what does this mean? - boot.loader.generic-extlinux-compatible.enable = lib.mkForce true; - - # another conflicting option since I think I default to NetworkManager and this conflicts with networking.wireless.enable - networking.networkmanager.enable = lib.mkForce false; - networking.wireless.enable = lib.mkForce true; - } - - # TODO: how do I build this as a .img to flash to an SD card? - - # for testing, this seems to work `nixos-rebuild build --impure --flake .#pinephone` - - # TODO: would like to use the mobile-nixos installer? - "${nixpkgs-unstable}/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix" - - linux - home-manager-unstable-defaults - - # outputs.diskoConfigurations.unencrypted # can I even disko with an image-based installation? - common - wifi - - { - system.stateVersion = "24.11"; - } - - { - # nixpkgs.buildPlatform = "x86_64-linux"; - # nixpkgs.hostPlatform = lib.systems.examples.aarch64-multiplatform; - # nixpkgs.localSystem.system = lib.systems.examples.x86_64-linux; - # nixpkgs.crossSystem = lib.mkForce null; - } - ]; - }; - }; - - images.pinephone = outputs.nixosConfigurations.pinephone.config.system.build.sdImage; - - homeConfigurations = { - "deck" = let - system = "x86_64-linux"; - pkgs = unstable.pkgsFor system; - in - home-manager-unstable.lib.homeManagerConfiguration { - inherit pkgs; - modules = with homeManagerModules; [ - common - { - home = { - homeDirectory = "/home/deck"; - username = "deck"; - stateVersion = "24.11"; - }; - } - { - home.packages = with pkgs; [ - ludusavi - rclone - ]; - } - linux - ]; - }; - }; - - /* - TODO: nix-on-droid for phone terminal usage? mobile-nixos? - TODO: nix-darwin for work? - TODO: nixos ISO? - */ - }; + } + // (import ./nix/constants.nix inputs); inputs = { # stable inputs diff --git a/nix/lib/colors.nix b/lib/colors.nix similarity index 100% rename from nix/lib/colors.nix rename to lib/colors.nix diff --git a/lib/default.nix b/lib/default.nix new file mode 100644 index 0000000..702f2d3 --- /dev/null +++ b/lib/default.nix @@ -0,0 +1,11 @@ +{self, ...}: let + forSelfOverlay = + if builtins.hasAttr "overlays" self && builtins.hasAttr "forSelf" self.overlays + then self.overlays.forSelf + else (_: p: p); +in rec { + systems = ["aarch64-linux" "aarch64-darwin" "x86_64-darwin" "x86_64-linux"]; + forSystems = nixpkgs: nixpkgs.lib.genAttrs systems; + pkgsFor = nixpkgs: system: (import nixpkgs {inherit system;}).extend forSelfOverlay; + genPkgs = nixpkgs: func: (forSystems nixpkgs (system: func (pkgsFor nixpkgs system))); +} diff --git a/nix/disko/default.nix b/lib/disko/default.nix similarity index 99% rename from nix/disko/default.nix rename to lib/disko/default.nix index 8feafe4..8ba7b20 100644 --- a/nix/disko/default.nix +++ b/lib/disko/default.nix @@ -1,4 +1,6 @@ -{lib, ...}: let +{nixpkgs-unstable, ...}: let + # TODO: This file needs some serious cleaning up. + lib = nixpkgs-unstable.lib; inherit (lib.attrsets) mapAttrs' filterAttrs; ESP = inputs @ { size ? "4G", @@ -408,6 +410,7 @@ in rec { }; }; }; + legacy = {disks, ...}: { disko.devices = { disk = { diff --git a/nix/lib/internal.md b/lib/internal.md similarity index 100% rename from nix/lib/internal.md rename to lib/internal.md diff --git a/nix/modules/home-manager/default.nix b/lib/modules/home/default.nix similarity index 99% rename from nix/modules/home-manager/default.nix rename to lib/modules/home/default.nix index dcc88ae..78c6817 100644 --- a/nix/modules/home-manager/default.nix +++ b/lib/modules/home/default.nix @@ -1,15 +1,8 @@ -{ - style, - lib, - flakeInputs, - homeManagerModules, - home-manager, - home-manager-unstable, - helix, - nixosModules, - pubkey, - overlays, -}: { +{self, ...}: let + inherit (self) outputs; + inherit (outputs) homeManagerModules constants; + inherit (constants) style; +in { bat = { programs.bat = { enable = true; @@ -636,9 +629,7 @@ config, pkgs, ... - }: let - inherit (pkgs) system; - in { + }: { # helix rust debugger stuff # https://github.com/helix-editor/helix/wiki/Debugger-Configurations home.file."${config.xdg.configHome}/lldb_vscode_rustc_primer.py" = { @@ -668,7 +659,6 @@ programs.helix = { enable = true; - package = lib.mkForce helix.packages.${system}.helix; languages = { language-server = { lexical = { diff --git a/nix/modules/home-manager/eww/eww.scss b/lib/modules/home/eww/eww.scss similarity index 100% rename from nix/modules/home-manager/eww/eww.scss rename to lib/modules/home/eww/eww.scss diff --git a/nix/modules/home-manager/eww/eww.yuck b/lib/modules/home/eww/eww.yuck similarity index 100% rename from nix/modules/home-manager/eww/eww.yuck rename to lib/modules/home/eww/eww.yuck diff --git a/nix/modules/home-manager/eww/scripts/battery-time.bash b/lib/modules/home/eww/scripts/battery-time.bash similarity index 100% rename from nix/modules/home-manager/eww/scripts/battery-time.bash rename to lib/modules/home/eww/scripts/battery-time.bash diff --git a/nix/modules/home-manager/eww/scripts/hypr-workspaces.bash b/lib/modules/home/eww/scripts/hypr-workspaces.bash similarity index 100% rename from nix/modules/home-manager/eww/scripts/hypr-workspaces.bash rename to lib/modules/home/eww/scripts/hypr-workspaces.bash diff --git a/nix/modules/home-manager/eww/scripts/workspaces/.gitignore b/lib/modules/home/eww/scripts/workspaces/.gitignore similarity index 100% rename from nix/modules/home-manager/eww/scripts/workspaces/.gitignore rename to lib/modules/home/eww/scripts/workspaces/.gitignore diff --git a/nix/modules/home-manager/eww/scripts/workspaces/default.nix b/lib/modules/home/eww/scripts/workspaces/default.nix similarity index 100% rename from nix/modules/home-manager/eww/scripts/workspaces/default.nix rename to lib/modules/home/eww/scripts/workspaces/default.nix diff --git a/nix/modules/home-manager/eww/scripts/workspaces/src/.gitignore b/lib/modules/home/eww/scripts/workspaces/src/.gitignore similarity index 100% rename from nix/modules/home-manager/eww/scripts/workspaces/src/.gitignore rename to lib/modules/home/eww/scripts/workspaces/src/.gitignore diff --git a/nix/modules/home-manager/eww/scripts/workspaces/src/Cargo.lock b/lib/modules/home/eww/scripts/workspaces/src/Cargo.lock similarity index 100% rename from nix/modules/home-manager/eww/scripts/workspaces/src/Cargo.lock rename to lib/modules/home/eww/scripts/workspaces/src/Cargo.lock diff --git a/nix/modules/home-manager/eww/scripts/workspaces/src/Cargo.toml b/lib/modules/home/eww/scripts/workspaces/src/Cargo.toml similarity index 100% rename from nix/modules/home-manager/eww/scripts/workspaces/src/Cargo.toml rename to lib/modules/home/eww/scripts/workspaces/src/Cargo.toml diff --git a/nix/modules/home-manager/eww/scripts/workspaces/src/main.rs b/lib/modules/home/eww/scripts/workspaces/src/main.rs similarity index 100% rename from nix/modules/home-manager/eww/scripts/workspaces/src/main.rs rename to lib/modules/home/eww/scripts/workspaces/src/main.rs diff --git a/nix/modules/home-manager/fish/interactiveShellInit.fish b/lib/modules/home/fish/interactiveShellInit.fish similarity index 100% rename from nix/modules/home-manager/fish/interactiveShellInit.fish rename to lib/modules/home/fish/interactiveShellInit.fish diff --git a/nix/modules/home-manager/fish/shellInit.fish b/lib/modules/home/fish/shellInit.fish similarity index 100% rename from nix/modules/home-manager/fish/shellInit.fish rename to lib/modules/home/fish/shellInit.fish diff --git a/nix/modules/home-manager/ghostty/config b/lib/modules/home/ghostty/config similarity index 100% rename from nix/modules/home-manager/ghostty/config rename to lib/modules/home/ghostty/config diff --git a/nix/modules/home-manager/ghostty/themes/catppuccin-mocha-sapphire-custom b/lib/modules/home/ghostty/themes/catppuccin-mocha-sapphire-custom similarity index 100% rename from nix/modules/home-manager/ghostty/themes/catppuccin-mocha-sapphire-custom rename to lib/modules/home/ghostty/themes/catppuccin-mocha-sapphire-custom diff --git a/nix/modules/home-manager/hyprland.nix b/lib/modules/home/hyprland.nix similarity index 100% rename from nix/modules/home-manager/hyprland.nix rename to lib/modules/home/hyprland.nix diff --git a/nix/modules/home-manager/kitty.nix b/lib/modules/home/kitty.nix similarity index 100% rename from nix/modules/home-manager/kitty.nix rename to lib/modules/home/kitty.nix diff --git a/nix/modules/home-manager/niri/config.kdl b/lib/modules/home/niri/config.kdl similarity index 100% rename from nix/modules/home-manager/niri/config.kdl rename to lib/modules/home/niri/config.kdl diff --git a/nix/modules/home-manager/plasma-manager.nix b/lib/modules/home/plasma-manager.nix similarity index 100% rename from nix/modules/home-manager/plasma-manager.nix rename to lib/modules/home/plasma-manager.nix diff --git a/nix/modules/home-manager/scripts/common/bin/? b/lib/modules/home/scripts/common/bin/? similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/? rename to lib/modules/home/scripts/common/bin/? diff --git a/nix/modules/home-manager/scripts/common/bin/N b/lib/modules/home/scripts/common/bin/N similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/N rename to lib/modules/home/scripts/common/bin/N diff --git a/nix/modules/home-manager/scripts/common/bin/archive b/lib/modules/home/scripts/common/bin/archive similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/archive rename to lib/modules/home/scripts/common/bin/archive diff --git a/nix/modules/home-manager/scripts/common/bin/at b/lib/modules/home/scripts/common/bin/at similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/at rename to lib/modules/home/scripts/common/bin/at diff --git a/nix/modules/home-manager/scripts/common/bin/bp b/lib/modules/home/scripts/common/bin/bp similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/bp rename to lib/modules/home/scripts/common/bin/bp diff --git a/nix/modules/home-manager/scripts/common/bin/check-domain-availability b/lib/modules/home/scripts/common/bin/check-domain-availability similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/check-domain-availability rename to lib/modules/home/scripts/common/bin/check-domain-availability diff --git a/nix/modules/home-manager/scripts/common/bin/check-port b/lib/modules/home/scripts/common/bin/check-port similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/check-port rename to lib/modules/home/scripts/common/bin/check-port diff --git a/nix/modules/home-manager/scripts/common/bin/clip b/lib/modules/home/scripts/common/bin/clip similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/clip rename to lib/modules/home/scripts/common/bin/clip diff --git a/nix/modules/home-manager/scripts/common/bin/clipshot b/lib/modules/home/scripts/common/bin/clipshot similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/clipshot rename to lib/modules/home/scripts/common/bin/clipshot diff --git a/nix/modules/home-manager/scripts/common/bin/copy-git-forge-url b/lib/modules/home/scripts/common/bin/copy-git-forge-url similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/copy-git-forge-url rename to lib/modules/home/scripts/common/bin/copy-git-forge-url diff --git a/nix/modules/home-manager/scripts/common/bin/countdown b/lib/modules/home/scripts/common/bin/countdown similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/countdown rename to lib/modules/home/scripts/common/bin/countdown diff --git a/nix/modules/home-manager/scripts/common/bin/dns b/lib/modules/home/scripts/common/bin/dns similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/dns rename to lib/modules/home/scripts/common/bin/dns diff --git a/nix/modules/home-manager/scripts/common/bin/dns-cleaner b/lib/modules/home/scripts/common/bin/dns-cleaner similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/dns-cleaner rename to lib/modules/home/scripts/common/bin/dns-cleaner diff --git a/nix/modules/home-manager/scripts/common/bin/dns-deleter b/lib/modules/home/scripts/common/bin/dns-deleter similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/dns-deleter rename to lib/modules/home/scripts/common/bin/dns-deleter diff --git a/nix/modules/home-manager/scripts/common/bin/dns-deleter-matching b/lib/modules/home/scripts/common/bin/dns-deleter-matching similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/dns-deleter-matching rename to lib/modules/home/scripts/common/bin/dns-deleter-matching diff --git a/nix/modules/home-manager/scripts/common/bin/docker-compose b/lib/modules/home/scripts/common/bin/docker-compose similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/docker-compose rename to lib/modules/home/scripts/common/bin/docker-compose diff --git a/nix/modules/home-manager/scripts/common/bin/editscrot b/lib/modules/home/scripts/common/bin/editscrot similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/editscrot rename to lib/modules/home/scripts/common/bin/editscrot diff --git a/nix/modules/home-manager/scripts/common/bin/email-via-mailgun-smtp b/lib/modules/home/scripts/common/bin/email-via-mailgun-smtp similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/email-via-mailgun-smtp rename to lib/modules/home/scripts/common/bin/email-via-mailgun-smtp diff --git a/nix/modules/home-manager/scripts/common/bin/emoji b/lib/modules/home/scripts/common/bin/emoji similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/emoji rename to lib/modules/home/scripts/common/bin/emoji diff --git a/nix/modules/home-manager/scripts/common/bin/ezln b/lib/modules/home/scripts/common/bin/ezln similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/ezln rename to lib/modules/home/scripts/common/bin/ezln diff --git a/nix/modules/home-manager/scripts/common/bin/field b/lib/modules/home/scripts/common/bin/field similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/field rename to lib/modules/home/scripts/common/bin/field diff --git a/nix/modules/home-manager/scripts/common/bin/getip b/lib/modules/home/scripts/common/bin/getip similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/getip rename to lib/modules/home/scripts/common/bin/getip diff --git a/nix/modules/home-manager/scripts/common/bin/git-authors b/lib/modules/home/scripts/common/bin/git-authors similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/git-authors rename to lib/modules/home/scripts/common/bin/git-authors diff --git a/nix/modules/home-manager/scripts/common/bin/gitforge-url.ts b/lib/modules/home/scripts/common/bin/gitforge-url.ts similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/gitforge-url.ts rename to lib/modules/home/scripts/common/bin/gitforge-url.ts diff --git a/nix/modules/home-manager/scripts/common/bin/glancepath b/lib/modules/home/scripts/common/bin/glancepath similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/glancepath rename to lib/modules/home/scripts/common/bin/glancepath diff --git a/nix/modules/home-manager/scripts/common/bin/good-morning b/lib/modules/home/scripts/common/bin/good-morning similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/good-morning rename to lib/modules/home/scripts/common/bin/good-morning diff --git a/nix/modules/home-manager/scripts/common/bin/has_command b/lib/modules/home/scripts/common/bin/has_command similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/has_command rename to lib/modules/home/scripts/common/bin/has_command diff --git a/nix/modules/home-manager/scripts/common/bin/is_wayland b/lib/modules/home/scripts/common/bin/is_wayland similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/is_wayland rename to lib/modules/home/scripts/common/bin/is_wayland diff --git a/nix/modules/home-manager/scripts/common/bin/j b/lib/modules/home/scripts/common/bin/j similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/j rename to lib/modules/home/scripts/common/bin/j diff --git a/nix/modules/home-manager/scripts/common/bin/k8s-yaml-diff b/lib/modules/home/scripts/common/bin/k8s-yaml-diff similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/k8s-yaml-diff rename to lib/modules/home/scripts/common/bin/k8s-yaml-diff diff --git a/nix/modules/home-manager/scripts/common/bin/k8s-yaml-sort b/lib/modules/home/scripts/common/bin/k8s-yaml-sort similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/k8s-yaml-sort rename to lib/modules/home/scripts/common/bin/k8s-yaml-sort diff --git a/nix/modules/home-manager/scripts/common/bin/keyrepeat b/lib/modules/home/scripts/common/bin/keyrepeat similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/keyrepeat rename to lib/modules/home/scripts/common/bin/keyrepeat diff --git a/nix/modules/home-manager/scripts/common/bin/kubeline b/lib/modules/home/scripts/common/bin/kubeline similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/kubeline rename to lib/modules/home/scripts/common/bin/kubeline diff --git a/nix/modules/home-manager/scripts/common/bin/kubfc b/lib/modules/home/scripts/common/bin/kubfc similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/kubfc rename to lib/modules/home/scripts/common/bin/kubfc diff --git a/nix/modules/home-manager/scripts/common/bin/kubfn b/lib/modules/home/scripts/common/bin/kubfn similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/kubfn rename to lib/modules/home/scripts/common/bin/kubfn diff --git a/nix/modules/home-manager/scripts/common/bin/launch b/lib/modules/home/scripts/common/bin/launch similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/launch rename to lib/modules/home/scripts/common/bin/launch diff --git a/nix/modules/home-manager/scripts/common/bin/linewise b/lib/modules/home/scripts/common/bin/linewise similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/linewise rename to lib/modules/home/scripts/common/bin/linewise diff --git a/nix/modules/home-manager/scripts/common/bin/maybe_source_env_file b/lib/modules/home/scripts/common/bin/maybe_source_env_file similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/maybe_source_env_file rename to lib/modules/home/scripts/common/bin/maybe_source_env_file diff --git a/nix/modules/home-manager/scripts/common/bin/nd b/lib/modules/home/scripts/common/bin/nd similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/nd rename to lib/modules/home/scripts/common/bin/nd diff --git a/nix/modules/home-manager/scripts/common/bin/nf b/lib/modules/home/scripts/common/bin/nf similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/nf rename to lib/modules/home/scripts/common/bin/nf diff --git a/nix/modules/home-manager/scripts/common/bin/note b/lib/modules/home/scripts/common/bin/note similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/note rename to lib/modules/home/scripts/common/bin/note diff --git a/nix/modules/home-manager/scripts/common/bin/nsync b/lib/modules/home/scripts/common/bin/nsync similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/nsync rename to lib/modules/home/scripts/common/bin/nsync diff --git a/nix/modules/home-manager/scripts/common/bin/nvimdiff b/lib/modules/home/scripts/common/bin/nvimdiff similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/nvimdiff rename to lib/modules/home/scripts/common/bin/nvimdiff diff --git a/nix/modules/home-manager/scripts/common/bin/open-in-git-forge b/lib/modules/home/scripts/common/bin/open-in-git-forge similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/open-in-git-forge rename to lib/modules/home/scripts/common/bin/open-in-git-forge diff --git a/nix/modules/home-manager/scripts/common/bin/optimize-photo-for-web b/lib/modules/home/scripts/common/bin/optimize-photo-for-web similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/optimize-photo-for-web rename to lib/modules/home/scripts/common/bin/optimize-photo-for-web diff --git a/nix/modules/home-manager/scripts/common/bin/pass-migrate-to-pass-otp b/lib/modules/home/scripts/common/bin/pass-migrate-to-pass-otp similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/pass-migrate-to-pass-otp rename to lib/modules/home/scripts/common/bin/pass-migrate-to-pass-otp diff --git a/nix/modules/home-manager/scripts/common/bin/pipeline b/lib/modules/home/scripts/common/bin/pipeline similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/pipeline rename to lib/modules/home/scripts/common/bin/pipeline diff --git a/nix/modules/home-manager/scripts/common/bin/poll b/lib/modules/home/scripts/common/bin/poll similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/poll rename to lib/modules/home/scripts/common/bin/poll diff --git a/nix/modules/home-manager/scripts/common/bin/pr-for-commit b/lib/modules/home/scripts/common/bin/pr-for-commit similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/pr-for-commit rename to lib/modules/home/scripts/common/bin/pr-for-commit diff --git a/nix/modules/home-manager/scripts/common/bin/readme.md b/lib/modules/home/scripts/common/bin/readme.md similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/readme.md rename to lib/modules/home/scripts/common/bin/readme.md diff --git a/nix/modules/home-manager/scripts/common/bin/remote b/lib/modules/home/scripts/common/bin/remote similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/remote rename to lib/modules/home/scripts/common/bin/remote diff --git a/nix/modules/home-manager/scripts/common/bin/resource-usage b/lib/modules/home/scripts/common/bin/resource-usage similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/resource-usage rename to lib/modules/home/scripts/common/bin/resource-usage diff --git a/nix/modules/home-manager/scripts/common/bin/s b/lib/modules/home/scripts/common/bin/s similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/s rename to lib/modules/home/scripts/common/bin/s diff --git a/nix/modules/home-manager/scripts/common/bin/scn b/lib/modules/home/scripts/common/bin/scn similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/scn rename to lib/modules/home/scripts/common/bin/scn diff --git a/nix/modules/home-manager/scripts/common/bin/screenshot b/lib/modules/home/scripts/common/bin/screenshot similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/screenshot rename to lib/modules/home/scripts/common/bin/screenshot diff --git a/nix/modules/home-manager/scripts/common/bin/scrup b/lib/modules/home/scripts/common/bin/scrup similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/scrup rename to lib/modules/home/scripts/common/bin/scrup diff --git a/nix/modules/home-manager/scripts/common/bin/scwd b/lib/modules/home/scripts/common/bin/scwd similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/scwd rename to lib/modules/home/scripts/common/bin/scwd diff --git a/nix/modules/home-manager/scripts/common/bin/setbg b/lib/modules/home/scripts/common/bin/setbg similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/setbg rename to lib/modules/home/scripts/common/bin/setbg diff --git a/nix/modules/home-manager/scripts/common/bin/source_if_exists b/lib/modules/home/scripts/common/bin/source_if_exists similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/source_if_exists rename to lib/modules/home/scripts/common/bin/source_if_exists diff --git a/nix/modules/home-manager/scripts/common/bin/spark b/lib/modules/home/scripts/common/bin/spark similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/spark rename to lib/modules/home/scripts/common/bin/spark diff --git a/nix/modules/home-manager/scripts/common/bin/sw b/lib/modules/home/scripts/common/bin/sw similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/sw rename to lib/modules/home/scripts/common/bin/sw diff --git a/nix/modules/home-manager/scripts/common/bin/t b/lib/modules/home/scripts/common/bin/t similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/t rename to lib/modules/home/scripts/common/bin/t diff --git a/nix/modules/home-manager/scripts/common/bin/td b/lib/modules/home/scripts/common/bin/td similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/td rename to lib/modules/home/scripts/common/bin/td diff --git a/nix/modules/home-manager/scripts/common/bin/tdf b/lib/modules/home/scripts/common/bin/tdf similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/tdf rename to lib/modules/home/scripts/common/bin/tdf diff --git a/nix/modules/home-manager/scripts/common/bin/terminal-rendering-test b/lib/modules/home/scripts/common/bin/terminal-rendering-test similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/terminal-rendering-test rename to lib/modules/home/scripts/common/bin/terminal-rendering-test diff --git a/nix/modules/home-manager/scripts/common/bin/termrec b/lib/modules/home/scripts/common/bin/termrec similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/termrec rename to lib/modules/home/scripts/common/bin/termrec diff --git a/nix/modules/home-manager/scripts/common/bin/tls b/lib/modules/home/scripts/common/bin/tls similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/tls rename to lib/modules/home/scripts/common/bin/tls diff --git a/nix/modules/home-manager/scripts/common/bin/tmux-edit-buffer b/lib/modules/home/scripts/common/bin/tmux-edit-buffer similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/tmux-edit-buffer rename to lib/modules/home/scripts/common/bin/tmux-edit-buffer diff --git a/nix/modules/home-manager/scripts/common/bin/tmux-lyte-session b/lib/modules/home/scripts/common/bin/tmux-lyte-session similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/tmux-lyte-session rename to lib/modules/home/scripts/common/bin/tmux-lyte-session diff --git a/nix/modules/home-manager/scripts/common/bin/tmux-save-buffer b/lib/modules/home/scripts/common/bin/tmux-save-buffer similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/tmux-save-buffer rename to lib/modules/home/scripts/common/bin/tmux-save-buffer diff --git a/nix/modules/home-manager/scripts/common/bin/tmux-session-dir b/lib/modules/home/scripts/common/bin/tmux-session-dir similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/tmux-session-dir rename to lib/modules/home/scripts/common/bin/tmux-session-dir diff --git a/nix/modules/home-manager/scripts/common/bin/tmux-session-preview b/lib/modules/home/scripts/common/bin/tmux-session-preview similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/tmux-session-preview rename to lib/modules/home/scripts/common/bin/tmux-session-preview diff --git a/nix/modules/home-manager/scripts/common/bin/tmuxswitcher b/lib/modules/home/scripts/common/bin/tmuxswitcher similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/tmuxswitcher rename to lib/modules/home/scripts/common/bin/tmuxswitcher diff --git a/nix/modules/home-manager/scripts/common/bin/unarchive b/lib/modules/home/scripts/common/bin/unarchive similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/unarchive rename to lib/modules/home/scripts/common/bin/unarchive diff --git a/nix/modules/home-manager/scripts/common/bin/weather b/lib/modules/home/scripts/common/bin/weather similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/weather rename to lib/modules/home/scripts/common/bin/weather diff --git a/nix/modules/home-manager/scripts/common/bin/yamldiff b/lib/modules/home/scripts/common/bin/yamldiff similarity index 100% rename from nix/modules/home-manager/scripts/common/bin/yamldiff rename to lib/modules/home/scripts/common/bin/yamldiff diff --git a/nix/modules/home-manager/scripts/linux/bin/restartbar b/lib/modules/home/scripts/linux/bin/restartbar similarity index 100% rename from nix/modules/home-manager/scripts/linux/bin/restartbar rename to lib/modules/home/scripts/linux/bin/restartbar diff --git a/nix/modules/home-manager/scripts/linux/bin/startbar b/lib/modules/home/scripts/linux/bin/startbar similarity index 100% rename from nix/modules/home-manager/scripts/linux/bin/startbar rename to lib/modules/home/scripts/linux/bin/startbar diff --git a/nix/modules/home-manager/sway-laptop.nix b/lib/modules/home/sway-laptop.nix similarity index 100% rename from nix/modules/home-manager/sway-laptop.nix rename to lib/modules/home/sway-laptop.nix diff --git a/nix/modules/home-manager/sway.nix b/lib/modules/home/sway.nix similarity index 100% rename from nix/modules/home-manager/sway.nix rename to lib/modules/home/sway.nix diff --git a/nix/modules/home-manager/swaylock.nix b/lib/modules/home/swaylock.nix similarity index 100% rename from nix/modules/home-manager/swaylock.nix rename to lib/modules/home/swaylock.nix diff --git a/nix/modules/home-manager/waybar.nix b/lib/modules/home/waybar.nix similarity index 100% rename from nix/modules/home-manager/waybar.nix rename to lib/modules/home/waybar.nix diff --git a/nix/modules/home-manager/wezterm/colors/catppuccin-mocha-sapphire.toml b/lib/modules/home/wezterm/colors/catppuccin-mocha-sapphire.toml similarity index 100% rename from nix/modules/home-manager/wezterm/colors/catppuccin-mocha-sapphire.toml rename to lib/modules/home/wezterm/colors/catppuccin-mocha-sapphire.toml diff --git a/nix/modules/home-manager/wezterm/wezterm.lua b/lib/modules/home/wezterm/wezterm.lua similarity index 100% rename from nix/modules/home-manager/wezterm/wezterm.lua rename to lib/modules/home/wezterm/wezterm.lua diff --git a/nix/modules/nixos/conduwuit.nix b/lib/modules/nixos/conduwuit.nix similarity index 100% rename from nix/modules/nixos/conduwuit.nix rename to lib/modules/nixos/conduwuit.nix diff --git a/nix/modules/nixos/default.nix b/lib/modules/nixos/default.nix similarity index 61% rename from nix/modules/nixos/default.nix rename to lib/modules/nixos/default.nix index b09bb99..aa0f7a4 100644 --- a/nix/modules/nixos/default.nix +++ b/lib/modules/nixos/default.nix @@ -1,16 +1,53 @@ -{ - disko, - sops-nix, - style, - flakeInputs, - homeManagerModules, - home-manager, - home-manager-unstable, - helix, - nixosModules, - pubkey, - overlays, -}: { +{self, ...}: let + inherit (self) outputs; + inherit (outputs) nixosModules homeManagerModules overlays constants; + inherit (constants) pubkey; +in { + shell-defaults-and-applications = import ./shell-config.nix; + deno-netlify-ddns-client = import ./deno-netlify-ddns-client.nix; + + # boot.tmp.useTmpfs = true; + # boot.uki.tries = 3; + # services.irqbalance.enable = true; + + # this is not ready for primetime yet + # services.kanidm = { + # enableClient = true; + # enablePam = true; + # package = pkgs.kanidm; + + # clientSettings.uri = "https://idm.h.lyte.dev"; + # unixSettings = { + # # hsm_pin_path = "/somewhere/else"; + # pam_allowed_login_groups = []; + # }; + # }; + # systemd.tmpfiles.rules = [ + # "d /etc/kanidm 1755 nobody users -" + # ]; + + # module has the incorrect file permissions out of the box + # environment.etc = { + /* + "kanidm" = { + enable = true; + user = "nobody"; + group = "users"; + mode = "0755"; + }; + */ + # "kanidm/unixd" = { + # user = "kanidm-unixd"; + # group = "kanidm-unixd"; + # mode = "0700"; + # }; + # "kanidm/config" = { + # user = "nobody"; + # group = "users"; + # mode = "0755"; + # }; + # }; + ewwbar = {pkgs, ...}: { # imports = with nixosModules; []; environment.systemPackages = with pkgs; [eww upower jq]; @@ -53,10 +90,6 @@ }; environment.systemPackages = with pkgs; [hyprpaper xwaylandvideobridge netcat-openbsd]; - programs.hyprland = { - package = flakeInputs.hyprland.packages.${pkgs.system}.hyprland; - }; - home-manager.users.daniel = { imports = with homeManagerModules; [ hyprland @@ -178,143 +211,6 @@ }; }; - deno-netlify-ddns-client = import ./deno-netlify-ddns-client.nix; - conduwuit = import ./conduwuit.nix; - - fallback-hostname = {lib, ...}: { - networking.hostName = lib.mkDefault "set-a-hostname-dingus"; - }; - - no-giant-logs = {lib, ...}: { - services.journald.extraConfig = lib.mkDefault "SystemMaxUse=1G"; - }; - - allow-redistributable-firmware = {lib, ...}: { - hardware.enableRedistributableFirmware = lib.mkDefault true; - }; - - home-manager-defaults = { - imports = [ - # enable home-manager - home-manager.nixosModules.home-manager - ]; - - home-manager.useGlobalPkgs = true; - home-manager.backupFileExtension = "hm-backup"; - }; - - home-manager-unstable-defaults = { - imports = [ - # enable home-manager - home-manager-unstable.nixosModules.home-manager - ]; - - home-manager.useGlobalPkgs = true; - home-manager.backupFileExtension = "hm-backup"; - }; - - mdns-and-lan-service-discovery = { - services.avahi = { - enable = true; - reflector = true; - openFirewall = true; - nssmdns4 = true; - }; - }; - - helix-text-editor = {pkgs, ...}: { - environment = { - systemPackages = [ - helix.packages.${pkgs.system}.helix - ]; - variables = { - EDITOR = "hx"; - SYSTEMD_EDITOR = "hx"; - VISUAL = "hx"; - }; - }; - }; - - zellij-multiplexer = {pkgs, ...}: { - environment.systemPackages = [ - pkgs.zellij - ]; - }; - - fish-shell = { - pkgs, - lib, - ... - }: { - programs.fish = { - enable = true; - }; - - users = { - defaultUserShell = pkgs.fish; - }; - }; - - nix-index = { - enable = true; - enableBashIntegration = true; - enableFishIntegration = true; - enableZshIntegration = true; - }; - - my-favorite-default-system-apps = {pkgs, ...}: { - imports = with nixosModules; [ - helix-text-editor - zellij-multiplexer - fish-shell - ]; - - environment = { - variables = { - PAGER = "bat --style=plain"; - MANPAGER = "bat --style=plain"; - }; - systemPackages = with pkgs; [ - aria2 - iputils - inetutils - curl - dua - bat - eza - fd - file - iputils - nettools - /* - nodePackages.bash-language-server # just pull in as needed? - shellcheck - shfmt - */ - killall - ripgrep - rsync - sd - ]; - }; - - programs = { - traceroute.enable = true; - git = { - enable = true; - package = pkgs.gitFull; - lfs.enable = true; - }; - }; - }; - - mosh = {lib, ...}: { - programs.mosh = { - enable = true; - openFirewall = lib.mkDefault true; - }; - }; - remote-disk-key-entry-on-boot = { lib, pkgs, @@ -341,111 +237,6 @@ }; }; - ssh-server = {lib, ...}: { - # enable an ssh server and provide root access with my primary public key - - users.users.root = { - openssh.authorizedKeys.keys = [pubkey]; - }; - - services.openssh = { - enable = true; - - settings = { - PasswordAuthentication = false; - KbdInteractiveAuthentication = false; - PermitRootLogin = lib.mkForce "prohibit-password"; - }; - - openFirewall = lib.mkDefault true; - - /* - listenAddresses = [ - { addr = "0.0.0.0"; port = 22; } - ]; - */ - }; - }; - - password-manager = {pkgs, ...}: { - /* - programs.goldwarden = { - ## NOTE: This didn't seem to work for me, but would be awesome! (but I can't remember why?) - enable = true; - }; - */ - - home-manager.users.daniel = { - imports = with homeManagerModules; [ - password-manager - ]; - }; - }; - - linux = {pkgs, ...}: { - home-manager.users.daniel = { - imports = with homeManagerModules; [ - linux - ]; - }; - }; - - tailscale = {lib, ...}: { - services.tailscale = { - enable = true; - useRoutingFeatures = lib.mkDefault "client"; - }; - }; - - cross-compiler = {config, ...}: { - boot.binfmt.emulatedSystems = ["aarch64-linux" "i686-linux"]; - }; - - default-nix-configuration-and-overlays = { - lib, - config, - ... - }: { - nixpkgs = { - overlays = with overlays; [ - additions - modifications - unstable-packages - ]; - config.allowUnfree = true; - }; - - nix = { - nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry; - # registry = lib.mapAttrs (_: value: {flake = value;}) flakeInputs; - - settings = { - trusted-users = ["root" "daniel"]; - experimental-features = lib.mkDefault ["nix-command" "flakes"]; - - extra-platforms = ["i686-linux" "aarch64-linux"]; - - substituters = [ - # TODO: dedupe with flake's config? is that even necessary? - "https://cache.nixos.org/" - "https://helix.cachix.org" - "https://nix-community.cachix.org" - "https://nix.h.lyte.dev" - "https://hyprland.cachix.org" - ]; - trusted-public-keys = [ - # TODO: dedupe with flake's config? is that even necessary? - "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=" - "helix.cachix.org-1:ejp9KQpR1FBI2onstMQ34yogDm4OgU2ru6lIwPvuCVs=" - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "h.lyte.dev:HeVWtne31ZG8iMf+c15VY3/Mky/4ufXlfTpT8+4Xbs0=" - "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" - ]; - auto-optimise-store = true; - }; - }; - }; - laptop = {pkgs, ...}: { imports = with nixosModules; [ family-users @@ -543,12 +334,6 @@ # users.users.daniel.extraGroups = ["adbusers"]; home-manager.users.daniel = { - home.packages = with pkgs; [ - # yubikey-personalization - # yubikey-manager - # yubico-piv-tool - ]; - programs.direnv.mise = { enable = true; }; @@ -982,166 +767,195 @@ */ }; - music-production = {pkgs, ...}: { - /* - TODO: may want to force nixpkgs-stable for a more-stable music production - environment? - */ - imports = [ - { - environment.systemPackages = with pkgs; [ - helvum # pipewire graph/patchbay GUI - ardour # DAW - helm # synth + podman = { + pkgs, + config, + lib, + ... + }: { + config = lib.mkIf config.virtualisation.podman.enable { + environment = { + systemPackages = with pkgs; [ + podman-compose ]; - } - ]; - - /* - TODO: things to look into for music production: - - https://linuxmusicians.com/viewtopic.php?t=27016 - - KXStudio? - - falktx (https://github.com/DISTRHO/Cardinal) - */ - }; - - podman = {pkgs, ...}: { - environment = { - systemPackages = with pkgs; [ - podman-compose - ]; - }; - - virtualisation = { - podman = { - enable = true; - dockerCompat = true; - dockerSocket.enable = true; - defaultNetwork.settings.dns_enabled = true; - # networkSocket.enable = true; }; - oci-containers = { - backend = "podman"; + virtualisation = { + podman = { + dockerCompat = config.virtualisation.podman.enable; + dockerSocket.enable = true; + defaultNetwork.settings.dns_enabled = true; + }; + + oci-containers = { + backend = "podman"; + }; + }; + + networking = { + extraHosts = '' + 127.0.0.1 host.docker.internal + ::1 host.docker.internal + 127.0.0.1 host.containers.internal + ::1 host.containers.internal + ''; }; }; + }; - networking = { - extraHosts = '' - 127.0.0.1 host.docker.internal - ::1 host.docker.internal - 127.0.0.1 host.containers.internal - ::1 host.containers.internal - ''; + virtual-machines = { + pkgs, + lib, + config, + ... + }: { + config = lib.mkIf config.virtualisation.libvirtd.enable { + users.users.daniel.extraGroups = ["libvirtd"]; }; }; - virtual-machines = {pkgs, ...}: { - virtualisation.libvirtd.enable = true; - users.users.daniel.extraGroups = ["libvirtd"]; - }; + postgres = { + pkgs, + lib, + config, + ... + }: { + config = lib.mkIf config.services.postgresql.enable { + # this is really just for development usage + services.postgresql = { + ensureDatabases = ["daniel"]; + ensureUsers = [ + { + name = "daniel"; + ensureDBOwnership = true; + } + ]; + # enableTCPIP = true; + # package = pkgs.postgresql_15; - virtual-machines-gui = {pkgs, ...}: { - programs.virt-manager.enable = true; - }; + authentication = pkgs.lib.mkOverride 10 '' + #type database DBuser auth-method + local all postgres peer map=superuser_map + local all daniel peer map=superuser_map + local sameuser all peer map=superuser_map - postgres = {pkgs, ...}: { - # this is really just for development usage - services.postgresql = { - enable = true; - ensureDatabases = ["daniel"]; - ensureUsers = [ - { - name = "daniel"; - ensureDBOwnership = true; - } + # lan ipv4 + host all all 10.0.0.0/24 trust + host all all 127.0.0.1/32 trust + + # tailnet ipv4 + host all all 100.64.0.0/10 trust + ''; + + identMap = '' + # ArbitraryMapName systemUser DBUser + superuser_map root postgres + superuser_map postgres postgres + superuser_map daniel postgres + + superuser_map /^(.*)$ \1 # Let other names login as themselves + ''; + }; + + environment.systemPackages = with pkgs; [ + pgcli ]; - # enableTCPIP = true; - - package = pkgs.postgresql_15; - - authentication = pkgs.lib.mkOverride 10 '' - #type database DBuser auth-method - local all postgres peer map=superuser_map - local all daniel peer map=superuser_map - local sameuser all peer map=superuser_map - - # lan ipv4 - host all all 10.0.0.0/24 trust - host all all 127.0.0.1/32 trust - - # tailnet ipv4 - host all all 100.64.0.0/10 trust - ''; - - identMap = '' - # ArbitraryMapName systemUser DBUser - superuser_map root postgres - superuser_map postgres postgres - superuser_map daniel postgres - - superuser_map /^(.*)$ \1 # Let other names login as themselves - ''; }; - - environment.systemPackages = with pkgs; [ - pgcli - ]; }; - printing = {pkgs, ...}: { - services.printing.enable = true; - services.printing.browsing = true; - services.printing.browsedConf = '' - BrowseDNSSDSubTypes _cups,_print - BrowseLocalProtocols all - BrowseRemoteProtocols all - CreateIPPPrinterQueues All - - BrowseProtocols all - ''; - services.printing.drivers = [pkgs.gutenprint]; - }; - - enable-flatpaks-and-appimages = { - services.flatpak.enable = true; - programs.appimage.binfmt = true; - }; - - wifi = {lib, ...}: let - inherit (lib) mkDefault; + desktop = { + pkgs, + lib, + config, + ... + }: let + cfg = config.lyte.desktop; in { - networking.networkmanager = { - enable = mkDefault true; - # ensureProfiles = { - # profiles = { - # home-wifi = { - # id="home-wifi"; - # permissions = ""; - # type = "wifi"; - # }; - # wifi = { - # ssid = ""; - # }; - # wifi-security = { - # # auth-alg = ""; - # # key-mgmt = ""; - # psk = ""; - # }; - # }; - # }; + options = { + lyte = { + desktop = { + enable = lib.mkEnableOption "Enable my default desktop configuration and applications"; + }; + }; }; - systemd.services.NetworkManager-wait-online.enable = mkDefault false; + config = lib.mkIf cfg.enable { + home-manager.users.daniel = { + imports = with homeManagerModules; [ + firefox-no-tabs + linux-desktop-environment-config + ]; + }; + services.flatpak.enable = true; + programs.appimage.binfmt = true; + services.printing.enable = true; + programs.virt-manager.enable = config.virtualization.libvirtd.enable; + }; + }; - /* - TODO: networking.networkmanager.wifi.backend = "iwd"; ? - TODO: powersave? - TODO: can I pre-configure my usual wifi networks with SSIDs and PSKs loaded from secrets? - */ - hardware.wirelessRegulatoryDatabase = true; - boot.extraModprobeConfig = '' - options cfg80211 ieee80211_regdom="US" - ''; + printing = { + pkgs, + lib, + config, + ... + }: { + config = lib.mkIf config.services.printing.enable { + services.printing.browsing = true; + services.printing.browsedConf = '' + BrowseDNSSDSubTypes _cups,_print + BrowseLocalProtocols all + BrowseRemoteProtocols all + CreateIPPPrinterQueues All + + BrowseProtocols all + ''; + services.printing.drivers = [pkgs.gutenprint]; + }; + }; + + wifi = { + lib, + config, + ... + }: let + inherit (lib) mkDefault; + cfg = config.networking.wifi; + in { + options = { + networking.wifi.enable = lib.mkEnableOption "Enable wifi via NetworkManager"; + }; + config = lib.mkIf cfg.enable { + networking.networkmanager = { + enable = true; + # ensureProfiles = { + # profiles = { + # home-wifi = { + # id="home-wifi"; + # permissions = ""; + # type = "wifi"; + # }; + # wifi = { + # ssid = ""; + # }; + # wifi-security = { + # # auth-alg = ""; + # # key-mgmt = ""; + # psk = ""; + # }; + # }; + # }; + }; + systemd.services.NetworkManager-wait-online.enable = mkDefault false; + + /* + TODO: networking.networkmanager.wifi.backend = "iwd"; ? + TODO: powersave? + TODO: can I pre-configure my usual wifi networks with SSIDs and PSKs loaded from secrets? + */ + hardware.wirelessRegulatoryDatabase = true; + boot.extraModprobeConfig = '' + options cfg80211 ieee80211_regdom="US" + ''; + }; }; steam = {pkgs, ...}: { @@ -1201,9 +1015,27 @@ }; }; - daniel = {pkgs, ...}: let + daniel = { + pkgs, + lib, + config, + ... + }: let username = "daniel"; in { + imports = [ + { + config = lib.mkIf config.lyte.shell.enable { + home-manager.users.${username} = { + imports = with homeManagerModules; [ + senpai + iex + cargo + ]; + }; + }; + } + ]; users.groups.${username} = {}; users.users.${username} = { isNormalUser = true; @@ -1220,7 +1052,7 @@ home = { username = "daniel"; homeDirectory = "/home/daniel/.home"; - stateVersion = pkgs.lib.mkDefault "24.05"; + stateVersion = config.system.stateVersion; }; accounts.email.accounts = { @@ -1278,141 +1110,6 @@ }; # a common module that is intended to be imported by all NixOS systems - common = { - lib, - pkgs, - modulesPath, - ... - }: { - imports = with nixosModules; [ - (modulesPath + "/installer/scan/not-detected.nix") - default-nix-configuration-and-overlays - - # allow any machine to make use of sops secrets - sops-nix.nixosModules.sops - - # allow disko modules to manage disk config - disko.nixosModules.disko - - fallback-hostname - no-giant-logs - allow-redistributable-firmware - mdns-and-lan-service-discovery - tailscale - ssh-server - - my-favorite-default-system-apps - mosh - - daniel - root - ]; - - # boot.tmp.useTmpfs = true; - systemd.services.nix-daemon = { - environment.TMPDIR = "/var/tmp"; - }; - boot.tmp.cleanOnBoot = true; - # boot.uki.tries = 3; - # services.irqbalance.enable = true; - - # this is not ready for primetime yet - # services.kanidm = { - # enableClient = true; - # enablePam = true; - # package = pkgs.kanidm; - - # clientSettings.uri = "https://idm.h.lyte.dev"; - # unixSettings = { - # # hsm_pin_path = "/somewhere/else"; - # pam_allowed_login_groups = []; - # }; - # }; - # systemd.tmpfiles.rules = [ - # "d /etc/kanidm 1755 nobody users -" - # ]; - - # module has the incorrect file permissions out of the box - # environment.etc = { - /* - "kanidm" = { - enable = true; - user = "nobody"; - group = "users"; - mode = "0755"; - }; - */ - # "kanidm/unixd" = { - # user = "kanidm-unixd"; - # group = "kanidm-unixd"; - # mode = "0700"; - # }; - # "kanidm/config" = { - # user = "nobody"; - # group = "users"; - # mode = "0755"; - # }; - # }; - - programs.gnupg.agent = { - enable = true; - pinentryPackage = lib.mkDefault pkgs.pinentry-tty; - }; - - time = { - timeZone = "America/Chicago"; - }; - - i18n = { - defaultLocale = lib.mkDefault "en_US.UTF-8"; - }; - - services = { - xserver.xkb = { - layout = lib.mkDefault "us"; - - # have the caps-lock key instead be a ctrl key - options = lib.mkDefault "ctrl:nocaps"; - }; - smartd.enable = true; - fwupd.enable = true; - }; - - console = { - # font = "Lat2-Terminus16"; # TODO: would like this font for non-hidpi displays, but this is not dynamic enough? - useXkbConfig = lib.mkDefault true; - earlySetup = lib.mkDefault true; - - colors = with style.colors; [ - bg - red - green - orange - blue - purple - yellow - fg3 - fgdim - red - green - orange - blue - purple - yellow - fg - ]; - }; - - networking = { - useDHCP = lib.mkDefault true; - firewall = { - enable = lib.mkDefault true; - allowPing = lib.mkDefault true; - }; - }; - - system.stateVersion = lib.mkDefault "24.05"; - }; # intended to be auto-logged in and only run a certain application # flanfamkiosk = {}; diff --git a/nix/modules/nixos/deno-netlify-ddns-client.nix b/lib/modules/nixos/deno-netlify-ddns-client.nix similarity index 100% rename from nix/modules/nixos/deno-netlify-ddns-client.nix rename to lib/modules/nixos/deno-netlify-ddns-client.nix diff --git a/nix/modules/nixos/gnome.nix b/lib/modules/nixos/gnome.nix similarity index 100% rename from nix/modules/nixos/gnome.nix rename to lib/modules/nixos/gnome.nix diff --git a/lib/modules/nixos/shell-config.nix b/lib/modules/nixos/shell-config.nix new file mode 100644 index 0000000..94668d6 --- /dev/null +++ b/lib/modules/nixos/shell-config.nix @@ -0,0 +1,71 @@ +{ + lib, + pkgs, + config, + ... +}: let + cfg = config.lyte.shell; +in { + options = { + lyte = { + shell = { + enable = lib.mkEnableOption "Enable my default shell configuration and applications"; + }; + }; + }; + config = lib.mkIf cfg.enable { + nix-index = { + enable = true; + enableBashIntegration = true; + enableFishIntegration = true; + enableZshIntegration = true; + }; + users = { + defaultUserShell = pkgs.fish; + }; + programs = { + fish.enable = true; + traceroute.enable = true; + git = { + enable = true; + package = pkgs.gitFull; + lfs.enable = true; + }; + }; + programs.btop = { + enable = true; + package = pkgs.btop.override { + rocmSupport = true; + }; + }; + environment = { + variables = { + EDITOR = "hx"; + SYSTEMD_EDITOR = "hx"; + VISUAL = "hx"; + PAGER = "bat --style=plain"; + MANPAGER = "bat --style=plain"; + }; + systemPackages = with pkgs; [ + zellij + helix + aria2 + bat + curl + dua + eza + fd + file + inetutils + iputils + iputils + killall + nettools + ripgrep + rsync + sd + xh + ]; + }; + }; +} diff --git a/lib/overlays/default.nix b/lib/overlays/default.nix new file mode 100644 index 0000000..49b2ea0 --- /dev/null +++ b/lib/overlays/default.nix @@ -0,0 +1,38 @@ +{ + self, + nixpkgs, + nixpkgs-unstable, + ... +} @ inputs: { + default = final: _prev: { + overlays = with self.overlays; [ + additions + modifications + unstable-packages + ]; + }; + + additions = final: prev: (prev // self.outputs.packages.${prev.system}); + + modifications = final: prev: let + inherit (inputs) helix ghostty; + in { + ghostty = ghostty.outputs.packages.${prev.system}.default; + helix = helix.outputs.packages.${prev.system}.default; + bitwarden = self.outputs.packages.${prev.system}.bitwarden; + }; + + unstable-packages = final: _prev: { + unstable-packages = import nixpkgs-unstable { + system = final.system; + config.allowUnfree = true; + }; + }; + + stable-packages = final: _prev: { + stable-packages = import nixpkgs { + system = final.system; + config.allowUnfree = true; + }; + }; +} diff --git a/nix/templates/.gitignore b/lib/templates/.gitignore similarity index 100% rename from nix/templates/.gitignore rename to lib/templates/.gitignore diff --git a/nix/templates/default.nix b/lib/templates/default.nix similarity index 100% rename from nix/templates/default.nix rename to lib/templates/default.nix diff --git a/nix/templates/deno/.envrc b/lib/templates/deno/.envrc similarity index 100% rename from nix/templates/deno/.envrc rename to lib/templates/deno/.envrc diff --git a/nix/templates/deno/.gitignore b/lib/templates/deno/.gitignore similarity index 100% rename from nix/templates/deno/.gitignore rename to lib/templates/deno/.gitignore diff --git a/nix/templates/deno/.helix/languages.toml b/lib/templates/deno/.helix/languages.toml similarity index 100% rename from nix/templates/deno/.helix/languages.toml rename to lib/templates/deno/.helix/languages.toml diff --git a/nix/templates/deno/deno.json b/lib/templates/deno/deno.json similarity index 100% rename from nix/templates/deno/deno.json rename to lib/templates/deno/deno.json diff --git a/nix/templates/deno/flake.nix b/lib/templates/deno/flake.nix similarity index 100% rename from nix/templates/deno/flake.nix rename to lib/templates/deno/flake.nix diff --git a/nix/templates/deno/mod.ts b/lib/templates/deno/mod.ts similarity index 100% rename from nix/templates/deno/mod.ts rename to lib/templates/deno/mod.ts diff --git a/nix/templates/elixir/.envrc b/lib/templates/elixir/.envrc similarity index 100% rename from nix/templates/elixir/.envrc rename to lib/templates/elixir/.envrc diff --git a/nix/templates/elixir/.gitignore b/lib/templates/elixir/.gitignore similarity index 100% rename from nix/templates/elixir/.gitignore rename to lib/templates/elixir/.gitignore diff --git a/nix/templates/elixir/flake.nix b/lib/templates/elixir/flake.nix similarity index 100% rename from nix/templates/elixir/flake.nix rename to lib/templates/elixir/flake.nix diff --git a/nix/templates/elixir/nix/boilerplate.nix b/lib/templates/elixir/nix/boilerplate.nix similarity index 100% rename from nix/templates/elixir/nix/boilerplate.nix rename to lib/templates/elixir/nix/boilerplate.nix diff --git a/nix/templates/elixir/nix/checks.nix b/lib/templates/elixir/nix/checks.nix similarity index 100% rename from nix/templates/elixir/nix/checks.nix rename to lib/templates/elixir/nix/checks.nix diff --git a/nix/templates/elixir/nix/overlays.nix b/lib/templates/elixir/nix/overlays.nix similarity index 100% rename from nix/templates/elixir/nix/overlays.nix rename to lib/templates/elixir/nix/overlays.nix diff --git a/nix/templates/elixir/nix/packages.nix b/lib/templates/elixir/nix/packages.nix similarity index 100% rename from nix/templates/elixir/nix/packages.nix rename to lib/templates/elixir/nix/packages.nix diff --git a/nix/templates/elixir/nix/shells.nix b/lib/templates/elixir/nix/shells.nix similarity index 100% rename from nix/templates/elixir/nix/shells.nix rename to lib/templates/elixir/nix/shells.nix diff --git a/nix/templates/gleam/.envrc b/lib/templates/gleam/.envrc similarity index 100% rename from nix/templates/gleam/.envrc rename to lib/templates/gleam/.envrc diff --git a/nix/templates/gleam/.gitignore.flake b/lib/templates/gleam/.gitignore.flake similarity index 100% rename from nix/templates/gleam/.gitignore.flake rename to lib/templates/gleam/.gitignore.flake diff --git a/nix/templates/gleam/flake.nix b/lib/templates/gleam/flake.nix similarity index 100% rename from nix/templates/gleam/flake.nix rename to lib/templates/gleam/flake.nix diff --git a/nix/templates/godot/.envrc b/lib/templates/godot/.envrc similarity index 100% rename from nix/templates/godot/.envrc rename to lib/templates/godot/.envrc diff --git a/nix/templates/godot/.gitignore b/lib/templates/godot/.gitignore similarity index 100% rename from nix/templates/godot/.gitignore rename to lib/templates/godot/.gitignore diff --git a/nix/templates/godot/.helix/languages.toml b/lib/templates/godot/.helix/languages.toml similarity index 100% rename from nix/templates/godot/.helix/languages.toml rename to lib/templates/godot/.helix/languages.toml diff --git a/nix/templates/godot/flake.nix b/lib/templates/godot/flake.nix similarity index 100% rename from nix/templates/godot/flake.nix rename to lib/templates/godot/flake.nix diff --git a/nix/templates/nim/.envrc b/lib/templates/nim/.envrc similarity index 100% rename from nix/templates/nim/.envrc rename to lib/templates/nim/.envrc diff --git a/nix/templates/nim/.gitignore b/lib/templates/nim/.gitignore similarity index 100% rename from nix/templates/nim/.gitignore rename to lib/templates/nim/.gitignore diff --git a/nix/templates/nim/flake.nix b/lib/templates/nim/flake.nix similarity index 100% rename from nix/templates/nim/flake.nix rename to lib/templates/nim/flake.nix diff --git a/nix/templates/nix-flake/.envrc b/lib/templates/nix-flake/.envrc similarity index 100% rename from nix/templates/nix-flake/.envrc rename to lib/templates/nix-flake/.envrc diff --git a/nix/templates/nix-flake/.gitignore b/lib/templates/nix-flake/.gitignore similarity index 100% rename from nix/templates/nix-flake/.gitignore rename to lib/templates/nix-flake/.gitignore diff --git a/nix/templates/nix-flake/.helix/languages.toml b/lib/templates/nix-flake/.helix/languages.toml similarity index 100% rename from nix/templates/nix-flake/.helix/languages.toml rename to lib/templates/nix-flake/.helix/languages.toml diff --git a/nix/templates/nix-flake/flake.nix b/lib/templates/nix-flake/flake.nix similarity index 100% rename from nix/templates/nix-flake/flake.nix rename to lib/templates/nix-flake/flake.nix diff --git a/nix/templates/rust/.envrc b/lib/templates/rust/.envrc similarity index 100% rename from nix/templates/rust/.envrc rename to lib/templates/rust/.envrc diff --git a/nix/templates/rust/.gitignore b/lib/templates/rust/.gitignore similarity index 100% rename from nix/templates/rust/.gitignore rename to lib/templates/rust/.gitignore diff --git a/nix/templates/rust/flake.nix b/lib/templates/rust/flake.nix similarity index 100% rename from nix/templates/rust/flake.nix rename to lib/templates/rust/flake.nix diff --git a/nix/templates/rust/nix/boilerplate.nix b/lib/templates/rust/nix/boilerplate.nix similarity index 100% rename from nix/templates/rust/nix/boilerplate.nix rename to lib/templates/rust/nix/boilerplate.nix diff --git a/nix/templates/rust/nix/checks.nix b/lib/templates/rust/nix/checks.nix similarity index 100% rename from nix/templates/rust/nix/checks.nix rename to lib/templates/rust/nix/checks.nix diff --git a/nix/templates/rust/nix/packages.nix b/lib/templates/rust/nix/packages.nix similarity index 100% rename from nix/templates/rust/nix/packages.nix rename to lib/templates/rust/nix/packages.nix diff --git a/nix/templates/rust/nix/shells.nix b/lib/templates/rust/nix/shells.nix similarity index 100% rename from nix/templates/rust/nix/shells.nix rename to lib/templates/rust/nix/shells.nix diff --git a/nix/boilerplate.nix b/nix/boilerplate.nix index 449b4d6..8b13789 100644 --- a/nix/boilerplate.nix +++ b/nix/boilerplate.nix @@ -1,30 +1 @@ -inputs @ { - nixpkgs, - nixpkgs-unstable, - self, - ... -}: let - /* - * - include a "forSelf" overlay from the flake's own outputs if one exists - */ - forSelfOverlay = - if builtins.hasAttr "overlays" self && builtins.hasAttr "forSelf" self.overlays - then self.overlays.forSelf - else (_: p: p); - - # a wrapper function that produces the boilerplate functions so we can define - # them for both nixpkgs and nixpkgs-unstable - buildFuncs = nixpkgs: rec { - systems = ["aarch64-linux" "x86_64-linux" "x86_64-darwin" "aarch64-darwin"]; - forSystems = nixpkgs.lib.genAttrs systems; - pkgsFor = system: ((import nixpkgs {inherit system;}).extend forSelfOverlay); - genPkgs = func: (forSystems (system: func (pkgsFor system))); - call = imported: genPkgs (pkgs: imported (inputs // {inherit pkgs;})); - }; -in - (buildFuncs nixpkgs) - // { - unstable = buildFuncs nixpkgs-unstable; - } diff --git a/nix/constants.nix b/nix/constants.nix index 14e944f..3d83ad0 100644 --- a/nix/constants.nix +++ b/nix/constants.nix @@ -1,4 +1,4 @@ -{ +{nixpkgs, ...}: { style = { colors = (import ./lib/colors.nix {inherit (nixpkgs) lib;}).schemes.catppuccin-mocha-sapphire; diff --git a/nix/machines.nix b/nix/machines.nix new file mode 100644 index 0000000..c783165 --- /dev/null +++ b/nix/machines.nix @@ -0,0 +1,438 @@ + + beefcake = let + system = "x86_64-linux"; + in + nixpkgs.lib.nixosSystem { + inherit system; + modules = with nixosModules; [ + home-manager-defaults + conduwuit + + # TODO: disko? + hardware.nixosModules.common-cpu-intel + + outputs.nixosModules.deno-netlify-ddns-client + { + services.deno-netlify-ddns-client = { + enable = true; + username = "beefcake.h"; + # TODO: router doesn't even do ipv6 yet... + ipv6 = false; + }; + } + + family-users + common + podman + troubleshooting-tools + virtual-machines + virtual-machines-gui + linux + fonts + + ./nixos/beefcake.nix + + { + services.kanidm.package = (unstable.pkgsFor system).kanidm; + } + ]; + }; + + + htpc = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = with nixosModules; [ + home-manager-defaults + + hardware.nixosModules.common-pc-ssd + common + gaming + graphical-workstation + + ./nixos/htpc.nix + + { + home-manager.users.daniel = { + imports = with homeManagerModules; [ + linux-desktop-environment-config + ]; + }; + } + ]; + }; + + steamdeck1 = nixpkgs-unstable.lib.nixosSystem { + system = "x86_64-linux"; + modules = with nixosModules; [ + home-manager-unstable-defaults + + outputs.diskoConfigurations.unencrypted + hardware.nixosModules.common-pc-ssd + common + gaming + graphical-workstation + # plasma6 + + jovian.outputs.nixosModules.jovian + + { + networking.hostName = "steamdeck1"; + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + hardware.bluetooth.enable = true; + networking.networkmanager.enable = true; + + home-manager.users.daniel = { + imports = with homeManagerModules; [ + firefox-no-tabs + linux-desktop-environment-config + ]; + }; + } + ]; + }; + + foxtrot = nixpkgs-unstable.lib.nixosSystem { + system = "x86_64-linux"; + modules = with nixosModules; [ + home-manager-unstable-defaults + + outputs.diskoConfigurations.foxtrot + hardware.nixosModules.framework-13-7040-amd + + common + kde-connect + password-manager + graphical-workstation + # plasma6 + # virtual-machines + # virtual-machines-gui + laptop + gaming + cross-compiler + + ./nixos/foxtrot.nix + + ({pkgs, ...}: { + home-manager.users.daniel = { + imports = with homeManagerModules; [ + senpai + iex + niri + cargo + firefox-no-tabs + linux-desktop-environment-config + ]; + }; + environment.systemPackages = with pkgs; [ + fw-ectool + (writeShellApplication + { + name = "reset-wifi-module"; + runtimeInputs = with pkgs; [kmod]; + text = '' + modprobe -rv mt7921e + modprobe -v mt7921e + ''; + }) + (writeShellApplication + { + name = "perfmode"; + # we use command -v $cmd here because we only want to invoke these calls _if_ the related package is installed on the system + # otherwise, they will likely have no effect anyways + text = '' + command -v powerprofilesctl &>/dev/null && bash -x -c 'powerprofilesctl set balanced' + command -v swaymsg &>/dev/null && bash -x -c 'swaymsg output eDP-1 mode 2880x1920@120Hz' + ''; + }) + (writeShellApplication + { + name = "battmode"; + text = '' + command -v powerprofilesctl &>/dev/null && bash -x -c 'powerprofilesctl set power-saver' + command -v swaymsg &>/dev/null && bash -x -c 'swaymsg output eDP-1 mode 2880x1920@60Hz' + ''; + }) + ]; + }) + ]; + }; + + thablet = nixpkgs-unstable.lib.nixosSystem { + system = "x86_64-linux"; + modules = with nixosModules; [ + home-manager-unstable-defaults + { + _module.args = { + disk = "nvme0n1"; + esp = { + label = "ESP"; + size = "4G"; + name = "ESP"; + }; + }; + } + outputs.diskoConfigurations.standard + hardware.nixosModules.lenovo-thinkpad-x1-yoga + + common + password-manager + graphical-workstation + # plasma6 + music-production + laptop + touchscreen + gaming + + ./nixos/thablet.nix + + { + home-manager.users.daniel = { + imports = with homeManagerModules; [ + senpai + iex + cargo + firefox-no-tabs + linux-desktop-environment-config + # slippi.homeManagerModules.default + ]; + }; + } + ]; + }; + + /* + grablet = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = with nixosModules; [ + common + + outputs.diskoConfigurations.standard + hardware.nixosModules.common-cpu-intel-kaby-lake + hardware.nixosModules.common-pc-laptopp-ssd + graphical-workstation + laptop + gaming + + ./nixos/thablet.nix + + { + home-manager.users.daniel = { + imports = with homeManagerModules; [ + iex + cargo + linux-desktop-environment-config + ]; + }; + + powerManagement.cpuFreqGovernor = lib.mkDefault "performance"; + } + ]; + }; + */ + + thinker = nixpkgs-unstable.lib.nixosSystem { + system = "x86_64-linux"; + modules = with nixosModules; [ + home-manager-unstable-defaults + + { + _module.args = { + disks = ["/dev/nvme0n1"]; + swapSize = "32G"; + }; + } + outputs.diskoConfigurations.standard + hardware.nixosModules.lenovo-thinkpad-t480 + hardware.nixosModules.common-pc-laptop-ssd + + music-production + common + password-manager + graphical-workstation + # plasma6 + laptop + gaming + + ./nixos/thinker.nix + + { + home-manager.users.daniel = { + imports = with homeManagerModules; [ + senpai + iex + cargo + firefox-no-tabs + linux-desktop-environment-config + slippi.homeManagerModules.default + ]; + }; + } + ]; + }; + + musicbox = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = with nixosModules; [ + home-manager-defaults + + { + _module.args = { + disks = ["/dev/sda"]; + # swapSize = "8G"; + }; + esp = {}; + } + outputs.diskoConfigurations.unencrypted + hardware.nixosModules.common-pc-laptop-ssd + + music-production + common + graphical-workstation + wifi + + # ./nixos/musicbox.nix + + { + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + hardware.bluetooth.enable = true; + networking.networkmanager.enable = true; + + home-manager.users.daniel = { + imports = with homeManagerModules; [ + firefox-no-tabs + linux-desktop-environment-config + ]; + }; + } + ]; + }; + + rascal = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = with nixosModules; [ + home-manager-defaults + hardware.nixosModules.common-cpu-amd + common + linux + ./nixos/rascal.nix + ]; + }; + + router = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = with nixosModules; [ + home-manager-defaults + common + linux + troubleshooting-tools + + outputs.nixosModules.deno-netlify-ddns-client + { + services.deno-netlify-ddns-client = { + enable = true; + username = "router.h"; + # TODO: ipv6 + ipv6 = false; + }; + } + + /* + NOTE: maybe use this someday, but I think I need more concrete + networking knowledge before I know how to use it well. Additionally, + I can use my existing firewall configuration more easily if I manage + it directly. + nnf.nixosModules.default + */ + + ./nixos/router.nix + ]; + }; + + # pinephone-image = + # (import "${mobile-nixos}/lib/eval-with-configuration.nix" { + # configuration = with nixosModules; [ + # linux + # home-manager-defaults + + # # outputs.diskoConfigurations.unencrypted # can I even disko with an image-based installation? + # common + # wifi + + # # TODO: how do I get a minimally useful mobile environment? + # # for me, this means an on-screen keyboard and suspend support I think? + # # I can live in a tty if needed and graphical stuff can all evolve later + # # not worried about modem + # # maybe/hopefully I can pull in or define my own sxmo via nix? + # ]; + # device = "pine64-pinephone"; + # pkgs = pkgsFor "aarch64-linux"; + # }) + # .outputs + # .disk-image; + + pinephone = let + inherit (nixpkgs-unstable) lib; + in + lib.nixosSystem { + system = "aarch64-linux"; + # lib.nixosSystem { + + modules = with nixosModules; [ + { + imports = [ + (import "${mobile-nixos}/lib/configuration.nix" { + device = "pine64-pinephone"; + }) + ]; + + # nixpkgs.hostPlatform.system = "aarch64-linux"; + nixpkgs.buildPlatform = "x86_64-linux"; + + # TODO: quirk: since the pinephone kernel doesn't seem to have "rpfilter" support, firewall ain't working + networking.firewall.enable = lib.mkForce false; + + # TODO: quirk: since git send-email requires perl support, which we don't seem to have on the pinephone, we're just disabling git for now + # TODO: would likely be easier/better to somehow ignore the assertion? probably a way to do that... + programs.git.enable = lib.mkForce false; + + # this option is conflicted, presumably due to some assumption in my defaults/common config + # the sd-image module we're importing above has this set to true, so we better go with that? + # that said, I think the mobile-nixos bootloader module has this set to false, so... + # TODO: what does this mean? + boot.loader.generic-extlinux-compatible.enable = lib.mkForce true; + + # another conflicting option since I think I default to NetworkManager and this conflicts with networking.wireless.enable + networking.networkmanager.enable = lib.mkForce false; + networking.wireless.enable = lib.mkForce true; + } + + # TODO: how do I build this as a .img to flash to an SD card? + + # for testing, this seems to work `nixos-rebuild build --impure --flake .#pinephone` + + # TODO: would like to use the mobile-nixos installer? + "${nixpkgs-unstable}/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix" + + linux + home-manager-unstable-defaults + + # outputs.diskoConfigurations.unencrypted # can I even disko with an image-based installation? + common + wifi + + { + system.stateVersion = "24.11"; + } + + { + # nixpkgs.buildPlatform = "x86_64-linux"; + # nixpkgs.hostPlatform = lib.systems.examples.aarch64-multiplatform; + # nixpkgs.localSystem.system = lib.systems.examples.x86_64-linux; + # nixpkgs.crossSystem = lib.mkForce null; + } + ]; + }; + }; + diff --git a/nix/nixos/dragon.nix b/nix/nixos/dragon.nix deleted file mode 100644 index 658a912..0000000 --- a/nix/nixos/dragon.nix +++ /dev/null @@ -1,177 +0,0 @@ -{ - pkgs, - lib, - config, - ... -}: { - imports = [ - { - system.stateVersion = "24.11"; - home-manager.users.daniel.home.stateVersion = "24.05"; - networking.hostName = "dragon"; - } - - { - # sops secrets config - sops = { - defaultSopsFile = ../secrets/dragon/secrets.yml; - age = { - sshKeyPaths = ["/etc/ssh/ssh_host_ed25519_key"]; - keyFile = "/var/lib/sops-nix/key.txt"; - generateKey = true; - }; - }; - } - { - sops.secrets = { - ddns-pass = {mode = "0400";}; - }; - services.deno-netlify-ddns-client = { - passwordFile = config.sops.secrets.ddns-pass.path; - }; - } - ]; - hardware.amdgpu = { - amdvlk = { - enable = true; - support32Bit = { - enable = true; - }; - }; - }; - hardware.graphics.extraPackages = [ - # pkgs.rocmPackages.clr.icd - pkgs.amdvlk - - # encoding/decoding acceleration - pkgs.libvdpau-va-gl - pkgs.vaapiVdpau - ]; - - boot = { - kernelPackages = pkgs.linuxPackages_latest; - loader.efi.canTouchEfiVariables = true; - loader.systemd-boot.enable = true; - initrd.availableKernelModules = ["xhci_pci" "nvme" "ahci" "usbhid"]; - kernelModules = ["kvm-amd"]; - supportedFilesystems = ["ntfs"]; - }; - - hardware.bluetooth = { - enable = true; - # package = pkgs.bluez; - settings = { - General = { - AutoConnect = true; - MultiProfile = "multiple"; - }; - }; - }; - powerManagement.cpuFreqGovernor = lib.mkDefault "performance"; - - # dragon firewall - # TODO: maybe should go in the gaming module? - networking = { - firewall = let - terraria = 7777; - stardew-valley = 24642; - web-dev-lan = 18888; - ports = [ - terraria - stardew-valley - web-dev-lan - ]; - in { - allowedTCPPorts = ports; - allowedUDPPorts = ports; - }; - }; - - environment.systemPackages = with pkgs; [ - radeontop - godot_4 - prismlauncher - ]; - - home-manager.users.daniel = { - slippi-launcher = { - enable = true; - isoPath = "${config.home-manager.users.daniel.home.homeDirectory}/../games/roms/dolphin/melee.iso"; - launchMeleeOnPlay = false; - }; - - # TODO: monitor config module? - wayland.windowManager.hyprland = { - settings = { - exec-once = [ - "eww open bar1" - ]; - # See https://wiki.hyprland.org/Configuring/Keywords/ for more - monitor = [ - # "DP-2,3840x2160@60,-2160x0,1,transform,3" - # "DP-3,3840x2160@120,${toString (builtins.ceil (2160 / 1.5))}x0,1" - "DP-3,3840x2160@120,0x0,1" - # TODO: HDR breaks screenshare? - /* - "DP-3,3840x2160@120,${toString (builtins.ceil (2160 / 1.5))}x0,1,bitdepth,10" - "desc:LG Display 0x0521,3840x2160@120,0x0,1" - "desc:Dell Inc. DELL U2720Q D3TM623,3840x2160@60,3840x0,1.5,transform,1" - */ - "DP-2,3840x2160@60,3840x0,1.5,transform,3" - ]; - input = { - force_no_accel = true; - sensitivity = 1; # -1.0 - 1.0, 0 means no modification. - }; - workspace = [ - "1, monitor:DP-3, default:true" - "2, monitor:DP-3, default:false" - "3, monitor:DP-3, default:false" - "4, monitor:DP-3, default:false" - "5, monitor:DP-3, default:false" - "6, monitor:DP-3, default:false" - "7, monitor:DP-3, default:false" - "8, monitor:DP-2, default:true" - "9, monitor:DP-2, default:false" - ]; - }; - }; - - wayland.windowManager.sway = { - config = { - output = { - "GIGA-BYTE TECHNOLOGY CO., LTD. AORUS FO48U 23070B000307" = { - mode = "3840x2160@120Hz"; - position = "${toString (builtins.ceil (2160 / 1.5))},0"; - }; - - "Dell Inc. DELL U2720Q D3TM623" = { - # desktop left vertical monitor - mode = "3840x2160@60Hz"; - transform = "270"; - scale = "1.5"; - position = "0,0"; - }; - }; - - workspaceOutputAssign = - ( - map - (ws: { - output = "GIGA-BYTE TECHNOLOGY CO., LTD. AORUS FO48U 23070B000307"; - workspace = toString ws; - }) - (lib.range 1 7) - ) - ++ ( - map - (ws: { - output = "Dell Inc. DELL U2720Q D3TM623"; - workspace = toString ws; - }) - (lib.range 8 9) - ); - }; - }; - }; -} diff --git a/nix/overlays/default.nix b/nix/overlays/default.nix deleted file mode 100644 index eaf8f3f..0000000 --- a/nix/overlays/default.nix +++ /dev/null @@ -1,36 +0,0 @@ -{nixpkgs, ...}: { - # This one brings our custom packages from the 'pkgs' directory - additions = final: _prev: - import ../packages { - pkgs = import nixpkgs {inherit (final) system;}; - }; - - /* - This one contains whatever you want to overlay - You can change versions, add patches, set compilation flags, anything really. - https://nixos.wiki/wiki/Overlays - */ - modifications = final: prev: { - /* - final.fprintd = prev.fprintd.overrideAttrs { - # Source: https://github.com/NixOS/nixpkgs/commit/87ca2dc071581aea0e691c730d6844f1beb07c9f - mesonCheckFlags = [ - # PAM related checks are timing out - "--no-suite" - "fprintd:TestPamFprintd" - ]; - }; - */ - }; - - /* - When applied, the unstable nixpkgs set (declared in the flake inputs) will - be accessible through 'pkgs.unstable' - */ - unstable-packages = final: _prev: { - unstable = import nixpkgs { - system = final.system; - config.allowUnfree = true; - }; - }; -} diff --git a/nix/packages/default.nix b/nix/packages/default.nix deleted file mode 100644 index 17cdf59..0000000 --- a/nix/packages/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{pkgs, ...}: let - iosevkaLyteTerm = pkgs.callPackage ./iosevkaLyteTerm.nix {}; -in rec { - inherit iosevkaLyteTerm; - iosevkaLyteTermSubset = pkgs.callPackage ./iosevkaLyteTermSubset.nix { - inherit iosevkaLyteTerm; - }; -} diff --git a/nix/users.nix b/nix/users.nix new file mode 100644 index 0000000..047f166 --- /dev/null +++ b/nix/users.nix @@ -0,0 +1,26 @@ +{ + "deck" = let + system = "x86_64-linux"; + pkgs = unstable.pkgsFor system; + in + home-manager-unstable.lib.homeManagerConfiguration { + inherit pkgs; + modules = with homeManagerModules; [ + common + { + home = { + homeDirectory = "/home/deck"; + username = "deck"; + stateVersion = "24.11"; + }; + } + { + home.packages = with pkgs; [ + ludusavi + rclone + ]; + } + linux + ]; + }; +} diff --git a/nix/packages/bitwarden.json b/packages/bitwarden.json similarity index 100% rename from nix/packages/bitwarden.json rename to packages/bitwarden.json diff --git a/packages/checks/default.nix b/packages/checks/default.nix new file mode 100644 index 0000000..849e79d --- /dev/null +++ b/packages/checks/default.nix @@ -0,0 +1,12 @@ +{ + pkgs, + git-hooks, + ... +}: { + git-hooks = git-hooks.lib.${pkgs.system}.run { + src = ./.; + hooks = { + alejandra.enable = true; + }; + }; +} diff --git a/packages/default.nix b/packages/default.nix new file mode 100644 index 0000000..f1a88c1 --- /dev/null +++ b/packages/default.nix @@ -0,0 +1,25 @@ +{pkgs, ...}: let + iosevkaLyteTerm = pkgs.callPackage ./iosevkaLyteTerm.nix {}; +in { + inherit iosevkaLyteTerm; + + iosevkaLyteTermSubset = pkgs.callPackage ./iosevkaLyteTermSubset.nix { + inherit iosevkaLyteTerm; + }; + + bitwarden = pkgs.bitwarden.overrideAttrs (old: { + preBuild = '' + ${old.preBuild} + pushd apps/desktop/desktop_native/proxy + cargo build --bin desktop_proxy --release + popd + ''; + + postInstall = '' + mkdir -p $out/bin + cp -r apps/desktop/desktop_native/target/release/desktop_proxy $out/bin + mkdir -p $out/lib/mozilla/native-messaging-hosts + substituteAll ${./bitwarden.json} $out/lib/mozilla/native-messaging-hosts/com.8bit.bitwarden.json + ''; + }); +} diff --git a/nix/nixos/base.nix b/packages/hosts/base.nix similarity index 100% rename from nix/nixos/base.nix rename to packages/hosts/base.nix diff --git a/nix/nixos/beefcake.nix b/packages/hosts/beefcake.nix similarity index 100% rename from nix/nixos/beefcake.nix rename to packages/hosts/beefcake.nix diff --git a/nix/nixos/bigtower.nix b/packages/hosts/bigtower.nix similarity index 100% rename from nix/nixos/bigtower.nix rename to packages/hosts/bigtower.nix diff --git a/packages/hosts/default.nix b/packages/hosts/default.nix new file mode 100644 index 0000000..0e2dd15 --- /dev/null +++ b/packages/hosts/default.nix @@ -0,0 +1,177 @@ +{ + hardware, + self, + nixpkgs, + sops-nix, + disko, + home-manager, + nixpkgs-unstable, + home-manager-unstable, + ... +}: let + baseHost = { + nixpkgs, + home-manager, + ... + }: (path: ({system ? "x86_64-linux"}: (nixpkgs.lib.nixosSystem { + inherit system; + modules = [ + ({ + config, + lib, + pkgs, + modulesPath, + ... + }: { + imports = with self.outputs.nixosModules; [ + (modulesPath + "/installer/scan/not-detected.nix") + home-manager.nixosModules.home-manager + sops-nix.nixosModules.sops + disko.nixosModules.disko + deno-netlify-ddns-client + shell-defaults-and-applications + wifi + printing + podman + virtual-machines + postgres + gaming + gnome + daniel + root + ]; + + config = { + lyte.shell.enable = lib.mkDefault true; + nixpkgs.config.allowUnfree = lib.mkDefault true; + + sops = { + age = { + sshKeyPaths = lib.mkDefault ["/etc/ssh/ssh_host_ed25519_key"]; + keyFile = lib.mkDefault "/var/lib/sops-nix/key.txt"; + generateKey = lib.mkDefault true; + }; + }; + + nix = { + nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry; + registry = lib.mapAttrs (_: value: {flake = value;}) self.inputs; + + settings = + { + trusted-users = lib.mkDefault ["@wheel"]; + extra-experimental-features = lib.mkDefault ["nix-command" "flakes"]; + auto-optimise-store = lib.mkDefault true; + } + // self.nixConfig; + }; + + systemd.services.nix-daemon.environment.TMPDIR = lib.mkDefault "/var/tmp"; # TODO: why did I do this again? + boot.tmp.cleanOnBoot = lib.mkDefault true; + programs.gnupg.agent.enable = lib.mkDefault true; + time.timeZone = lib.mkDefault "America/Chicago"; + i18n.defaultLocale = lib.mkDefault "en_US.UTF-8"; + hardware.enableRedistributableFirmware = lib.mkDefault true; + + home-manager.useGlobalPkgs = lib.mkDefault true; + home-manager.backupFileExtension = lib.mkDefault "hm-backup"; + + users.users.root = { + openssh.authorizedKeys.keys = lib.mkDefault [self.constants.pubkey]; + }; + + services = { + openssh = { + enable = lib.mkDefault true; + + settings = { + PasswordAuthentication = lib.mkDefault false; + KbdInteractiveAuthentication = lib.mkDefault false; + PermitRootLogin = lib.mkForce "prohibit-password"; + }; + + openFirewall = lib.mkDefault true; + + /* + listenAddresses = [ + { addr = "0.0.0.0"; port = 22; } + ]; + */ + }; + avahi = { + enable = lib.mkDefault true; + reflector = lib.mkDefault true; + openFirewall = lib.mkDefault true; + nssmdns4 = lib.mkDefault true; + }; + tailscale = { + enable = lib.mkDefault true; + useRoutingFeatures = lib.mkDefault "client"; + }; + journald.extraConfig = lib.mkDefault "SystemMaxUse=1G"; + xserver.xkb = { + layout = lib.mkDefault "us"; + + # have the caps-lock key instead be a ctrl key + options = lib.mkDefault "ctrl:nocaps"; + }; + smartd.enable = lib.mkDefault true; + fwupd.enable = lib.mkDefault true; + }; + + console = { + useXkbConfig = lib.mkDefault true; + earlySetup = lib.mkDefault true; + + colors = with self.constants.style.colors; + lib.mkDefault [ + bg + red + green + orange + blue + purple + yellow + fg3 + fgdim + red + green + orange + blue + purple + yellow + fg + ]; + }; + + networking = { + hostName = lib.mkDefault "set-a-hostname-dingus"; + + useDHCP = lib.mkDefault true; + firewall = { + enable = lib.mkDefault true; + allowPing = lib.mkDefault true; + }; + }; + }; + }) + + { + _module.args = { + hardware = hardware.outputs.nixosModules; + diskoConfigurations = self.outputs.diskoConfigurations; + }; + } + (import path) + ]; + }))); + stableHost = baseHost {inherit nixpkgs home-manager;}; + host = baseHost { + nixpkgs = nixpkgs-unstable; + home-manager = home-manager-unstable; + }; +in { + beefcake = stableHost ./beefcake.nix {}; + dragon = host ./dragon.nix {}; + arm-dragon = host ./dragon.nix {system = "aarch64-linux";}; +} diff --git a/packages/hosts/dragon.nix b/packages/hosts/dragon.nix new file mode 100644 index 0000000..37a3580 --- /dev/null +++ b/packages/hosts/dragon.nix @@ -0,0 +1,49 @@ +{ + pkgs, + lib, + config, + hardware, + diskoConfigurations, + ... +}: { + system.stateVersion = "24.11"; + home-manager.users.daniel.home.stateVersion = "24.11"; + networking.hostName = "dragon"; + + boot = { + kernelPackages = pkgs.linuxPackages_latest; + loader.efi.canTouchEfiVariables = true; + loader.systemd-boot.enable = true; + initrd.availableKernelModules = ["xhci_pci" "nvme" "ahci" "usbhid"]; + kernelModules = ["kvm-amd"]; + supportedFilesystems = ["ntfs"]; + }; + + imports = with hardware; [ + (diskoConfigurations.unencrypted {disk = "/dev/nvme0n1";}) + common-cpu-amd + common-gpu-amd + common-pc-ssd + ]; + + sops.secrets.ddns-pass = {mode = "0400";}; + services.deno-netlify-ddns-client = { + passwordFile = config.sops.secrets.ddns-pass.path; + enable = true; + username = "dragon.h"; + # TODO: router doesn't even do ipv6 yet... + ipv6 = false; + }; + + hardware.bluetooth.enable = true; + networking.wifi.enable = true; + powerManagement.cpuFreqGovernor = lib.mkDefault "performance"; + + home-manager.users.daniel = { + slippi-launcher = { + enable = true; + isoPath = "${config.home-manager.users.daniel.home.homeDirectory}/../games/roms/dolphin/melee.iso"; + launchMeleeOnPlay = false; + }; + }; +} diff --git a/nix/nixos/factorio-versions.json b/packages/hosts/factorio-versions.json similarity index 100% rename from nix/nixos/factorio-versions.json rename to packages/hosts/factorio-versions.json diff --git a/nix/nixos/foxtrot.nix b/packages/hosts/foxtrot.nix similarity index 100% rename from nix/nixos/foxtrot.nix rename to packages/hosts/foxtrot.nix diff --git a/nix/nixos/htpc.nix b/packages/hosts/htpc.nix similarity index 100% rename from nix/nixos/htpc.nix rename to packages/hosts/htpc.nix diff --git a/nix/nixos/htpifour.nix b/packages/hosts/htpifour.nix similarity index 100% rename from nix/nixos/htpifour.nix rename to packages/hosts/htpifour.nix diff --git a/nix/nixos/rascal.nix b/packages/hosts/rascal.nix similarity index 100% rename from nix/nixos/rascal.nix rename to packages/hosts/rascal.nix diff --git a/nix/nixos/router.nix b/packages/hosts/router.nix similarity index 100% rename from nix/nixos/router.nix rename to packages/hosts/router.nix diff --git a/nix/nixos/thablet.nix b/packages/hosts/thablet.nix similarity index 100% rename from nix/nixos/thablet.nix rename to packages/hosts/thablet.nix diff --git a/nix/nixos/thinker.nix b/packages/hosts/thinker.nix similarity index 100% rename from nix/nixos/thinker.nix rename to packages/hosts/thinker.nix diff --git a/nix/packages/iosevkaLyteTerm.nix b/packages/iosevkaLyteTerm.nix similarity index 100% rename from nix/packages/iosevkaLyteTerm.nix rename to packages/iosevkaLyteTerm.nix diff --git a/nix/packages/iosevkaLyteTermSubset.nix b/packages/iosevkaLyteTermSubset.nix similarity index 100% rename from nix/packages/iosevkaLyteTermSubset.nix rename to packages/iosevkaLyteTermSubset.nix diff --git a/packages/shells/default.nix b/packages/shells/default.nix new file mode 100644 index 0000000..e472667 --- /dev/null +++ b/packages/shells/default.nix @@ -0,0 +1,13 @@ +{ + self, + pkgs, + ... +}: { + default = pkgs.mkShell { + inherit (self.outputs.checks.${pkgs.system}.git-hooks) shellHook; + packages = with pkgs; [ + lua-language-server + nodePackages.bash-language-server + ]; + }; +}