diff --git a/README.md b/README.md index 8ccfbf90a904ed87983e4b76cec8508e75eba9ab..7cf870d517a2b929672d4068234b87578b73a90e 100644 --- a/README.md +++ b/README.md @@ -7,3 +7,7 @@

Machines managed with [NixOS](https://nixos.org) and dotfiles managed with [home-manager](https://github.com/nix-community/home-manager). + +``` +just +``` diff --git a/apps/de/gtk.nix b/apps/de/gtk.nix new file mode 100644 index 0000000000000000000000000000000000000000..ee390716861c6f586b3f47955ed7f3a93e4c3bc7 --- /dev/null +++ b/apps/de/gtk.nix @@ -0,0 +1,59 @@ +{ + config, + lib, + pkgs, + ... +}: +{ + home.pointerCursor = { + name = "catppuccin-cursors"; + package = pkgs.catppuccin-cursors.mochaLavender; + size = 24; + }; + gtk = { + enable = true; + iconTheme = { + name = "Papirus-Dark"; + package = pkgs.catppuccin-papirus-folders.override { + flavor = "mocha"; + accent = "lavender"; + }; + }; + theme = { + name = "Catppuccin-Mocha-Compact-Lavender-Dark"; + package = pkgs.catppuccin-gtk.override { + accents = [ "lavender" ]; + variant = "mocha"; + size = "compact"; + }; + }; + gtk2.configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; + gtk2.extraConfig = '' + gtk-xft-antialias=1 + gtk-xft-hinting=1 + gtk-xft-hintstyle="hintslight" + gtk-xft-rgba="rgb" + ''; + gtk3.extraConfig = { + gtk-xft-antialias = 1; + gtk-xft-hinting = 1; + gtk-xft-hintstyle = "hintslight"; + gtk-xft-rgba = "rgb"; + }; + }; + + xdg = + let + themeDir = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}"; + in + lib.mkIf config.gtk.enable { + configFile = { + "gtk-4.0/assets" = { + source = "${themeDir}/gtk-4.0/assets"; + recursive = true; + }; + "gtk-4.0/gtk.css".source = "${themeDir}/gtk-4.0/gtk.css"; + "gtk-4.0/gtk-dark.css".source = "${themeDir}/gtk-4.0/gtk-dark.css"; + }; + }; +} diff --git a/apps/gui/flameshot.nix b/apps/gui/flameshot.nix new file mode 100644 index 0000000000000000000000000000000000000000..3c6ebb7d1b3599deabeb2be67968b1417f88b61c --- /dev/null +++ b/apps/gui/flameshot.nix @@ -0,0 +1,14 @@ +{ + services.flameshot = { + enable = true; + settings = { + General = { + showStartupLaunchMessage = false; + saveAsFileExtension = ".png"; + uiColor = "#313244"; + contrastUiColor = "#b4befe"; + userColors = "picker, #f5e0dc, #f2cdcd, #f5c2e7, #cba6f7, #f38ba8, #eba0ac, #fab387, #f9e2af, #a6e3a1, #94e2d5, #89dceb, #74c7ec, #89b4fa, #b4befe"; + }; + }; + }; +} diff --git a/apps/gui/obs.nix b/apps/gui/obs.nix new file mode 100644 index 0000000000000000000000000000000000000000..ccd772c1c56cc7be09815e53caa07fe954ef45f7 --- /dev/null +++ b/apps/gui/obs.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: +{ + programs.obs-studio = { + enable = true; + plugins = [ pkgs.obs-studio-plugins.obs-webkitgtk ]; + }; +} diff --git a/apps/gui/spotify.nix b/apps/gui/spotify.nix new file mode 100644 index 0000000000000000000000000000000000000000..23f7e7e68c1de92c9698f033a2b73ff888c401e4 --- /dev/null +++ b/apps/gui/spotify.nix @@ -0,0 +1,23 @@ +{ pkgs, ... }: +{ + home.packages = [ pkgs.spotify-player ]; + xdg.configFile."spotify-player/theme.toml".text = builtins.readFile ( + pkgs.fetchFromGitHub { + owner = "catppuccin"; + repo = "spotify-player"; + rev = "002d51b02b3a2ebc0804e4839ee604dbdab4bec3"; + sha256 = "sha256-IUhzVrIBMi/Dn6+HV0m9i38Msg8zzzJlR85JeEVE7EU="; + } + + "/src/theme.toml" + ); + xdg.configFile."spotify-player/app.toml".source = + (pkgs.formats.toml { }).generate "spotify-player-config" + { + client_id = "41af4976ba70474fbd541ee8764a2cda"; + theme = "Catppuccin-mocha"; + enable_notify = false; + enable_media_control = true; + device.volume = 100; + }; + programs.nushell.shellAliases.spt = "spotify_player"; +} diff --git a/apps/gui/swaylock.nix b/apps/gui/swaylock.nix new file mode 100644 index 0000000000000000000000000000000000000000..55704e424728edee4d30266c9f0f3b3af0976b9f --- /dev/null +++ b/apps/gui/swaylock.nix @@ -0,0 +1,10 @@ +{ jolheiser, ... }: +{ + programs.swaylock = { + enable = true; + settings = { + image = jolheiser.wallpaper; + scaling = "fill"; + }; + }; +} diff --git a/apps/gui/wezterm.nix b/apps/gui/wezterm.nix new file mode 100644 index 0000000000000000000000000000000000000000..5c13db65a14af416dd7951cafa41a193a5890616 --- /dev/null +++ b/apps/gui/wezterm.nix @@ -0,0 +1,4 @@ +{ + programs.wezterm.enable = true; + xdg.configFile."wezterm/wezterm.lua".source = ./wezterm/wezterm.lua; +} diff --git a/apps/gui/wezterm/wezterm.lua b/apps/gui/wezterm/wezterm.lua new file mode 100644 index 0000000000000000000000000000000000000000..7f3487e4f50b769b31e552ca252379e16c054b86 --- /dev/null +++ b/apps/gui/wezterm/wezterm.lua @@ -0,0 +1,93 @@ +local wezterm = require "wezterm" + +-- Update right status with "mode" +wezterm.on('update-right-status', function(window, pane) + local name = window:active_key_table() + if name then + name = " " .. string.upper(string.sub(name, 1, 1)) .. " " + end + window:set_right_status(name or '') +end) + +-- Toggle opacity +local opacity = 0.8 +wezterm.on('toggle-opacity', function(window, pane) + if opacity == 0.8 then + opacity = 0.9 + elseif opacity == 0.9 then + opacity = 1.0 + else + opacity = 0.8 + end + window:set_config_overrides({ window_background_opacity = opacity }) +end) + +-- config +local cfg = wezterm.config_builder() +cfg.default_prog = { "nu", "--config", "~/.config/nushell/config.nu", "--env-config", "~/.config/nushell/env.nu" } +cfg.window_close_confirmation = 'NeverPrompt' +cfg.window_background_opacity = opacity +cfg.window_decorations = "INTEGRATED_BUTTONS|RESIZE" +cfg.integrated_title_button_style = "Gnome" +cfg.integrated_title_buttons = { "Maximize", "Close" } +cfg.font = wezterm.font_with_fallback { "Monaspace Neon", "Iosevka", "Hack" } +cfg.leader = { + key = "Space", + mods = "CTRL", + timeout_milliseconds = math.maxinteger, +} +cfg.keys = { + { key = "p", mods = "LEADER", action = wezterm.action.ActivateKeyTable({ name = "pane_mode", one_shot = false }) }, + { key = "h", mods = "SHIFT|CTRL|ALT", action = wezterm.action.SplitHorizontal({ domain = "CurrentPaneDomain" }) }, + { key = "v", mods = "SHIFT|CTRL|ALT", action = wezterm.action.SplitVertical({ domain = "CurrentPaneDomain" }) }, + { key = "c", mods = "SHIFT|CTRL|ALT", action = wezterm.action.CloseCurrentPane({ confirm = false }) }, + { key = "s", mods = "SHIFT|CTRL|ALT", action = wezterm.action.PaneSelect({ alphabet = "1234567890", mode = "SwapWithActive" }) }, + { key = "o", mods = "SHIFT|CTRL|ALT", action = wezterm.action.EmitEvent("toggle-opacity") }, + { key = "LeftArrow", mods = "SHIFT|CTRL", action = wezterm.action.ActivateTabRelative(-1) }, + { key = "RightArrow", mods = "SHIFT|CTRL", action = wezterm.action.ActivateTabRelative(1) }, + { key = "1", mods = "LEADER", action = wezterm.action.ActivateTab(0) }, + { key = "2", mods = "LEADER", action = wezterm.action.ActivateTab(1) }, + { key = "3", mods = "LEADER", action = wezterm.action.ActivateTab(2) }, + { key = "4", mods = "LEADER", action = wezterm.action.ActivateTab(3) }, + { key = "5", mods = "LEADER", action = wezterm.action.ActivateTab(4) }, + { key = "6", mods = "LEADER", action = wezterm.action.ActivateTab(5) }, + { key = "7", mods = "LEADER", action = wezterm.action.ActivateTab(6) }, + { key = "8", mods = "LEADER", action = wezterm.action.ActivateTab(7) }, + { key = "9", mods = "LEADER", action = wezterm.action.ActivateTab(8) }, + { key = "0", mods = "LEADER", action = wezterm.action.ActivateTab(-1) }, +} +cfg.key_tables = { + pane_mode = { + { key = "h", action = wezterm.action.SplitHorizontal({ domain = "CurrentPaneDomain" }) }, + { key = "v", action = wezterm.action.SplitVertical({ domain = "CurrentPaneDomain" }) }, + { key = "c", action = wezterm.action.CloseCurrentPane({ confirm = false }) }, + { key = "s", action = wezterm.action.PaneSelect({ alphabet = "1234567890", mode = "SwapWithActive" }) }, + { key = "LeftArrow", action = wezterm.action.ActivatePaneDirection("Left") }, + { key = "UpArrow", action = wezterm.action.ActivatePaneDirection("Up") }, + { key = "RightArrow", action = wezterm.action.ActivatePaneDirection("Right") }, + { key = "DownArrow", action = wezterm.action.ActivatePaneDirection("Down") }, + { key = "Delete", action = wezterm.action.CloseCurrentPane({ confirm = false }) }, + { key = "LeftArrow", mods = "SHIFT", action = wezterm.action.AdjustPaneSize({ "Left", 1 }) }, + { key = "RightArrow", mods = "SHIFT", action = wezterm.action.AdjustPaneSize({ "Right", 1 }) }, + { key = "UpArrow", mods = "SHIFT", action = wezterm.action.AdjustPaneSize({ "Up", 1 }) }, + { key = "DownArrow", mods = "SHIFT", action = wezterm.action.AdjustPaneSize({ "Down", 1 }) }, + { key = "Escape", action = "PopKeyTable" }, + }, +} + +-- Plugins +wezterm.plugin.require("https://github.com/catppuccin/wezterm").apply_to_config(cfg, { + sync = true, + sync_flavors = { + light = "latte", + dark = "mocha", + } +}) +wezterm.plugin.require("https://github.com/nekowinston/wezterm-bar").apply_to_config(cfg, { + clock = { + enabled = false, + } +}) + +return cfg + diff --git a/apps/gui/zed.nix b/apps/gui/zed.nix new file mode 100644 index 0000000000000000000000000000000000000000..e50623bb68518e06013f84592a3fad837193eeec --- /dev/null +++ b/apps/gui/zed.nix @@ -0,0 +1,119 @@ +{ pkgs, ... }: +let + zed-fhs = pkgs.buildFHSEnv { + name = "zed"; + targetPkgs = + pkgs: with pkgs; [ + zed-editor + nixd + ]; + runScript = "zed"; + }; +in +{ + home.packages = [ zed-fhs ]; + xdg.configFile = { + "zed/settings.json".text = builtins.toJSON { + buffer_font_family = "MonaspiceNe Nerd Font"; + buffer_font_size = 13; + soft_wrap = "editor_width"; + telemetry = { + diagnostics = false; + metrics = false; + }; + terminal = { + font_family = "MonaspiceNe Nerd Font"; + shell = { + program = "nu"; + }; + }; + theme = "Catppuccin Mocha"; + ui_font_size = 15; + vim_mode = false; + relative_line_numbers = true; + vim = { + use_system_clipboard = "always"; + use_multiline_find = true; + }; + tab_bar.show = false; + toolbar = { + breadcrumbs = true; + quick_actions = false; + }; + assistant = { + version = "1"; + provider.name = "anthropic"; + }; + }; + "zed/keymap.json".text = + let + leader = "space"; + in + builtins.toJSON [ + { + "context" = "Dock || Terminal || Editor"; + "bindings" = { + "ctrl-h" = [ + "workspace::ActivatePaneInDirection" + "Left" + ]; + "ctrl-l" = [ + "workspace::ActivatePaneInDirection" + "Right" + ]; + "ctrl-k" = [ + "workspace::ActivatePaneInDirection" + "Up" + ]; + "ctrl-j" = [ + "workspace::ActivatePaneInDirection" + "Down" + ]; + }; + } + { + "context" = "Editor && VimControl && !VimWaiting && !menu"; + "bindings" = { + "${leader} b" = "editor::ToggleGitBlame"; + "${leader} k" = "editor::Hover"; + "${leader} a" = "editor::ToggleCodeActions"; + "${leader} l f" = "editor::Format"; + "${leader} d" = "diagnostics::Deploy"; + "${leader} f" = "file_finder::Toggle"; + "${leader} o" = "tab_switcher::Toggle"; + "${leader} e" = "workspace::ToggleLeftDock"; + "${leader} /" = "workspace::NewSearch"; + "n" = "search::SelectNextMatch"; + "shift-n" = "search::SelectPrevMatch"; + "${leader} t" = "workspace::NewCenterTerminal"; + "${leader} c" = "editor::ToggleComments"; + "${leader} w" = "workspace::Save"; + }; + } + { + "context" = "Editor && vim_mode == visual && !VimWaiting && !VimObject"; + "bindings" = { + "shift-j" = "editor::MoveLineDown"; + "shift-k" = "editor::MoveLineUp"; + }; + } + { + "context" = "Workspace"; + "bindings" = { + "ctrl-z" = "workspace::ToggleZoom"; + "cmd-k" = [ + "projects::OpenRecent" + { "create_new_window" = false; } + ]; + "ctrl-x" = "tab_switcher::CloseSelectedItem"; + }; + } + { + "context" = "Terminal"; + "bindings" = { + "cmd-t" = "workspace::NewTerminal"; + }; + } + ]; + }; +} diff --git a/apps/nogui/atuin.nix b/apps/nogui/atuin.nix new file mode 100644 index 0000000000000000000000000000000000000000..8ee816f59951ef098daa8a5aeb658f2b55ebe790 --- /dev/null +++ b/apps/nogui/atuin.nix @@ -0,0 +1,7 @@ +{ + programs.atuin = { + enable = true; + enableNushellIntegration = true; + flags = [ "--disable-up-arrow" ]; + }; +} diff --git a/apps/nogui/llm.nix b/apps/nogui/llm.nix new file mode 100644 index 0000000000000000000000000000000000000000..4ec4703db8b60ae54a081a5322e727a97a838479 --- /dev/null +++ b/apps/nogui/llm.nix @@ -0,0 +1,66 @@ +{ pkgs, lib, ... }: +let + claude = + let + inherit (pkgs) fetchFromGitHub nix-update-script python3Packages; + inherit (python3Packages) + buildPythonPackage + setuptools + anthropic + llm + pytestCheckHook + pytest + pytest-recording + ; + in + buildPythonPackage rec { + pname = "llm-claude-3"; + version = "0.4"; + pyproject = true; + + src = fetchFromGitHub { + owner = "simonw"; + repo = "llm-claude-3"; + rev = "refs/tags/${version}"; + hash = "sha256-5qF5BK319PNzB4XsLdYvtyq/SxBDdHJ9IoKWEnvNRp4="; + }; + + build-system = [ setuptools ]; + buildInputs = [ llm ]; + dependencies = [ anthropic ]; + optional-dependencies = { + test = [ + pytest + pytest-recording + ]; + }; + + # Test suite requires network access to talk to Claude (duh). + nativeCheckInputs = [ pytestCheckHook ]; + doCheck = false; + pythonImportsCheck = [ "llm_claude_3" ]; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "LLM plugin for interacting with the Claude 3 family of models"; + homepage = "https://github.com/simonw/llm-claude-3"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ jkachmar ]; + }; + }; + pyWithPackages = ( + pkgs.python3.withPackages (py: [ + py.llm + claude + ]) + ); +in +{ + home.packages = [ + (pkgs.runCommand "llm" { } '' + mkdir -p $out/bin + ln -s ${pyWithPackages}/bin/llm $out/bin/llm + '') + ]; +} diff --git a/apps/nogui/zoxide.nix b/apps/nogui/zoxide.nix new file mode 100644 index 0000000000000000000000000000000000000000..3b81ab75a76c89e205f3099234c1fd6b152cabb7 --- /dev/null +++ b/apps/nogui/zoxide.nix @@ -0,0 +1,5 @@ +{ + programs.zoxide = { + enable = true; + }; +} diff --git a/config.nix b/config.nix index 17110a96d9dbce0aebf8ee7d46db2d8e06224869..19f86c1aca633a33f788d20b5595dca35f02b45c 100644 --- a/config.nix +++ b/config.nix @@ -1,17 +1,14 @@ { pkgs ? import { }, }: -let - nixppuccin = pkgs.fetchurl { - url = "https://user.fm/files/v2-3834da30df507c4ba97a551571e98e33/nixppuccin.png"; - hash = "sha256-dwM+Wi2gse7Eu4f/suU2BsVACPHMfSaXYOpZPqx6/SQ="; - }; -in { username = "jolheiser"; - wallpaper = "${nixppuccin}"; - catppuccin = { - flavor = "mocha"; - accent = "lavender"; - }; + wallpaper = + let + src = pkgs.fetchurl { + url = "https://user.fm/files/v2-3834da30df507c4ba97a551571e98e33/nixppuccin.png"; + hash = "sha256-dwM+Wi2gse7Eu4f/suU2BsVACPHMfSaXYOpZPqx6/SQ="; + }; + in + "${src}"; } diff --git a/flake.nix b/flake.nix index f291db27e4e6a77c0d5264a162eb82462175b45d..9fcb0bef3e0038ab90627877555c386359cbf5a2 100644 --- a/flake.nix +++ b/flake.nix @@ -36,8 +36,6 @@ catppuccin, ... }@inputs: let - jolheiser = import ./config.nix { inherit pkgs; }; - system = "x86_64-linux"; overlay = _: prev: { nur = import inputs.nur { nurpkgs = prev; @@ -57,46 +55,84 @@ inherit system; overlays = [ overlay ]; config.allowUnfree = true; }; + jolheiser = import ./config.nix { inherit pkgs; }; + inherit (jolheiser) username; + commonConfig = + { config, ... }: + { + config = { + nixpkgs.overlays = [ overlay ]; + }; + }; + system = "x86_64-linux"; homeManagerModules = [ agenix.homeManagerModules.age catppuccin.homeModules.catppuccin - ./home - ./home/gui + { + home = { + inherit username; + homeDirectory = "/home/${username}"; + }; + age = { + secretsDir = "/home/${username}/.agenix/agenix"; + secretsMountPoint = "/home/${username}/.agenix/agenix.d"; + identityPaths = [ "/home/${username}/.ssh/nix" ]; + secrets = { + ssh-config.file = ./secrets/ssh-config.age; + spotify = { + file = ./secrets/spotify.age; + path = "/home/${username}/.cache/spotify-player/credentials.json"; + }; + irc-pw.file = ./secrets/irc-pw.age; + spectre-pw.file = ./secrets/spectre-pw.age; + git-send-email.file = ./secrets/git-send-email.age; + cachix = { + file = ./secrets/cachix.age; + path = "/home/${username}/.config/cachix/cachix.dhall"; + }; + llm = { + file = ./secrets/llm.age; + path = "/home/${username}/.config/io.datasette.llm/keys.json"; + }; + }; + }; + } + ./apps/gui ]; in { inherit homeManagerModules; - config = { - inherit jolheiser; - default = jolheiser; - }; - overlays = { - jolheiser = overlay; - default = overlay; - }; - homeConfigurations."jolheiser" = home-manager.lib.homeManagerConfiguration { - inherit pkgs; - extraSpecialArgs = { - inherit jolheiser; + overlays.jolheiser = overlay; + overlays.default = overlay; + homeConfigurations = { + "jolheiser" = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + extraSpecialArgs = { + inherit jolheiser; + }; + modules = homeManagerModules ++ [ ./apps/de ]; }; - modules = homeManagerModules ++ [ ./home/de ]; }; - nixosConfigurations."genmaicha" = nixpkgs.lib.nixosSystem { - inherit system; - specialArgs = { - inherit jolheiser; + nixosConfigurations = { + "genmaicha" = nixpkgs.lib.nixosSystem { + inherit system; + specialArgs = { + inherit jolheiser; + }; + modules = [ + nixos-hardware.nixosModules.framework-13-7040-amd + catppuccin.nixosModules.catppuccin + ./machines/genmaicha + commonConfig + ]; }; - modules = [ - nixos-hardware.nixosModules.framework-13-7040-amd - catppuccin.nixosModules.catppuccin - ./nixos/genmaicha - ( - { config, ... }: - { - config.nixpkgs.overlays = [ overlay ]; - } - ) - ]; + "sencha" = nixpkgs.lib.nixosSystem { + inherit system; + modules = [ + ./machines/sencha + commonConfig + ]; + }; }; devShells.${system}.default = pkgs.mkShell { nativeBuildInputs = [ diff --git a/home/de/default.nix b/apps/de/default.nix rename from home/de/default.nix rename to apps/de/default.nix index c4c41775af6b82ea28d38138fa856ca2e5d21eaa..991504a7549c78e5dda808010d7b17ae070a66e3 100644 --- a/home/de/default.nix +++ b/apps/de/default.nix @@ -1,5 +1,6 @@ { jolheiser, ... }: { + # imports = [ ./gtk.nix ]; dconf.settings = let inherit (jolheiser) wallpaper; diff --git a/home/default.nix b/home/default.nix deleted file mode 100644 index efa8b83b864053782afbc0d6a27651ee81070230..0000000000000000000000000000000000000000 --- a/home/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ jolheiser, ... }: -let - inherit (jolheiser) username; -in -{ - home = { - inherit username; - homeDirectory = "/home/${username}"; - }; - age = { - secretsDir = "/home/${username}/.agenix/agenix"; - secretsMountPoint = "/home/${username}/.agenix/agenix.d"; - identityPaths = [ "/home/${username}/.ssh/nix" ]; - }; -} diff --git a/home/gui/default.nix b/apps/gui/default.nix rename from home/gui/default.nix rename to apps/gui/default.nix index d2752fce5fc85a82c725449ccbf84ecf903e32dd..a2b81e99a7543d5d6b279102e18a8d8ad542f3fa 100644 --- a/home/gui/default.nix +++ b/apps/gui/default.nix @@ -3,14 +3,22 @@ { imports = [ ../nogui ./firefox.nix + # ./flameshot.nix ./ghostty.nix ./niri.nix + # ./obs.nix ./sherlock.nix + ./spotify.nix ./swaylock.nix ./vesktop.nix ./waybar.nix + # ./wezterm.nix ./wlogout.nix + # ./zed.nix ]; + catppuccin = { + swaylock.enable = true; + }; home = { packages = with pkgs; [ obsidian diff --git a/home/gui/firefox.nix b/apps/gui/firefox.nix rename from home/gui/firefox.nix rename to apps/gui/firefox.nix diff --git a/home/gui/ghostty.nix b/apps/gui/ghostty.nix rename from home/gui/ghostty.nix rename to apps/gui/ghostty.nix diff --git a/home/gui/niri.kdl b/apps/gui/niri.kdl rename from home/gui/niri.kdl rename to apps/gui/niri.kdl diff --git a/home/gui/niri.nix b/apps/gui/niri.nix rename from home/gui/niri.nix rename to apps/gui/niri.nix diff --git a/home/gui/sherlock.nix b/apps/gui/sherlock.nix rename from home/gui/sherlock.nix rename to apps/gui/sherlock.nix diff --git a/home/gui/swaylock.nix b/home/gui/swaylock.nix deleted file mode 100644 index 92125e5a783dec02d447f8f46764c07197cbe092..0000000000000000000000000000000000000000 --- a/home/gui/swaylock.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ jolheiser, ... }: -{ - programs.swaylock = { - enable = true; - settings = { - image = jolheiser.wallpaper; - scaling = "fill"; - }; - }; - # https://github.com/catppuccin/nix/blob/5f7dc8bab8af6ba612ef8dc7cd44e38ba6cfd51a/modules/home-manager/swaylock.nix#L13-L26 - catppuccin.swaylock.enable = true; -} diff --git a/home/gui/vesktop.nix b/apps/gui/vesktop.nix rename from home/gui/vesktop.nix rename to apps/gui/vesktop.nix diff --git a/home/gui/waybar.nix b/apps/gui/waybar.nix rename from home/gui/waybar.nix rename to apps/gui/waybar.nix diff --git a/home/gui/wlogout.nix b/apps/gui/wlogout.nix rename from home/gui/wlogout.nix rename to apps/gui/wlogout.nix diff --git a/home/nogui/aerc.nix b/apps/nogui/aerc.nix rename from home/nogui/aerc.nix rename to apps/nogui/aerc.nix index d646356dd029fad1ac210278c0eb1fe2d62c8a0d..0bf314e9f40ba6f0be41dede8eccff613f770bed 100644 --- a/home/nogui/aerc.nix +++ b/apps/nogui/aerc.nix @@ -1,7 +1,7 @@ { pkgs, ... }: { programs.aerc = { - enable = false; + enable = true; extraConfig = { general = { default-save-path = "~/Downloads"; diff --git a/home/nogui/bat.nix b/apps/nogui/bat.nix rename from home/nogui/bat.nix rename to apps/nogui/bat.nix diff --git a/home/nogui/bottom.nix b/apps/nogui/bottom.nix rename from home/nogui/bottom.nix rename to apps/nogui/bottom.nix diff --git a/home/nogui/cachix.nix b/home/nogui/cachix.nix deleted file mode 100644 index 8b30693a9aad12df9b35c478e2c467ea2067eccb..0000000000000000000000000000000000000000 --- a/home/nogui/cachix.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ jolheiser, ... }: -let - inherit (jolheiser) username; -in -{ - age.secrets.cachix = { - file = ../../secrets/cachix.age; - path = "/home/${username}/.config/cachix/cachix.dhall"; - }; -} diff --git a/home/nogui/default.nix b/apps/nogui/default.nix rename from home/nogui/default.nix rename to apps/nogui/default.nix index 09e1af020abbb9e637e2caf7984b43a015d79dab..b1a18bde12b8fe80f501079371b9507e50f4849f 100644 --- a/home/nogui/default.nix +++ b/apps/nogui/default.nix @@ -1,15 +1,10 @@ -{ - pkgs, - config, - jolheiser, - ... -}: +{ pkgs, config, ... }: { imports = [ - ./aerc.nix + # ./aerc.nix + # ./atuin.nix ./bat.nix ./bottom.nix - ./cachix.nix ./eza.nix ./fzf.nix ./git.nix @@ -17,6 +12,7 @@ ./go.nix ./gpg.nix ./jj.nix ./lazygit.nix + ./llm.nix ./lsp.nix ./nushell.nix ./oh-my-posh.nix @@ -24,19 +20,22 @@ ./rust.nix ./senpai.nix ./ssh.nix ./xdg.nix + # ./zoxide.nix ]; catppuccin = { enable = true; - inherit (jolheiser.catppuccin) accent flavor; + accent = "lavender"; + flavor = "mocha"; cursors = { enable = true; - inherit (jolheiser.catppuccin) accent; + accent = "lavender"; }; }; home = { packages = with pkgs; [ age atproto-goat + # bitwarden-cli cachix duf du-dust @@ -47,10 +46,10 @@ ripgrep usql tclip - pkgs.jolheiser.helix - pkgs.jolheiser.gomodinit - pkgs.jolheiser.cfg - pkgs.jolheiser.spectre + jolheiser.helix + jolheiser.gomodinit + jolheiser.cfg + jolheiser.spectre ]; activation.report-changes = config.lib.dag.entryAnywhere '' ${pkgs.nvd}/bin/nvd --nix-bin-dir=${pkgs.nix}/bin diff $oldGenPath $newGenPath diff --git a/home/nogui/eza.nix b/apps/nogui/eza.nix rename from home/nogui/eza.nix rename to apps/nogui/eza.nix diff --git a/home/nogui/fzf.nix b/apps/nogui/fzf.nix rename from home/nogui/fzf.nix rename to apps/nogui/fzf.nix diff --git a/home/nogui/git.nix b/apps/nogui/git.nix rename from home/nogui/git.nix rename to apps/nogui/git.nix index 85699056418ee4e3946a31afccae8b3af8ec5c8b..9cc28ea7a9b5027a89b9c40ecbe5678d59f7270e 100644 --- a/home/nogui/git.nix +++ b/apps/nogui/git.nix @@ -16,7 +16,6 @@ }; }; in { - age.secrets.git-send-email.file = ../../secrets/git-send-email.age; programs.git = { enable = true; userName = "jolheiser"; diff --git a/home/nogui/go.nix b/apps/nogui/go.nix rename from home/nogui/go.nix rename to apps/nogui/go.nix diff --git a/home/nogui/gpg.nix b/apps/nogui/gpg.nix rename from home/nogui/gpg.nix rename to apps/nogui/gpg.nix diff --git a/home/nogui/jj.nix b/apps/nogui/jj.nix rename from home/nogui/jj.nix rename to apps/nogui/jj.nix diff --git a/home/nogui/lazygit.nix b/apps/nogui/lazygit.nix rename from home/nogui/lazygit.nix rename to apps/nogui/lazygit.nix diff --git a/home/nogui/lsp.nix b/apps/nogui/lsp.nix rename from home/nogui/lsp.nix rename to apps/nogui/lsp.nix diff --git a/home/nogui/nushell.nix b/apps/nogui/nushell.nix rename from home/nogui/nushell.nix rename to apps/nogui/nushell.nix index 60421a11cd26f2ccb5ac431ec37c09a48f9727ae..95622cdd355c9a0e168b541fc720697a1d20b400 100644 --- a/home/nogui/nushell.nix +++ b/apps/nogui/nushell.nix @@ -1,6 +1,5 @@ { pkgs, config, ... }: { - age.secrets.spectre-pw.file = ../../secrets/spectre-pw.age; programs.nushell = { enable = true; configFile.source = ./nushell/config.nu; diff --git a/home/nogui/nushell/clone.nu b/apps/nogui/nushell/clone.nu rename from home/nogui/nushell/clone.nu rename to apps/nogui/nushell/clone.nu diff --git a/home/nogui/nushell/config.nu b/apps/nogui/nushell/config.nu rename from home/nogui/nushell/config.nu rename to apps/nogui/nushell/config.nu diff --git a/home/nogui/nushell/env.nu b/apps/nogui/nushell/env.nu rename from home/nogui/nushell/env.nu rename to apps/nogui/nushell/env.nu diff --git a/home/nogui/nushell/git-bug.nu b/apps/nogui/nushell/git-bug.nu rename from home/nogui/nushell/git-bug.nu rename to apps/nogui/nushell/git-bug.nu diff --git a/home/nogui/nushell/jolheiser.nu b/apps/nogui/nushell/jolheiser.nu rename from home/nogui/nushell/jolheiser.nu rename to apps/nogui/nushell/jolheiser.nu diff --git a/home/nogui/nushell/miniserve.nu b/apps/nogui/nushell/miniserve.nu rename from home/nogui/nushell/miniserve.nu rename to apps/nogui/nushell/miniserve.nu diff --git a/home/nogui/nushell/ohmyposh.nu b/apps/nogui/nushell/ohmyposh.nu rename from home/nogui/nushell/ohmyposh.nu rename to apps/nogui/nushell/ohmyposh.nu diff --git a/home/nogui/nushell/ssh.nu b/apps/nogui/nushell/ssh.nu rename from home/nogui/nushell/ssh.nu rename to apps/nogui/nushell/ssh.nu diff --git a/home/nogui/nushell/tangled.nu b/apps/nogui/nushell/tangled.nu rename from home/nogui/nushell/tangled.nu rename to apps/nogui/nushell/tangled.nu diff --git a/home/nogui/oh-my-posh.nix b/apps/nogui/oh-my-posh.nix rename from home/nogui/oh-my-posh.nix rename to apps/nogui/oh-my-posh.nix diff --git a/home/nogui/rust.nix b/apps/nogui/rust.nix rename from home/nogui/rust.nix rename to apps/nogui/rust.nix diff --git a/home/nogui/senpai.nix b/apps/nogui/senpai.nix rename from home/nogui/senpai.nix rename to apps/nogui/senpai.nix index 885366d0046d5f51a4a5b7c678d42fbf1fed86b2..a5f52c809911ad472dc453d38ba2e01fbf4f9cc8 100644 --- a/home/nogui/senpai.nix +++ b/apps/nogui/senpai.nix @@ -1,6 +1,5 @@ { config, ... }: { - age.secrets.irc-pw.file = ../../secrets/irc-pw.age; programs.senpai = { enable = true; config = { diff --git a/home/nogui/ssh.nix b/apps/nogui/ssh.nix rename from home/nogui/ssh.nix rename to apps/nogui/ssh.nix index 4f438dc8797c6007b6fa1cc7921a8e0ed45d1c09..cdccc297670b646dcfe3a57e3ef4124a36589fd1 100644 --- a/home/nogui/ssh.nix +++ b/apps/nogui/ssh.nix @@ -1,6 +1,5 @@ { config, ... }: { - age.secrets.ssh-config.file = ../../secrets/ssh-config.age; programs.ssh = { enable = true; includes = [ config.age.secrets.ssh-config.path ]; diff --git a/home/nogui/xdg.nix b/apps/nogui/xdg.nix rename from home/nogui/xdg.nix rename to apps/nogui/xdg.nix diff --git a/justfile b/justfile index a883c3a04fc21a381e8b7ee13eb776ef9d694903..75be876041824dc4cd62de3d38b010fe2760d72f 100644 --- a/justfile +++ b/justfile @@ -11,7 +11,6 @@ # Rebuild the current machine switch *args: @just rebuild switch {{args}} -# Rebuild the current home configuration hm: @git add . @home-manager switch --flake . |& nix run nixpkgs#nix-output-monitor @@ -21,5 +20,14 @@ # Rebuild the current machine for next boot boot *args: @just rebuild boot {{args}} -alias nixos := switch -alias home := hm \ No newline at end of file +# Update the flake +update-flake: + @nix flake update + +# Update an individual input +update input: + @nix flake lock --update-input {{input}} + +fetch: + @nix run nixpkgs#onefetch -- --true-color never --no-bots -d lines-of-code + @nix run nixpkgs#scc -- --no-cocomo . diff --git a/machines/sencha/default.nix b/machines/sencha/default.nix new file mode 100644 index 0000000000000000000000000000000000000000..536678f7aaca4719479c92f9761b912cdc3f2d30 --- /dev/null +++ b/machines/sencha/default.nix @@ -0,0 +1,94 @@ +{pkgs, ...}: { + imports = [ + ./hardware.nix + ../common/gui + ]; + + boot = { + kernelPackages = pkgs.linuxPackages_latest; + kernelParams = [ + "quiet" + "splash" + ]; + }; + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + boot.initrd.luks.devices."luks-c1c666de-2c68-4d50-98f1-3974ef424ff3".device = "/dev/disk/by-uuid/c1c666de-2c68-4d50-98f1-3974ef424ff3"; + + hardware = { + bluetooth.enable = true; + }; + + networking = { + hostName = "sencha"; + networkmanager.enable = true; + firewall.enable = true; + }; + + services = { + blueman.enable = true; + openssh.enable = true; + pcscd.enable = true; + printing = { + enable = true; + drivers = [ + pkgs.canon-cups-ufr2 + pkgs.cnijfilter_4_00 + ]; + }; + jellyfin = { + enable = true; + openFirewall = true; + }; + sonarr = { + enable = true; + openFirewall = true; + }; + radarr = { + enable = true; + openFirewall = true; + }; + bazarr = { + enable = true; + openFirewall = true; + }; + mullvad-vpn = { + enable = true; + package = pkgs.mullvad-vpn; + }; + resolved.enable = true; + }; + + virtualisation.docker.enable = true; + + users = { + users = { + olheiser.isNormalUser = true; + jolheiser = { + extraGroups = [ + "wheel" + "docker" + "storage" + ]; + isNormalUser = true; + }; + }; + groups.media.members = [ + "jolheiser" + "olheiser" + "jellyfin" + "radarr" + "sonarr" + ]; + }; + + environment.systemPackages = with pkgs; [ + firefox + gimp + qbittorrent + ]; + + system.stateVersion = "22.11"; +} diff --git a/machines/sencha/hardware.nix b/machines/sencha/hardware.nix new file mode 100644 index 0000000000000000000000000000000000000000..2acdb6a99923ea58327ad07cf7c2414c86cbe47a --- /dev/null +++ b/machines/sencha/hardware.nix @@ -0,0 +1,50 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ + config, + lib, + modulesPath, + ... +}: +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "usbhid" + "usb_storage" + "sd_mod" + "sr_mod" + "rtsx_usb_sdmmc" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/d1f561b1-bc50-4e34-9ca6-e973d2d9437a"; + fsType = "ext4"; + }; + + boot.initrd.luks.devices."luks-75db2e03-a875-43ee-8ca8-70507b421641".device = "/dev/disk/by-uuid/75db2e03-a875-43ee-8ca8-70507b421641"; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/A8A8-1D01"; + fsType = "vfat"; + }; + + swapDevices = [ { device = "/dev/disk/by-uuid/5c3eb124-674b-4315-890d-137275aab504"; } ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/nixos/common/gui/default.nix b/machines/common/gui/default.nix rename from nixos/common/gui/default.nix rename to machines/common/gui/default.nix index 597a86262cb0b9ee63b8a9312333c9a901903360..701b0bc1dcc3dfe26f15167b3262e496617f7709 100644 --- a/nixos/common/gui/default.nix +++ b/machines/common/gui/default.nix @@ -24,7 +24,8 @@ }; programs = { niri.enable = true; }; - catppuccin = {}; + catppuccin = { + }; fonts.packages = with pkgs.nerd-fonts; [ hack iosevka diff --git a/nixos/common/nogui/default.nix b/machines/common/nogui/default.nix rename from nixos/common/nogui/default.nix rename to machines/common/nogui/default.nix index 001a348435bd0ce105459e38e75e95c70f3fe59b..8bce6008c9fb06510a5d9f9ba5919c34cefea1c7 100644 --- a/nixos/common/nogui/default.nix +++ b/machines/common/nogui/default.nix @@ -1,4 +1,4 @@ -{ pkgs, jolheiser, ... }: +{ pkgs, ... }: { console.colors = [ "1e1e2e" @@ -75,7 +75,8 @@ }; catppuccin = { enable = true; - inherit (jolheiser.catppuccin) accent flavor; + accent = "lavender"; + flavor = "mocha"; }; services.tailscale.enable = true; } diff --git a/nixos/genmaicha/default.nix b/machines/genmaicha/default.nix rename from nixos/genmaicha/default.nix rename to machines/genmaicha/default.nix diff --git a/nixos/genmaicha/hardware.nix b/machines/genmaicha/hardware.nix rename from nixos/genmaicha/hardware.nix rename to machines/genmaicha/hardware.nix diff --git a/secrets/cachix.age b/secrets/cachix.age index a7b24f4760a9d709e4db51ddb095b30697b03c5c..d8429a870b8d16a08be9ab8536f9adf41cc45149 100644 --- a/secrets/cachix.age +++ b/secrets/cachix.age @@ -1,5 +1,14 @@ age-encryption.org/v1 --> ssh-ed25519 E8j6/g o/Krgshl0sXkSDCBqtg3N9Qws+oxLZXAmpE/bGO+PTs -yRp0J4vSriGpDU2UZIwjuOMBnIeh/xSdkT7idSiRPgE ---- icqa4WmfxUH+sLvizzk4rP7XnzHztjVqeLXBiVQXa8k - LUQM#ZޕZZnv͔*{~^ϱU1u@@W ʴ%<ʡ!5)V7{65OvyGߋ٪)[e:-xLv[δmN uWol/xPQVA ^Eᨳ;i&~,=kjodOGjwakS.Lf\coqml/NK \ No newline at end of file +-> ssh-ed25519 E8j6/g x3c1iPetBHh6UHUPC0lbdsikCL8QfL/nsyma/4iYZTs +tuvd6dfr4kcYakitJ4ke5Ru31jiJh8942XzhhSytwIg +-> ssh-ed25519 xUMv2w j2ptgF7kd9RKBHut2n++jCDDp3mLKm4gIHpIG9Hg2xw +390rYja1NPESmRCXgbiUJJVRQQEt5NLw+kySAk0vbWI +-> ssh-ed25519 ph+d2g 9NDTnvI0w2ooUsa1IlyYScNie4HcuUj3kk1C8mADakA +u9uQkf3YC0yuWX//58YMYdXjAOYLXQhj56zwGIIlpY8 +-> ssh-ed25519 Cuo7gw PagCT6dPTNZH4mfUyBWYmWp9f4LPsf7u3BIWg1r0VHM +Uem6hhHcUvAXSCezB0qiO0J2MI0BnO560MAP6UWhnFA +-> ssh-ed25519 f31uNA 2MXm2EGDzWn8KT0AE35rhKMi8XBntmGXj8Mlx1DSfgw +ul4HdMXxWQSbqLJHLABits78rCBL0geTkT++ru9QWKI +--- 8Sfze/lOcjaaD52+EST5endtf3Za9wFqFqggxpXwp8s +Uma1~4 @堺甅_pD / rC5N3'ĽVV|[R ĕ< / _OUe7ѥws?C1Hhx( bP))HQ6W0ܝ .{  +ݥQ|RJm6:T.NoI#aBc-*J~gC-CαKorCG@A7Xj]å7 ,?ܗvp \ No newline at end of file diff --git a/secrets/git-send-email.age b/secrets/git-send-email.age index 680aefc57e2ab714da09ea8a1d46b533a8a75f1a..f51619ef3907bb00d74c519e7ec085604a9eecb5 100644 --- a/secrets/git-send-email.age +++ b/secrets/git-send-email.age @@ -1,7 +1,14 @@ age-encryption.org/v1 --> ssh-ed25519 E8j6/g 8wO/tHv3Oi9h6YDgV6oBmEKZS/PiL8fQb0V//dDvzXo -UEgcAxlQ3iHnHBDMNsU5R4kPvFMlYN6MzFWUjBC8BBE ---- U9NZBCDqOyCJxWUJ4TwV9xlWlS8+MoDz273JKW38jww -B-#N2 pMЗ>L[D5>٤`.Y(Jm|a?}آf6s:ʳ]J8 5<Dn=:aMG|[fU˕M -n]_eY˘ -QD<8Z_58va \ No newline at end of file +-> ssh-ed25519 E8j6/g EKCyCihc4z2NLVAiBRbZ1uH1FwPUAeGW68XhfXpJGF8 +GD7M0zuA9hChzMmk2JEv+QX3MKQJFJZiv51xtLr+gtQ +-> ssh-ed25519 xUMv2w bhsKkj43DxtvK3NaEZK65fBdS+xnc1DqiiE0PIUQTnI +RPe/s7Mp1d+Lw3bLJZb6BRYW/NiOEy2AYwFHaWo621s +-> ssh-ed25519 ph+d2g k8XRPSnnoGUSv9XwJuak/58OKkM5YU02z5gqqaTeHFc +HCavoYTWGtwpa4ks4lbmDXlUgMW/1UAJD11DDAIpUH8 +-> ssh-ed25519 Cuo7gw Jafczm8V39xIZY3nS9OMNLnVnTvbB1D/P1mK07FSiQc +2ifBGz9HTrXGEj8fsfVwlo+2p5vguPfHImpmDvlnNqs +-> ssh-ed25519 f31uNA XEICU4Q3ZffuH5qImvpmrtTZGkOxJKBVufMpkOoVZCI +9p23bQyXY3PPjNoGRiWeXRVrJ/RRqVXNvj+fTcGDxdw +--- /ZxBUSYTe77GXFvpEof5OoVmL9ranjJrtYYrJ2Ye5IM ++4?uMaK3l'|Gi@݈321Z~5Ȥz:h1P}2[ + a" eyb҅.ڄOH^u1G$)<[9R>Vr͝o҂p:E;~|ky`Yj܍&M( \ No newline at end of file diff --git a/secrets/irc-pw.age b/secrets/irc-pw.age index 06d91e92f39a8fab31a4b4d75697a81dcba499db..d1d3c76b67545da99342755835651e91ccfa93b3 100644 Binary files a/secrets/irc-pw.age and b/secrets/irc-pw.age differ diff --git a/secrets/llm.age b/secrets/llm.age new file mode 100644 index 0000000000000000000000000000000000000000..6ca7f7dca18b325eb5deb7fe34193ae2c5b77436 --- /dev/null +++ b/secrets/llm.age @@ -0,0 +1,14 @@ +age-encryption.org/v1 +-> ssh-ed25519 E8j6/g p21/KPTNTZrRXQUvPtlkHZuiFyNGkJWxF/yfhn643gk +jnN29WaHvFjMIjzVe0hkOEcolovBwjcgc2RfDlgY97E +-> ssh-ed25519 xUMv2w Dvet20WUzCfQeoKrdmCb12ouUNlePgFDdKEUZP82PmA +Prj/pjjj+oDqwKq+Q59aSj80YqICcgvulCBVy8CYx5Q +-> ssh-ed25519 ph+d2g vvjz0afKneI+lpiGGm8JuDTlJDlmoUygm/roW1vQphw +imYWGoW9O4MTbwTqXC5+5bH9sBf6qgkEJ8tNDtx6B0E +-> ssh-ed25519 Cuo7gw zUGiEgCtGzwZOVUl5T3jMBdwYzf657jMAbfJ/G1uGX8 +jeoWPVh4+AVyGqdZlG1Do3XHT/bwojZsT14I8E3aF1s +-> ssh-ed25519 f31uNA KmRTboipwSZZyDV1d69x4Apn0IjeboMxhmFVJBm72XI +Rgk4ranEXY0mcyBX7nWnW31yKZ8J3hrfzMV5NeQ3tLk +--- RW/X1U5gc3VSKroi8ZAIHZt4tvNShY/viK2TE2WSY4Q +|ut֐ Pf^