From 7d7f81d9cee375b1d9f712377105a0a39e7e2a5c Mon Sep 17 00:00:00 2001 From: Dennis Schoepf Date: Tue, 3 Mar 2026 23:26:16 +0100 Subject: [PATCH] fully migrates dnsc-machine --- Justfile | 23 +++ flake.lock | 57 ++++++- flake.nix | 4 + modules/browser/default.nix | 18 ++ modules/desktop/default.nix | 13 ++ modules/drawing-tablet/default.nix | 4 + modules/hosts/dnsc-machine/default.nix | 2 + modules/ssh/default.nix | 67 ++++++++ modules/terminal/default.nix | 156 ++++++++++++++++++ modules/terminal/tmuxinator-layouts/dnsc.yml | 11 ++ modules/terminal/tmuxinator-layouts/main.yml | 7 + .../tmuxinator-layouts/nix-config.yml | 7 + modules/terminal/tmuxinator-layouts/notes.yml | 11 ++ .../terminal/tmuxinator-layouts/proglog.yml | 11 ++ 14 files changed, 390 insertions(+), 1 deletion(-) create mode 100644 Justfile create mode 100644 modules/browser/default.nix create mode 100644 modules/ssh/default.nix create mode 100644 modules/terminal/default.nix create mode 100644 modules/terminal/tmuxinator-layouts/dnsc.yml create mode 100644 modules/terminal/tmuxinator-layouts/main.yml create mode 100644 modules/terminal/tmuxinator-layouts/nix-config.yml create mode 100644 modules/terminal/tmuxinator-layouts/notes.yml create mode 100644 modules/terminal/tmuxinator-layouts/proglog.yml diff --git a/Justfile b/Justfile new file mode 100644 index 0000000..c493abe --- /dev/null +++ b/Justfile @@ -0,0 +1,23 @@ +deploy host: + nixos-rebuild switch --flake .#{{host}} + +debug host: + nixos-rebuild switch --flake .#{{host}} --show-trace --verbose + +dry host: + nix build .#nixosConfigurations.{{host}}.config.system.build.toplevel --dry-run --no-link + +update: + nix flake update + +history: + nix profile history --profile /nix/var/nix/profiles/system + +repl: + nix repl -f flake:nixpkgs + +clean: + nix profile wipe-history --profile /nix/var/nix/profiles/system --older-than 7d + +gc: + sudo nix-collect-garbage --delete-old diff --git a/flake.lock b/flake.lock index ff8c6fd..6712a6e 100644 --- a/flake.lock +++ b/flake.lock @@ -41,6 +41,27 @@ "type": "github" } }, + "helium": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "utils": "utils" + }, + "locked": { + "lastModified": 1772003810, + "narHash": "sha256-FfaHvYDfcWZ+0ZPkWDVywkglmQjBq0DoIqzl7TH2hXc=", + "owner": "schembriaiden", + "repo": "helium-browser-nix-flake", + "rev": "9001c8ec8bb3a4b9103eca2f2fc707bda1401977", + "type": "github" + }, + "original": { + "owner": "schembriaiden", + "repo": "helium-browser-nix-flake", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -130,7 +151,7 @@ "inputs": { "flake-parts": "flake-parts_2", "nixpkgs": "nixpkgs_2", - "systems": "systems" + "systems": "systems_2" }, "locked": { "lastModified": 1772402258, @@ -149,6 +170,7 @@ "root": { "inputs": { "flake-parts": "flake-parts", + "helium": "helium", "home-manager": "home-manager", "import-tree": "import-tree", "nix-darwin": "nix-darwin", @@ -173,6 +195,39 @@ "repo": "default", "type": "github" } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "utils": { + "inputs": { + "systems": "systems" + }, + "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" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 1632df0..b93f3bd 100644 --- a/flake.nix +++ b/flake.nix @@ -13,6 +13,10 @@ inputs.nixpkgs.follows = "nixpkgs"; url = "github:LnL7/nix-darwin/master"; }; + helium = { + url = "github:schembriaiden/helium-browser-nix-flake"; + inputs.nixpkgs.follows = "nixpkgs"; + }; nixpkgs.url = "https://channels.nixos.org/nixpkgs-unstable/nixexprs.tar.xz"; nixpkgs-lib.follows = "nixpkgs"; nixvim.url = "github:nix-community/nixvim"; diff --git a/modules/browser/default.nix b/modules/browser/default.nix new file mode 100644 index 0000000..d0ea770 --- /dev/null +++ b/modules/browser/default.nix @@ -0,0 +1,18 @@ +{ inputs, ... }: +{ + flake.modules.nixos.browser = + { pkgs, system, ... }: + { + environment.systemPackages = [ + inputs.helium.packages.${system}.default + ]; + }; + + flake.modules.darwin.browser = + { pkgs, system, ... }: + { + environment.systemPackages = [ + inputs.helium.packages.${system}.default + ]; + }; +} diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index b288dc5..3690be7 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -10,6 +10,19 @@ environment.cosmic.excludePackages = with pkgs; [ cosmic-term ]; + + environment.systemPackages = with pkgs; [ + bibata-cursors + nerd-fonts.victor-mono + gimp + darktable + ]; + + fonts.fontconfig = { + enable = true; + antialiasing = true; + defaultFonts.monospace = [ "VictorMono Nerd Font" ]; + }; }; # TODO: Persist ~/.config/cosmic after setup diff --git a/modules/drawing-tablet/default.nix b/modules/drawing-tablet/default.nix index aa10c00..f9e1a96 100644 --- a/modules/drawing-tablet/default.nix +++ b/modules/drawing-tablet/default.nix @@ -6,5 +6,9 @@ hardware.opentabletdriver.enable = true; hardware.uinput.enable = true; boot.kernelModules = [ "uinput" ]; + + environment.systemPackages = with pkgs; [ + krita + ]; }; } diff --git a/modules/hosts/dnsc-machine/default.nix b/modules/hosts/dnsc-machine/default.nix index 2b0f3c4..d4ef234 100644 --- a/modules/hosts/dnsc-machine/default.nix +++ b/modules/hosts/dnsc-machine/default.nix @@ -9,12 +9,14 @@ in home-manager base shell + ssh cli-tools nix nvidia-graphics drawing-tablet printing desktop + terminal gaming { diff --git a/modules/ssh/default.nix b/modules/ssh/default.nix new file mode 100644 index 0000000..432b27d --- /dev/null +++ b/modules/ssh/default.nix @@ -0,0 +1,67 @@ +{ inputs, ... }: +{ + flake.modules.nixos.ssh = + { pkgs, ... }: + { + services.openssh.enable = true; + + home-manager.sharedModules = [ + inputs.self.modules.homeManager.ssh + ]; + }; + + flake.modules.darwin.ssh = + { pkgs, ... }: + { + services.openssh.enable = true; + + home-manager.sharedModules = [ + inputs.self.modules.homeManager.ssh + ]; + }; + + flake.modules.homeManager.ssh = + { pkgs, config, ... }: + { + programs.ssh = { + enable = true; + enableDefaultConfig = false; + matchBlocks = { + "*" = { + addKeysToAgent = "yes"; + }; + "dnsc-machine" = { + hostname = "192.168.178.250"; + user = "dennis"; + identityFile = "${config.home.homeDirectory}/.ssh/id_ed25519"; + identitiesOnly = true; + }; + "dnsc-server" = { + hostname = "192.168.178.69"; + user = "dennis"; + identityFile = "${config.home.homeDirectory}/.ssh/id_ed25519"; + identitiesOnly = true; + }; + "dnsc-vps-sm" = { + hostname = "91.99.21.186"; + user = "dennis"; + identityFile = "${config.home.homeDirectory}/.ssh/id_ed25519"; + identitiesOnly = true; + }; + "dnsc-storage" = { + hostname = "u295965.your-storagebox.de"; + user = "u295965"; + identityFile = "${config.home.homeDirectory}/.ssh/id_ed25519"; + identitiesOnly = true; + port = 23; + }; + "dnsc-storage-sftp" = { + hostname = "u295965.your-storagebox.de"; + user = "u295965"; + identityFile = "${config.home.homeDirectory}/.ssh/id_ed25519"; + port = 22; + }; + }; + }; + }; +} diff --git a/modules/terminal/default.nix b/modules/terminal/default.nix new file mode 100644 index 0000000..211d099 --- /dev/null +++ b/modules/terminal/default.nix @@ -0,0 +1,156 @@ +{ inputs, ... }: +{ + flake.modules.nixos.terminal = + { pkgs, ... }: + { + home-manager.sharedModules = [ + inputs.self.modules.homeManager.terminal + ]; + }; + + flake.modules.darwin.terminal = + { pkgs, ... }: + { + home-manager.sharedModules = [ + inputs.self.modules.homeManager.terminal + ]; + }; + + flake.modules.homeManager.terminal = + { pkgs, config, ... }: + { + programs.ghostty = { + enable = true; + enableFishIntegration = true; + settings = { + font-size = 14; + font-family = "VictorMono Nerd Font"; + font-style = "SemiBold"; + background-opacity = 0.945; + window-padding-x = 0; + window-padding-y = 0; + window-padding-balance = true; + window-inherit-working-directory = true; + window-theme = "ghostty"; + shell-integration-features = true; + scrollback-limit = 100000; + link-url = true; + link-previews = true; + title = " "; + background = "#0f0b15"; + foreground = "#ffffff"; + cursor-color = "#d369af"; + selection-foreground = "#af85ea"; + selection-background = "#572454"; + palette = [ + "0=#0f0b15" + "1=#f47359" + "2=#29a444" + "3=#b58a52" + "4=#3f95f6" + "5=#d369af" + "6=#4fbaef" + "7=#b8c6d5" + "8=#807c9f" + "9=#ff6a7a" + "10=#00a392" + "11=#df9080" + "12=#029fff" + "13=#af85ea" + "14=#35afbf" + "15=#ffffff" + ]; + keybind = [ + "ctrl+plus=increase_font_size:2" + "ctrl+minus=decrease_font_size:2" + "ctrl+0=reset_font_size" + "ctrl+shift+a=select_all" + "ctrl+shift+c=copy_to_clipboard" + "ctrl+shift+v=paste_from_clipboard" + "cmd+c=copy_to_clipboard" + "cmd+v=paste_from_clipboard" + ]; + }; + }; + + programs.tmux = { + enable = true; + package = pkgs.tmux; + baseIndex = 1; + clock24 = true; + disableConfirmationPrompt = true; + mouse = true; + newSession = true; + prefix = "C-b"; + shell = "${pkgs.fish}/bin/fish"; + terminal = "screen-256color"; + keyMode = "vi"; + escapeTime = 0; + plugins = with pkgs; [ + { + plugin = tmuxPlugins.resurrect; + extraConfig = '' + set -g @resurrect-strategy-nvim 'session' + set -g @resurrect-capture-pane-contents 'on' + ''; + } + { + plugin = tmuxPlugins.continuum; + extraConfig = '' + set -g @continuum-restore 'on' + set -g @continuum-boot 'on' + set -g @continuum-save-interval '10' + ''; + } + ]; + extraConfig = '' + set -g status-position top + set -g status-style bg=#1d202f,fg=white + set -g status-left "" + set -g status-right "#[bg=default,fg=magenta]>> #S << #[bg=default,fg=white]#H " + set-window-option -g window-status-style 'fg=magenta,bg=#1d202f' + set-window-option -g window-status-format ' #I #[fg=white]#W #[fg=cyan]#F ' + set-window-option -g window-status-current-style "fg=black,bg=magenta" + set-window-option -g window-status-current-format " #I #W #F " + set -g pane-border-style fg=#807c9f + set -g pane-active-border-style fg=magenta + set -g message-style "fg=black,bg=red,bold" + + unbind % + bind "|" split-window -h + unbind '"' + bind - split-window -l 15 -v + + bind r source-file "~/.config/tmux/tmux.conf" + + bind h select-pane -L + bind j select-pane -D + bind k select-pane -U + bind l select-pane -R + + bind -r H resize-pane -L 5 + bind -r J resize-pane -D 5 + bind -r K resize-pane -U 5 + bind -r L resize-pane -R 5 + + bind ? list-keys -a + + unbind s + bind s display-popup -h 50% -w 80% -E sessionizer + + unbind g + bind g display-popup -h 90% -w 95% -E lazygit + + unbind C-x + bind C-x kill-session + + unbind v + bind v choose-tree -Zw "join-pane -t '%%'" + ''; + }; + + xdg.configFile."tmuxinator" = { + source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/dev/nix-config/modules/terminal/tmuxinator-layouts"; + }; + }; +} diff --git a/modules/terminal/tmuxinator-layouts/dnsc.yml b/modules/terminal/tmuxinator-layouts/dnsc.yml new file mode 100644 index 0000000..c182d28 --- /dev/null +++ b/modules/terminal/tmuxinator-layouts/dnsc.yml @@ -0,0 +1,11 @@ +name: dnsc-io +root: ~/dev/dnsc-io +windows: + - dev: + layout: main-horizontal + panes: + - nvim +"lua Snacks.picker.files({ hidden = true })" + - run: + layout: main-vertical + panes: + - "pnpm dev" diff --git a/modules/terminal/tmuxinator-layouts/main.yml b/modules/terminal/tmuxinator-layouts/main.yml new file mode 100644 index 0000000..aaf99be --- /dev/null +++ b/modules/terminal/tmuxinator-layouts/main.yml @@ -0,0 +1,7 @@ +name: main +root: ~/ +windows: + - default: + layout: main-vertical + panes: + - clear diff --git a/modules/terminal/tmuxinator-layouts/nix-config.yml b/modules/terminal/tmuxinator-layouts/nix-config.yml new file mode 100644 index 0000000..9f9db2e --- /dev/null +++ b/modules/terminal/tmuxinator-layouts/nix-config.yml @@ -0,0 +1,7 @@ +name: nix-config +root: ~/dev/nix-config/ +windows: + - code: + layout: main-horizontal + panes: + - nvim +"lua Snacks.picker.files({ hidden = true })" diff --git a/modules/terminal/tmuxinator-layouts/notes.yml b/modules/terminal/tmuxinator-layouts/notes.yml new file mode 100644 index 0000000..814af92 --- /dev/null +++ b/modules/terminal/tmuxinator-layouts/notes.yml @@ -0,0 +1,11 @@ +name: notes +root: ~/dev/notes +windows: + - code: + layout: main-horizontal + panes: + - nvim +"lua Snacks.picker.files({ hidden = true })" + - run: + layout: even-vertical + panes: + - clear diff --git a/modules/terminal/tmuxinator-layouts/proglog.yml b/modules/terminal/tmuxinator-layouts/proglog.yml new file mode 100644 index 0000000..4d0f235 --- /dev/null +++ b/modules/terminal/tmuxinator-layouts/proglog.yml @@ -0,0 +1,11 @@ +name: proglog +root: ~/dev/proglog +windows: + - dev: + layout: main-horizontal + panes: + - nvim +"lua Snacks.picker.files({ hidden = true })" + - run: + layout: main-vertical + panes: + - echo ">> Run proglog tasks here"