diff --git a/bin/backup.sh b/bin/backup.sh new file mode 100755 index 0000000..3a79c3f --- /dev/null +++ b/bin/backup.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +# Define the backup directory +BACKUP_DIR=~/Backup + +# Create the backup directory if it doesn't exist +if [ ! -d "$BACKUP_DIR" ]; then + echo "Creating backup directory at $BACKUP_DIR" + mkdir -p "$BACKUP_DIR" +fi + +# Define the backup file name with a timestamp +BACKUP_FILE="$BACKUP_DIR/backup-$(date -d "today" +"%Y%m%d%H%M").tar" + +# Define the directories to be backed up +# Note: ~ is expanded by the shell, so it's used directly here. +DIRECTORIES_TO_BACKUP=( + ~/.gnupg + ~/.ssh + ~/Documents + ~/Pictures + ~/org + ~/nixos-dotfiles + ~/susano-nixos + ~/hetzner-nixos + ~/.authinfo.gpg +) + +# Create the tar archive, excluding specified folders +echo "Starting backup..." +tar --exclude='.direnv' --exclude='.git' --exclude='node_modules' -cf "$BACKUP_FILE" "${DIRECTORIES_TO_BACKUP[@]}" + +# Check if the tar command was successful +if [ $? -eq 0 ]; then + echo "Backup successful: $BACKUP_FILE" +else + echo "Backup failed." + exit 1 +fi + +exit 0 diff --git a/flake.lock b/flake.lock index aed363c..25cde1b 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,105 @@ { "nodes": { + "aquamarine": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1752743471, + "narHash": "sha256-4izhj1j7J4mE8LgljCXSIUDculqOsxxhdoC81VhqizM=", + "owner": "hyprwm", + "repo": "aquamarine", + "rev": "e31b575d19e7cf8a8f4398e2f9cffe27a1332506", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "aquamarine", + "type": "github" + } + }, + "base16": { + "inputs": { + "fromYaml": "fromYaml" + }, + "locked": { + "lastModified": 1746562888, + "narHash": "sha256-YgNJQyB5dQiwavdDFBMNKk1wyS77AtdgDk/VtU6wEaI=", + "owner": "SenchoPens", + "repo": "base16.nix", + "rev": "806a1777a5db2a1ef9d5d6f493ef2381047f2b89", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "base16.nix", + "type": "github" + } + }, + "base16-fish": { + "flake": false, + "locked": { + "lastModified": 1622559957, + "narHash": "sha256-PebymhVYbL8trDVVXxCvZgc0S5VxI7I1Hv4RMSquTpA=", + "owner": "tomyun", + "repo": "base16-fish", + "rev": "2f6dd973a9075dabccd26f1cded09508180bf5fe", + "type": "github" + }, + "original": { + "owner": "tomyun", + "repo": "base16-fish", + "type": "github" + } + }, + "base16-helix": { + "flake": false, + "locked": { + "lastModified": 1752979451, + "narHash": "sha256-0CQM+FkYy0fOO/sMGhOoNL80ftsAzYCg9VhIrodqusM=", + "owner": "tinted-theming", + "repo": "base16-helix", + "rev": "27cf1e66e50abc622fb76a3019012dc07c678fac", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-helix", + "type": "github" + } + }, + "base16-vim": { + "flake": false, + "locked": { + "lastModified": 1732806396, + "narHash": "sha256-e0bpPySdJf0F68Ndanwm+KWHgQiZ0s7liLhvJSWDNsA=", + "owner": "tinted-theming", + "repo": "base16-vim", + "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-vim", + "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", + "type": "github" + } + }, "copyparty": { "inputs": { "flake-utils": "flake-utils", @@ -39,6 +139,79 @@ "type": "github" } }, + "emacs-overlay": { + "inputs": { + "nixpkgs": "nixpkgs_2", + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1754015942, + "narHash": "sha256-a1rKs50GWP8RUI8bFXuhXPxeUgOvYiNxsk4Jf7cdzCw=", + "owner": "nix-community", + "repo": "emacs-overlay", + "rev": "b7b0edd24abbdd05fde75c80d59001c9fd9b5598", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "master", + "repo": "emacs-overlay", + "type": "github" + } + }, + "firefox-gnome-theme": { + "flake": false, + "locked": { + "lastModified": 1748383148, + "narHash": "sha256-pGvD/RGuuPf/4oogsfeRaeMm6ipUIznI2QSILKjKzeA=", + "owner": "rafaelmardojai", + "repo": "firefox-gnome-theme", + "rev": "4eb2714fbed2b80e234312611a947d6cb7d70caf", + "type": "github" + }, + "original": { + "owner": "rafaelmardojai", + "repo": "firefox-gnome-theme", + "type": "github" + } + }, + "flake-compat": { + "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-parts": { + "inputs": { + "nixpkgs-lib": [ + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1751413152, + "narHash": "sha256-Tyw1RjYEsp5scoigs1384gIg6e0GoBVjms4aXFfRssQ=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "77826244401ea9de6e3bac47c2db46005e1f30b5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "flake-utils": { "locked": { "lastModified": 1678901627, @@ -56,7 +229,7 @@ }, "flake-utils_2": { "inputs": { - "systems": "systems" + "systems": "systems_3" }, "locked": { "lastModified": 1681202837, @@ -72,6 +245,61 @@ "type": "github" } }, + "fromYaml": { + "flake": false, + "locked": { + "lastModified": 1731966426, + "narHash": "sha256-lq95WydhbUTWig/JpqiB7oViTcHFP8Lv41IGtayokA8=", + "owner": "SenchoPens", + "repo": "fromYaml", + "rev": "106af9e2f715e2d828df706c386a685698f3223b", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "fromYaml", + "type": "github" + } + }, + "gitignore": { + "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" + } + }, + "gnome-shell": { + "flake": false, + "locked": { + "lastModified": 1748186689, + "narHash": "sha256-UaD7Y9f8iuLBMGHXeJlRu6U1Ggw5B9JnkFs3enZlap0=", + "owner": "GNOME", + "repo": "gnome-shell", + "rev": "8c88f917db0f1f0d80fa55206c863d3746fa18d0", + "type": "github" + }, + "original": { + "owner": "GNOME", + "ref": "48.2", + "repo": "gnome-shell", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -93,6 +321,353 @@ "type": "github" } }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "zen-browser", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1752603129, + "narHash": "sha256-S+wmHhwNQ5Ru689L2Gu8n1OD6s9eU9n9mD827JNR+kw=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "e8c19a3cec2814c754f031ab3ae7316b64da085b", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "hyprcursor": { + "inputs": { + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1749155331, + "narHash": "sha256-XR9fsI0zwLiFWfqi/pdS/VD+YNorKb3XIykgTg4l1nA=", + "owner": "hyprwm", + "repo": "hyprcursor", + "rev": "45fcc10b4c282746d93ec406a740c43b48b4ef80", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprcursor", + "type": "github" + } + }, + "hyprgraphics": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1752149140, + "narHash": "sha256-gbh1HL98Fdqu0jJIWN4OJQN7Kkth7+rbkFpSZLm/62A=", + "owner": "hyprwm", + "repo": "hyprgraphics", + "rev": "340494a38b5ec453dfc542c6226481f736cc8a9a", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprgraphics", + "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": [ + "unstable" + ], + "pre-commit-hooks": "pre-commit-hooks", + "systems": "systems", + "xdph": "xdph" + }, + "locked": { + "lastModified": 1754039866, + "narHash": "sha256-5emAMxu7WCX4CBMvd+0/6zBO78uyJOezD3AK4NNGcTA=", + "ref": "refs/heads/main", + "rev": "314a0ea441e33122836965c50d4c5bcf9acd0cdd", + "revCount": 6331, + "type": "git", + "url": "https://github.com/hyprwm/Hyprland" + }, + "original": { + "type": "git", + "url": "https://github.com/hyprwm/Hyprland" + } + }, + "hyprland-plugins": { + "inputs": { + "hyprland": [ + "hyprland" + ], + "nixpkgs": [ + "hyprland-plugins", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland-plugins", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1754049221, + "narHash": "sha256-GJsWeim2z+0taA6UgtjF1DnOuTMVzyl35d69W/lZLtM=", + "owner": "hyprwm", + "repo": "hyprland-plugins", + "rev": "827a1815b8189c2ac611847352ec000b01f24a2b", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-plugins", + "type": "github" + } + }, + "hyprland-protocols": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1749046714, + "narHash": "sha256-kymV5FMnddYGI+UjwIw8ceDjdeg7ToDVjbHCvUlhn14=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "613878cb6f459c5e323aaafe1e6f388ac8a36330", + "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": 1749154592, + "narHash": "sha256-DO7z5CeT/ddSGDEnK9mAXm1qlGL47L3VAHLlLXoCjhE=", + "owner": "hyprwm", + "repo": "hyprland-qt-support", + "rev": "4c8053c3c888138a30c3a6c45c2e45f5484f2074", + "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": 1750371812, + "narHash": "sha256-D868K1dVEACw17elVxRgXC6hOxY+54wIEjURztDWLk8=", + "owner": "hyprwm", + "repo": "hyprland-qtutils", + "rev": "b13c7481e37856f322177010bdf75fccacd1adc8", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-qtutils", + "type": "github" + } + }, + "hyprlang": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1750371198, + "narHash": "sha256-/iuJ1paQOBoSLqHflRNNGyroqfF/yvPNurxzcCT0cAE=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "cee01452bca58d6cadb3224e21e370de8bc20f0b", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, + "hyprutils": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1753800567, + "narHash": "sha256-W0xgXsaqGa/5/7IBzKNhf0+23MqGPymYYfqT7ECqeTE=", + "owner": "hyprwm", + "repo": "hyprutils", + "rev": "c65d41d4f4e6ded6fdb9d508a73e2fe90e55cdf7", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprutils", + "type": "github" + } + }, + "hyprwayland-scanner": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1751897909, + "narHash": "sha256-FnhBENxihITZldThvbO7883PdXC/2dzW4eiNvtoV5Ao=", + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "rev": "fcca0c61f988a9d092cbb33e906775014c61579d", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "type": "github" + } + }, + "nix-filter": { + "locked": { + "lastModified": 1693833173, + "narHash": "sha256-hlMABKrGbEiJD5dwUSfnw1CQ3bG7KKwDV+Nx3bEZd7U=", + "owner": "numtide", + "repo": "nix-filter", + "rev": "ac030bd9ba98e318e1f4c4328d60766ade8ebe8b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "nix-filter", + "type": "github" + } + }, + "nix-ld": { + "inputs": { + "nixpkgs": [ + "unstable" + ] + }, + "locked": { + "lastModified": 1753702960, + "narHash": "sha256-g8N9NSrZs7EE6EpKroIa8rYQ/t+qTKjLoVBHHt6qNhg=", + "owner": "Mic92", + "repo": "nix-ld", + "rev": "bc1a7a1b88589bfd26846fc5341fe44fc73b3fbd", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "nix-ld", + "type": "github" + } + }, "nixlib": { "locked": { "lastModified": 1736643958, @@ -160,7 +735,39 @@ "type": "indirect" } }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1751274312, + "narHash": "sha256-/bVBlRpECLVzjV19t5KMdMFWSwKLtb5RyXdjz3LJT+g=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "50ab793786d9de88ee30ec4e4c24fb4236fc2674", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.11", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { + "locked": { + "lastModified": 1753694789, + "narHash": "sha256-cKgvtz6fKuK1Xr5LQW/zOUiAC0oSQoA9nOISB0pJZqM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "dc9637876d0dcc8c9e5e22986b857632effeb727", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1753345091, "narHash": "sha256-CdX2Rtvp5I8HGu9swBmYuq+ILwRxpXdJwlpg8jvN4tU=", @@ -176,7 +783,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1682134069, "narHash": "sha256-TnI/ZXSmRxQDt2sjRYK/8j8iha4B4zP2cnQCZZ3vp7k=", @@ -190,17 +797,89 @@ "type": "indirect" } }, + "nixpkgs_5": { + "locked": { + "lastModified": 1752480373, + "narHash": "sha256-JHQbm+OcGp32wAsXTE/FLYGNpb+4GLi5oTvCxwSoBOA=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "62e0f05ede1da0d54515d4ea8ce9c733f12d9f08", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nur": { + "inputs": { + "flake-parts": [ + "stylix", + "flake-parts" + ], + "nixpkgs": [ + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1751906969, + "narHash": "sha256-BSQAOdPnzdpOuCdAGSJmefSDlqmStFNScEnrWzSqKPw=", + "owner": "nix-community", + "repo": "NUR", + "rev": "ddb679f4131e819efe3bbc6457ba19d7ad116f25", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat", + "gitignore": "gitignore", + "nixpkgs": [ + "hyprland", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1750779888, + "narHash": "sha256-wibppH3g/E2lxU43ZQHC5yA/7kIKLGxVEnsnVK1BtRg=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "16ec914f6fb6f599ce988427d9d94efddf25fe6d", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, "root": { "inputs": { "copyparty": "copyparty", "disko": "disko", + "emacs-overlay": "emacs-overlay", "home-manager": "home-manager", + "hyprland": "hyprland", + "hyprland-plugins": "hyprland-plugins", + "nix-ld": "nix-ld", "nixos-generators": "nixos-generators", "nixos-hardware": "nixos-hardware", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "sops-nix": "sops-nix", + "split-monitor-workspaces": "split-monitor-workspaces", + "stylix": "stylix", "unstable": "unstable", - "vscode-server": "vscode-server" + "unstable-home-manager": "unstable-home-manager", + "vscode-server": "vscode-server", + "zen-browser": "zen-browser" } }, "sops-nix": { @@ -223,7 +902,77 @@ "type": "github" } }, + "split-monitor-workspaces": { + "inputs": { + "hyprland": [ + "hyprland" + ], + "nix-filter": "nix-filter" + }, + "locked": { + "lastModified": 1753640179, + "narHash": "sha256-YUVgvLabR6zA4eVK7rxMCLYORm9whKBhCtiCWDwTE5U=", + "owner": "Duckonaut", + "repo": "split-monitor-workspaces", + "rev": "a19762220d0851fe7eccde37db3a254f0b0640cb", + "type": "github" + }, + "original": { + "owner": "Duckonaut", + "repo": "split-monitor-workspaces", + "type": "github" + } + }, + "stylix": { + "inputs": { + "base16": "base16", + "base16-fish": "base16-fish", + "base16-helix": "base16-helix", + "base16-vim": "base16-vim", + "firefox-gnome-theme": "firefox-gnome-theme", + "flake-parts": "flake-parts", + "gnome-shell": "gnome-shell", + "nixpkgs": [ + "unstable" + ], + "nur": "nur", + "systems": "systems_2", + "tinted-foot": "tinted-foot", + "tinted-kitty": "tinted-kitty", + "tinted-schemes": "tinted-schemes", + "tinted-tmux": "tinted-tmux", + "tinted-zed": "tinted-zed" + }, + "locked": { + "lastModified": 1753978157, + "narHash": "sha256-sVy8hb71VawSOIsLv/hMGzpvbbWszdP9aSKI5Drbt6Q=", + "owner": "nix-community", + "repo": "stylix", + "rev": "ded4f29a023e0f14506ec16b0e32d129e56341cc", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "stylix", + "type": "github" + } + }, "systems": { + "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_2": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -238,6 +987,102 @@ "type": "github" } }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "tinted-foot": { + "flake": false, + "locked": { + "lastModified": 1726913040, + "narHash": "sha256-+eDZPkw7efMNUf3/Pv0EmsidqdwNJ1TaOum6k7lngDQ=", + "owner": "tinted-theming", + "repo": "tinted-foot", + "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-foot", + "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", + "type": "github" + } + }, + "tinted-kitty": { + "flake": false, + "locked": { + "lastModified": 1735730497, + "narHash": "sha256-4KtB+FiUzIeK/4aHCKce3V9HwRvYaxX+F1edUrfgzb8=", + "owner": "tinted-theming", + "repo": "tinted-kitty", + "rev": "de6f888497f2c6b2279361bfc790f164bfd0f3fa", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-kitty", + "type": "github" + } + }, + "tinted-schemes": { + "flake": false, + "locked": { + "lastModified": 1750770351, + "narHash": "sha256-LI+BnRoFNRa2ffbe3dcuIRYAUcGklBx0+EcFxlHj0SY=", + "owner": "tinted-theming", + "repo": "schemes", + "rev": "5a775c6ffd6e6125947b393872cde95867d85a2a", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "schemes", + "type": "github" + } + }, + "tinted-tmux": { + "flake": false, + "locked": { + "lastModified": 1751159871, + "narHash": "sha256-UOHBN1fgHIEzvPmdNMHaDvdRMgLmEJh2hNmDrp3d3LE=", + "owner": "tinted-theming", + "repo": "tinted-tmux", + "rev": "bded5e24407cec9d01bd47a317d15b9223a1546c", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-tmux", + "type": "github" + } + }, + "tinted-zed": { + "flake": false, + "locked": { + "lastModified": 1751158968, + "narHash": "sha256-ksOyv7D3SRRtebpXxgpG4TK8gZSKFc4TIZpR+C98jX8=", + "owner": "tinted-theming", + "repo": "base16-zed", + "rev": "86a470d94204f7652b906ab0d378e4231a5b3384", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-zed", + "type": "github" + } + }, "unstable": { "locked": { "lastModified": 1753694789, @@ -254,10 +1099,31 @@ "type": "github" } }, + "unstable-home-manager": { + "inputs": { + "nixpkgs": [ + "unstable" + ] + }, + "locked": { + "lastModified": 1753983724, + "narHash": "sha256-2vlAOJv4lBrE+P1uOGhZ1symyjXTRdn/mz0tZ6faQcg=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "7035020a507ed616e2b20c61491ae3eaa8e5462c", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "master", + "repo": "home-manager", + "type": "github" + } + }, "vscode-server": { "inputs": { "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_4" }, "locked": { "lastModified": 1753541826, @@ -272,6 +1138,66 @@ "repo": "nixos-vscode-server", "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": 1751300244, + "narHash": "sha256-PFuv1TZVYvQhha0ac53E3YgdtmLShrN0t4T6xqHl0jE=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "6115f3fdcb2c1a57b4a80a69f3c797e47607b90a", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" + } + }, + "zen-browser": { + "inputs": { + "home-manager": "home-manager_2", + "nixpkgs": "nixpkgs_5" + }, + "locked": { + "lastModified": 1753933355, + "narHash": "sha256-4QxMcKS6oc+cG8efwwAin4M+YOokBak1dVS8u5P3b5M=", + "owner": "0xc000022070", + "repo": "zen-browser-flake", + "rev": "fa795a139a8c92b140bc21f11f61da1c97ad5b1d", + "type": "github" + }, + "original": { + "owner": "0xc000022070", + "repo": "zen-browser-flake", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 37bee85..0d4c675 100644 --- a/flake.nix +++ b/flake.nix @@ -18,14 +18,53 @@ url = "github:nix-community/home-manager/release-25.05"; inputs.nixpkgs.follows = "nixpkgs"; }; + unstable-home-manager = { + url = "github:nix-community/home-manager/master"; + inputs.nixpkgs.follows = "unstable"; + }; + + sops-nix = { url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; + + ### + # Applications and other + ### copyparty.url = "github:9001/copyparty"; vscode-server.url = "github:nix-community/nixos-vscode-server"; + + emacs-overlay.url = "github:nix-community/emacs-overlay/master"; + + stylix = { + url = "github:nix-community/stylix"; + inputs.nixpkgs.follows = "unstable"; + }; + + nix-ld = { + url = "github:Mic92/nix-ld"; + inputs.nixpkgs.follows = "unstable"; + }; + + hyprland = { + url = "git+https://github.com/hyprwm/Hyprland"; + inputs.nixpkgs.follows = "unstable"; + }; + + hyprland-plugins = { + url = "github:hyprwm/hyprland-plugins"; + inputs.hyprland.follows = "hyprland"; + }; + + split-monitor-workspaces = { + url = "github:Duckonaut/split-monitor-workspaces"; + inputs.hyprland.follows = "hyprland"; + }; + + zen-browser.url = "github:0xc000022070/zen-browser-flake"; }; outputs = { @@ -43,9 +82,41 @@ ./hm-modules ]; - upkgs = import inputs.unstable { system = "x86_64-linux"; config.allowUnfree = true; }; + upkgs = import inputs.unstable { + system = "x86_64-linux"; + config.allowUnfree = true; + }; + pkgs = import inputs.nixpkgs { + system = "x86_64-linux"; + config.allowUnfree = true; + }; + + mkComputer = configurationNix: extraModules: username: inputs.nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs pkgs nixos-hardware extraHomeModules username; }; + + modules = [ + disko.nixosModules.disko + home-manager.nixosModules.home-manager + + configurationNix + ] ++ extraModules; + }; + + mkUnstableComputer = configurationNix: extraModules: username: inputs.unstable.lib.nixosSystem { + specialArgs = { inherit inputs upkgs nixos-hardware extraHomeModules username; }; + + modules = [ + disko.nixosModules.disko + inputs.unstable-home-manager.nixosModules.home-manager + + configurationNix + ] ++ extraModules; + }; in { nixosConfigurations = { + ### + # Proxmox Homelab Machine + ### susano-minimal = nixpkgs.lib.nixosSystem { specialArgs = {inherit inputs outputs extraHomeModules; }; modules = [ @@ -61,13 +132,19 @@ disko.nixosModules.disko home-manager.nixosModules.home-manager sops-nix.nixosModules.sops + + # Applications inputs.copyparty.nixosModules.default + inputs.vscode-server.nixosModules.default ./machines/susano ./modules ]; }; + ### + # Proxmox Remote Dev Machine + ### izanagi-minimal = let username = "izanagi"; @@ -97,6 +174,32 @@ ./modules ]; }; + + ### + # Omen Laptop + ### + fujin-minimal = mkUnstableComputer + ./machines/fujin/minimal + [ + nixos-hardware.nixosModules.omen-15-en0002np + ] # Extra modules + "fujin"; + + fujin = mkUnstableComputer + ./machines/fujin/main + [ + nixos-hardware.nixosModules.omen-15-en0002np + sops-nix.nixosModules.sops + + # Applications + inputs.copyparty.nixosModules.default + inputs.vscode-server.nixosModules.default + inputs.stylix.nixosModules.stylix + inputs.nix-ld.nixosModules.nix-ld + + ./modules + ] # Extra modules + "fujin"; }; packages.x86_64-linux = { diff --git a/hm-modules/bar/default.nix b/hm-modules/bar/default.nix new file mode 100644 index 0000000..7374c30 --- /dev/null +++ b/hm-modules/bar/default.nix @@ -0,0 +1,7 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + ./waybar + ]; +} diff --git a/hm-modules/bar/waybar/default.nix b/hm-modules/bar/waybar/default.nix new file mode 100644 index 0000000..2e17161 --- /dev/null +++ b/hm-modules/bar/waybar/default.nix @@ -0,0 +1,299 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.dov.bar.waybar; + color = config.lib.stylix.colors; + backgound-color = color.base01; + icon-color = color.base0A; +in { + options.dov.bar.waybar.enable = mkEnableOption "waybar option"; + + config = mkIf cfg.enable { + home.packages = with pkgs; [ + wlogout + ]; + + programs.waybar = { + enable = true; + settings = { + mainBar = { + include = [ "~/.config/waybar/config.json" ]; + + layer = "top"; + position = "top"; + margin-top = 5; + margin-bottom = 5; + margin-left = 5; + margin-right = 5; + height = 15; + + modules-left = [ + # "custom/launcher" + "hyprland/workspaces" + "custom/media" + "hyprland/window" + ]; + + modules-center = [ + "clock" + ]; + + modules-right = [ + "tray" + "idle_inhibitor" + "hyprland/language" + "memory" + "cpu" + "backlight#value" + "pulseaudio" + "pulseaudio#microphone" + "network" + "battery" + "custom/power" + ]; + + "clock" = { + format = "{:%H:%M, %d, %B, %Y}  "; + format-alt = "{%R, :%A, %d %B, %Y}  "; + tooltip-format = "{calendar}"; + calendar = { + mode = "year"; + mode-mon-col = 3; + weeks-pos = "right"; + on-scroll = 1; + on-click-right = "mode"; + format = { + months = "{}"; + days = "{}"; + weeks = "W{}"; + weekdays = "{}"; + today = "{}"; + }; + }; + actions = { + on-click-right = "mode"; + on-click-forward = "tz_up"; + on-click-backward = "tz_down"; + on-scroll-up = "shift_up"; + on-scroll-down = "shift_down"; + }; + }; + }; + }; + + style = lib.mkForce '' + @keyframes blink-warning { + 70% { + color: white; + } + + to { + color: white; + background-color: orange; + } + } + + @keyframes blink-critical { + 70% { + color: white; + } + + to { + color: white; + background-color: red; + } + } + + + /* Reset all styles */ + * { + border: none; + border-radius: 0; + min-height: 0; + margin: 1px; + padding: 0; + color: #${icon-color}; + } + + + /* The whole bar */ + window#waybar { + background-color: rgba(0,0,0,0); + font-family: Intel One Mono Nerd Font; + font-size: 14px; + } + + /* Every modules */ + #battery, + #clock, + #backlight, + #cpu, + #custom-keyboard-layout, + #memory, + #mode, + #custom-weather, + #network, + #pulseaudio, + #temperature, + #tray, + #idle_inhibitor, + #window, + #workspaces, + #custom-media, + #language, + #custom-power, + #custom-PBPbattery { + padding:0.25rem 0.75rem; + margin: 1px 6px; + background-color: #${backgound-color}; + border-radius: 20px; + } + + #clock { + color: #${icon-color}; + } + + #custom-weather { + color: #ff4499; + } + + #battery { + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; + } + + #battery.warning { + color: orange; + } + + #battery.critical { + color: red; + } + + #battery.warning.discharging { + animation-name: blink-warning; + animation-duration: 3s; + } + + #battery.critical.discharging { + animation-name: blink-critical; + animation-duration: 2s; + } + + #cpu { + color: #${icon-color}; + } + + #cpu.warning { + color: orange; + } + + #cpu.critical { + color: red; + } + + #memory { + animation-timing-function: linear; + animation-iteration-count: infinite; + animation-direction: alternate; + color: #${icon-color}; + } + + #memory.warning { + color: orange; + } + + #memory.critical { + color: red; + animation-name: blink-critical; + animation-duration: 2s; + padding-left:5px; + padding-right:5px; + } + + #mode { + border-bottom: 3px transparent; + color:#ff4499; + margin-left: 5px; + padding: 7px; + } + + #network.disconnected { + color: orange; + } + + #pulseaudio { + color: #${icon-color}; + border-left: 0px; + border-right: 0px; + margin-right: 0; + border-radius: 20px 0 0 20px; + } + + #pulseaudio.microphone { + border-left: 0px; + border-right: 0px; + margin-left: 0; + padding-left: 0; + border-radius: 0 20px 20px 0; + } + + #temperature.critical { + color: red; + } + + #window { + font-weight: bold; + color: #${icon-color}; + } + + #custom-media { + color: #bb9af7; + } + + #workspaces { + font-size:16px; + background-color: #${backgound-color}; + border-radius: 20px; + } + + #workspaces button { + border-bottom: 3px solid transparent; + margin-bottom: 0px; + color: #dfdfdf; + } + + #workspaces button.active { + border-bottom: 1px solid #${color.base0B}; + margin-bottom: 1px; + padding-left:0; + } + + #workspaces button.urgent { + border-color: #c9545d; + color: #c9545d; + } + + #custom-power { + font-size:18px; + padding-right: 1rem; + } + + #custom-launcher { + font-size:15px; + margin-left:15px; + margin-right:10px; + } + + #backlight.icon { + padding-right:1px; + font-size: 13px; + } + ''; + }; + home.file.".config/waybar/config.json".source = ./waybar4.json; + }; +} diff --git a/hm-modules/bar/waybar/waybar4.json b/hm-modules/bar/waybar/waybar4.json new file mode 100644 index 0000000..419c88a --- /dev/null +++ b/hm-modules/bar/waybar/waybar4.json @@ -0,0 +1,203 @@ +// Global +{ + // Modules + "battery": { + "states": { + "warning": 30, + "critical": 15 + }, + "format": "{capacity}% {icon} ", + "format-charging": "{capacity}% ", + "format-plugged": "{capacity}% ", + "format-icons": ["", "", "", "", ""] + }, + + "custom/PBPbattery": { + "exec": "~/.config/waybar/scripts/PBPbattery.sh", + "format": "{}", + }, + + "cpu": { + "interval": 5, + "format": " {usage}% ({load})", // Icon: microchip + "states": { + "warning": 70, + "critical": 90, + }, + "on-click": "kitty -e 'btm'", + }, + + "hyprland/language": { + "format": " {}", + "format-en": "us", + "format-ru": "ru", + "format-ua": "ua", + "keyboard-name": "at-translated-set-2-keyboard" + }, + + "custom/keyboard-layout": { + "exec": "swaymsg -t get_inputs | grep -m1 'xkb_active_layout_name' | cut -d '\"' -f4", + // Interval set only as a fallback, as the value is updated by signal + "interval": 30, + "format": " {}", // Icon: keyboard + // Signal sent by Sway key binding (~/.config/sway/key-bindings) + "signal": 1, // SIGHUP + "tooltip": false, + "on-click": "~/.config/waybar/scripts/keyhint.sh", + }, + + "memory": { + "interval": 5, + "format": " {}%", // Icon: memory + "on-click": "kitty -e 'btm'", + "states": { + "warning": 70, + "critical": 90 + } + }, + + "network": { + "interval": 5, + "format-wifi": " ", // Icon: wifi + "format-ethernet": " ", // Icon: ethernet + "format-disconnected": "⚠ Disconnected", + "tooltip-format": "{ifname}: {ipaddr}", + "on-click": "kitty -e 'nmtui'", + }, + "network#vpn": { + "interface": "tun0", + "format": " ", + "format-disconnected": "⚠ Disconnected", + "tooltip-format": "{ifname}: {ipaddr}/{cidr}", + }, + + "hyprland/mode": { + "format": "{}", + "tooltip": false + }, + + "hyprland/window": { + "format": "{}", + "max-length": 120 + }, + + "hyprland/workspaces": { + "disable-scroll": true, + "disable-markup" : false, + "all-outputs": true, + "format": " {icon} ", + //"format":"{icon}", + "format-icons": { + "1": "", + "2": "", + "3": "" + } + }, + + "pulseaudio": { + "scroll-step": 1, // %, can be a float + "format": "{icon} {volume}%", + "format-bluetooth": "{volume}% {icon}  {format_source}", + "format-bluetooth-muted": " {icon}  {format_source}", + "format-muted": "", + "format-icons": { + "headphone": "", + "hands-free": "וֹ", + "headset": "  ", + "phone": "", + "portable": "", + "car": "", + "default": [""] + }, + "on-click": "amixer -q sset Master toggle", + "on-click-right": "pavucontrol", + "on-scroll-up": "amixer -q sset Master 10%-", + "on-scroll-down": "amixer -q sset Master 10%+", + }, + + "pulseaudio#microphone": { + "format": "{format_source}", + "format-source": " {volume}%", + "format-source-muted": " ", + "on-click": "pamixer --default-source -t", + "on-click-right": "pavucontrol", + "on-scroll-up": "pamixer --default-source -i 5", + "on-scroll-down": "pamixer --default-source -d 5", + "scroll-step": 5 + }, + + // to use the weather module replace with your city or town + // note: do not use spaces: new york would be newyork + "custom/weather": { + "exec": "~/.config/waybar/scripts/weather.sh tampa", + "return-type": "json", + "interval": 600, + }, + + "tray": { + "icon-size": 18, + "spacing":10, + }, + + "backlight#icon": { + "format": "{icon}", + "format-icons": [""], + "on-scroll-down": "brightnessctl -c backlight set 1%-", + "on-scroll-up": "brightnessctl -c backlight set +1%" + }, + + "backlight#value" :{ + "format": "{percent}%", + "on-scroll-down": "brightnessctl -c backlight set 1%-", + "on-scroll-up": "brightnessctl -c backlight set +1%" + }, + + "custom/firefox": { + "format": " ", + "on-click": "exec firefox", + "tooltip": false + }, + + "custom/terminal": { + "format": " ", + "on-click": "exec kitty", + "tooltip": false + }, + + "custom/files": { + "format": " ", + "on-click": "exec nautilus", + "tooltip": false + }, + + "custom/launcher": { + "format":" ", + "on-click": "exec wofi -c ~/.config/wofi/config -I", + "tooltip": false, + }, + + "custom/media": { + "format": "{icon} {}", + "return-type": "json", + "max-length": 40, + "format-icons": { + "spotify": "", + "default": "󰗃" + }, + "escape": true, + "exec": "/usr/bin/python3 $HOME/.config/waybar/scripts/mediaplayer.py 2> /dev/null" // Script in resources folder + }, + + "custom/power": { + "format": "", + "on-click": "wlogout" + }, + + "idle_inhibitor": { + "format": "{icon}", + "format-icons": { + "activated": "", + "deactivated": "" + } + } +} diff --git a/hm-modules/browser/default.nix b/hm-modules/browser/default.nix new file mode 100644 index 0000000..8dc659b --- /dev/null +++ b/hm-modules/browser/default.nix @@ -0,0 +1,7 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + ./zen + ]; +} diff --git a/hm-modules/browser/zen/default.nix b/hm-modules/browser/zen/default.nix new file mode 100644 index 0000000..6e63281 --- /dev/null +++ b/hm-modules/browser/zen/default.nix @@ -0,0 +1,15 @@ +{ inputs, config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.dov.browser.zen; +in { + options.dov.browser.zen.enable = mkEnableOption "zen config"; + + config = mkIf cfg.enable { + home.packages = with pkgs; [ + inputs.zen-browser.packages."${system}".default + ]; + }; +} diff --git a/hm-modules/default.nix b/hm-modules/default.nix index 3454290..a795434 100644 --- a/hm-modules/default.nix +++ b/hm-modules/default.nix @@ -3,5 +3,11 @@ { imports = [ ./shell + ./window-manager + ./bar + ./launcher + ./random + ./browser + ./terminal ]; } diff --git a/hm-modules/launcher/default.nix b/hm-modules/launcher/default.nix new file mode 100644 index 0000000..2abb015 --- /dev/null +++ b/hm-modules/launcher/default.nix @@ -0,0 +1,7 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + ./wofi + ]; +} diff --git a/hm-modules/launcher/wofi/default.nix b/hm-modules/launcher/wofi/default.nix new file mode 100644 index 0000000..150c8bb --- /dev/null +++ b/hm-modules/launcher/wofi/default.nix @@ -0,0 +1,15 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let cfg = config.dov.launcher.wofi; +in { + options.dov.launcher.wofi.enable = mkEnableOption "wofi configuration"; + + config = mkIf cfg.enable { + + home.packages = [ pkgs.wofi ]; + + }; + +} diff --git a/hm-modules/random/default.nix b/hm-modules/random/default.nix new file mode 100644 index 0000000..9ca429c --- /dev/null +++ b/hm-modules/random/default.nix @@ -0,0 +1,7 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + ./kanshi + ]; +} diff --git a/hm-modules/random/kanshi/config b/hm-modules/random/kanshi/config new file mode 100644 index 0000000..a966eda --- /dev/null +++ b/hm-modules/random/kanshi/config @@ -0,0 +1,8 @@ +profile LAPTOP_ONLY { + output eDP-1 enable +} + +profile HOME { + output eDP-1 mode 2560x1440 position 480,1440 + output DP-3 mode 3440x1440 position 0,0 +} diff --git a/hm-modules/random/kanshi/default.nix b/hm-modules/random/kanshi/default.nix new file mode 100644 index 0000000..293c031 --- /dev/null +++ b/hm-modules/random/kanshi/default.nix @@ -0,0 +1,61 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.dov.kanshi; +in { + options.dov.kanshi.enable = mkEnableOption "kanshi config"; + + config = mkIf cfg.enable { + home.packages = with pkgs; [ kanshi ]; + + services.kanshi = { + enable = true; + settings = [ + { + profile = { + name = "default"; + outputs = [ + { + criteria = "eDP-1"; + } + ]; + }; + } + { + profile = { + name = "home"; + outputs = [ + { + criteria = "eDP-1"; + position = "480,1440"; + } + { + criteria = "LG Electronics LG ULTRAWIDE 201NTTQC5617"; + position = "0,0"; + mode = "3440x1440"; + } + ]; + }; + } + { + profile = { + name = "reserve-home"; + outputs = [ + { + criteria = "eDP-1"; + position = "480,1440"; + } + { + criteria = "DP-5"; + position = "0,0"; + mode = "3440x1440"; + } + ]; + }; + } + ]; + }; + }; +} diff --git a/hm-modules/shell/addition/default.nix b/hm-modules/shell/addition/default.nix new file mode 100644 index 0000000..6a9b1cf --- /dev/null +++ b/hm-modules/shell/addition/default.nix @@ -0,0 +1,7 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + ./starship + ]; +} diff --git a/hm-modules/shell/addition/starship/default.nix b/hm-modules/shell/addition/starship/default.nix new file mode 100644 index 0000000..efe70db --- /dev/null +++ b/hm-modules/shell/addition/starship/default.nix @@ -0,0 +1,33 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let cfg = config.dov.shell.addition.starship; +in { + options.dov.shell.addition.starship.enable = mkEnableOption "starship configuration"; + + config = mkIf cfg.enable { + programs.starship = { + enable = true; + enableZshIntegration = config.dov.shell.zsh.enable; + # TODO for now no bash - no integration + #enableBashIntegration = config.dov.shell.bash.enable; + + settings = { + nix_shell = { + disabled = false; + impure_msg = ""; + symbol = ""; + format = "[$symbol$state]($style) "; + }; + shlvl = { + disabled = false; + symbol = "λ "; + }; + haskell.symbol = " "; + openstack.disabled = true; + gcloud.disabled = true; + }; + }; + }; +} diff --git a/hm-modules/shell/default.nix b/hm-modules/shell/default.nix index 902e7f8..3896065 100644 --- a/hm-modules/shell/default.nix +++ b/hm-modules/shell/default.nix @@ -3,5 +3,6 @@ { imports = [ ./zsh + ./addition ]; } diff --git a/hm-modules/terminal/alacritty/default.nix b/hm-modules/terminal/alacritty/default.nix new file mode 100644 index 0000000..4b10df4 --- /dev/null +++ b/hm-modules/terminal/alacritty/default.nix @@ -0,0 +1,17 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.dov.terminal.alacritty; +in { + options.dov.terminal.alacritty.enable = mkEnableOption "alacritty configuration"; + + config = mkIf cfg.enable { + programs = { + alacritty = { + enable = true; + }; + }; + }; +} diff --git a/hm-modules/terminal/default.nix b/hm-modules/terminal/default.nix new file mode 100644 index 0000000..3093493 --- /dev/null +++ b/hm-modules/terminal/default.nix @@ -0,0 +1,7 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + ./alacritty + ]; +} diff --git a/hm-modules/window-manager/default.nix b/hm-modules/window-manager/default.nix new file mode 100644 index 0000000..3149a99 --- /dev/null +++ b/hm-modules/window-manager/default.nix @@ -0,0 +1,7 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + ./hypr + ]; +} diff --git a/hm-modules/window-manager/hypr/default.nix b/hm-modules/window-manager/hypr/default.nix new file mode 100644 index 0000000..36b2ca7 --- /dev/null +++ b/hm-modules/window-manager/hypr/default.nix @@ -0,0 +1,249 @@ +{ config, lib, pkgs, inputs, ... }: + +with lib; + +let + colors = config.lib.stylix.colors; + cfg = config.dov.window-manager.hypr; +in { + options.dov.window-manager.hypr.enable = mkEnableOption "hypr configuration"; + config = mkIf cfg.enable { + home.packages = with pkgs; [ + swww + mako + pipewire + wireplumber + libnotify + kitty + jq # used in lock to get language + wayland-protocols + + #hyprland extensions + hyprlock + hypridle + ]; + + wayland.windowManager.hyprland = { + enable = true; + xwayland.enable = true; + package = inputs.hyprland.packages.${pkgs.system}.hyprland; + plugins = [ + inputs.split-monitor-workspaces.packages.${pkgs.system}.split-monitor-workspaces + ]; + + settings = { + monitor = ",highres,auto,1"; + source = "~/.config/hypr/colors"; + + env = [ + "LIBVA_DRIVER_NAME,nvidia" + "XDG_SESSION_TYPE,wayland" + "WLR_NO_HARDWARE_CURSORS,1" + ]; + + #Autostart + exec = [ + # Fix slow startup + "systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" + "dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" + ]; + + exec-once = [ + "mako" + "polkit-kde-agent" + "emacs --fg-daemon" + "hypridle" + "kanshi" + "virsh net-start default" + #"thunderbird" + #"element-desktop" + "keepassxc" + "dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" + ] ++ lib.optionals config.dov.bar.waybar.enable [ "waybar" ]; + + "$mainMod" = "SUPER"; + + bind = [ + "$mainMod, G, fullscreen," + "$mainMod, t, togglegroup" + "$mainMod, v, togglefloating" + "$mainMod, s, togglesplit" + + #bind = $mainMod, RETURN, exec, kitty + "$mainMod, RETURN, exec, alacritty" + "$mainMod, o, exec, emacsclient -c" + "SUPER_SHIFT, RETURN, exec, thunar" + "SUPER_SHIFT, l, exec, hyprctl switchxkblayout at-translated-set-2-keyboard 0 && hyprlock" + + #bind = $mainMod, M, exit, + "SUPER_SHIFT, q, killactive," + + # Switch Keyboard Layouts + "$mainMod, SPACE, exec, hyprctl switchxkblayout teclado-gamer-husky-blizzard next" + + ", Print, exec, grim -g \"$(slurp)\" - | wl-copy" + "SHIFT, Print, exec, IMG=~/Pictures/$(date +%Y-%m-%d_%H-%m-%s).png && grim -g \"$(slurp)\" $IMG" + + # Functional keybinds + ",XF86AudioMicMute,exec,pamixer --default-source -t" + ",XF86MonBrightnessDown,exec,brightnessctl s 20-" + ",XF86MonBrightnessUp,exec,brightnessctl s 20+" + ",XF86AudioMute,exec,amixer -q sset Master toggle" + ",XF86AudioLowerVolume,exec,amixer -q sset Master 5%-" + ",XF86AudioRaiseVolume,exec,amixer -q sset Master 5%+" + ",XF86AudioPlay,exec,playerctl play-pause" + ",XF86AudioPause,exec,playerctl play-pause" + + # to switch between windows in a floating workspace + "SUPER,Tab,changegroupactive, f" + "SUPER_SHIFT,Tab,changegroupactive, b" + + # Move focus with mainMod + arrow keys + "$mainMod, h, movefocus, l" + "$mainMod, l, movefocus, r" + "$mainMod, k, movefocus, u" + "$mainMod, j, movefocus, d" + + # Switch workspaces with mainMod + [0-9] + "$mainMod, 1, split-workspace, 1" + "$mainMod, 2, split-workspace, 2" + "$mainMod, 3, split-workspace, 3" + "$mainMod, 4, split-workspace, 4" + "$mainMod, 5, split-workspace, 5" + "$mainMod, 6, split-workspace, 6" + "$mainMod, 7, split-workspace, 7" + "$mainMod, 8, split-workspace, 8" + "$mainMod, 9, split-workspace, 9" + "$mainMod, 0, split-workspace, 10" + + # Move active window to a workspace with mainMod + SHIFT + [0-9] + "$mainMod SHIFT, 1, split-movetoworkspace, 1" + "$mainMod SHIFT, 2, split-movetoworkspace, 2" + "$mainMod SHIFT, 3, split-movetoworkspace, 3" + "$mainMod SHIFT, 4, split-movetoworkspace, 4" + "$mainMod SHIFT, 5, split-movetoworkspace, 5" + "$mainMod SHIFT, 6, split-movetoworkspace, 6" + "$mainMod SHIFT, 7, split-movetoworkspace, 7" + "$mainMod SHIFT, 8, split-movetoworkspace, 8" + "$mainMod SHIFT, 9, split-movetoworkspace, 9" + "$mainMod SHIFT, 0, split-movetoworkspace, 10" + + # Scroll through existing workspaces with mainMod + scroll + "$mainMod, mouse_down, split-workspace, e+1" + "$mainMod, mouse_up, split-workspace, e-1" + "$mainMod,SPACE, exec, hyprctl switchxkblayout at-translated-set-2-keyboard next" + ] ++ lib.optionals config.dov.launcher.wofi.enable [ + "$mainMod, p, exec, wofi --show drun" + ]; + + bindm = [ + "$mainMod, mouse:272, movewindow" + "$mainMod, mouse:273, resizewindow" + "ALT, mouse:272, resizewindow" + ]; + + input = { + kb_layout = "us,ru,ua"; + kb_options = "grp:win_space_toggle"; + + follow_mouse = 1; + + touchpad = { + natural_scroll = false; + }; + + sensitivity = 0; + }; + + general = { + gaps_in = 5; + gaps_out = 20; + border_size = 2; + "col.active_border" = lib.mkForce "rgba(33ccffee) rgba(00ff99ee) 45deg"; + "col.inactive_border" = lib.mkForce "rgba(595959aa)"; + + layout = "dwindle"; + }; + + decoration = { + rounding = 10; + + shadow = { + enabled = true; + range = 4; + render_power = 3; + }; + }; + + animations = { + enabled = "yes"; + + bezier = "ease,0.4,0.02,0.21,1"; + + animation = [ + "windows, 1, 3.5, ease, slide" + "windowsOut, 1, 3.5, ease, slide" + "border, 1, 6, default" + "fade, 1, 3, ease" + "workspaces, 1, 3.5, ease" + ]; + }; + + dwindle = { + pseudotile = "yes"; + preserve_split = "yes"; + }; + + master = { + new_status = "master"; + }; + + gestures = { + workspace_swipe = false; + }; + + workspace = [ + #"0, monitor:DP-1" + "8, monitor:e-DP-1" + "9, monitor:e-DP-1" + #"9, on-created-empty:[tiled] thunderbird" + ]; + + windowrulev2 = [ + "workspace 9, class:^(.*thunderbird.*)$" + "group, class:^(.*thunderbird.*)$" + "workspace 9, class:^(.*Element.*)$" + "group, class:^(.*Element.*)$" + "workspace 8, title:^(.*KeePassXC.*)$" + "float, class:^(.*steam.*)$" + "noinitialfocus,class:(jetbrains-)(.*),title:^win(.*), initialTitle:win.*, floating:1" + ]; + }; + }; + + home.file.".config/hypr/colors".text = '' + $background = ${colors.base00} + $foreground = ${colors.base05} + + $color0 = ${colors.base00} + $color1 = ${colors.base01} + $color2 = ${colors.base02} + $color3 = ${colors.base03} + $color4 = ${colors.base04} + $color5 = ${colors.base05} + $color6 = ${colors.base06} + $color7 = ${colors.base07} + $color8 = ${colors.base08} + $color9 = ${colors.base09} + $color10 = ${colors.base0A} + $color11 = ${colors.base0B} + $color12 = ${colors.base0C} + $color13 = ${colors.base0D} + $color14 = ${colors.base0E} + $color15 = ${colors.base0F} + ''; + + xdg.configFile."hypr/hyprlock.conf".source = ./hyprlock.conf; + xdg.configFile."hypr/hypridle.conf".source = ./hypridle.conf; + }; +} diff --git a/hm-modules/window-manager/hypr/hypridle.conf b/hm-modules/window-manager/hypr/hypridle.conf new file mode 100644 index 0000000..11ba2ad --- /dev/null +++ b/hm-modules/window-manager/hypr/hypridle.conf @@ -0,0 +1,28 @@ +general { + lock_cmd = pidof hyprlock || hyprlock # avoid starting multiple hyprlock instances. + #before_sleep_cmd = loginctl lock-session # lock before suspend. + #after_sleep_cmd = hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display. +} + +listener { + timeout = 150 # 2.5min. + on-timeout = brightnessctl -s set 10 # set monitor backlight to minimum, avoid 0 on OLED monitor. + on-resume = brightnessctl -r # monitor backlight restor. +} + +# change language to US before locking +listener { + timeout = 150 # 2.5min. + on-timeout = hyprctl switchxkblayout at-translated-set-2-keyboard 0 # switch to us layout +} + +listener { + timeout = 300 # 5min + on-timeout = loginctl lock-session # lock screen when timeout has passed +} + +# listener { +# timeout = 380 # 5.5min +# on-timeout = hyprctl dispatch dpms off # screen off when timeout has passed +# on-resume = hyprctl dispatch dpms on # screen on when activity is detected after timeout has fired. +# } diff --git a/hm-modules/window-manager/hypr/hyprlock.conf b/hm-modules/window-manager/hypr/hyprlock.conf new file mode 100644 index 0000000..b55d984 --- /dev/null +++ b/hm-modules/window-manager/hypr/hyprlock.conf @@ -0,0 +1,65 @@ +source = ~/.cache/wal/colors-hyprland.conf + +# BACKGROUND +background { + monitor = + path = screenshot + blur_passes = 3 + contrast = 0.8916 + brightness = 0.8172 + vibrancy = 0.1696 + vibrancy_darkness = 0.0 +} + +# GENERAL +general { + no_fade_in = false + grace = 0 + disable_loading_bar = true +} + +# INPUT FIELD +input-field { + monitor = + size = 250, 60 + outline_thickness = 2 + dots_size = 0.2 # Scale of input-field height, 0.2 - 0.8 + dots_spacing = 0.2 # Scale of dots' absolute size, 0.0 - 1.0 + dots_center = true + outer_color = rgba(0, 0, 0, 0) + inner_color = rgba(0, 0, 0, 0.5) + font_color = rgb(200, 200, 200) + fade_on_empty = false + font_family = JetBrains Mono Nerd Font Mono + placeholder_text = Input Password... + hide_input = false + position = 0, -120 + halign = center + valign = center +} + +# TIME +label { + monitor = + text = cmd[update:1000] echo "$(date +"%-I:%M%p")" + color = $foreground + #color = rgba(255, 255, 255, 0.6) + font_size = 120 + font_family = JetBrains Mono Nerd Font Mono ExtraBold + position = 0, -300 + halign = center + valign = top +} + +# USER +label { + monitor = + text = Hi there, $USER + color = $foreground + #color = rgba(255, 255, 255, 0.6) + font_size = 25 + font_family = JetBrains Mono Nerd Font Mono + position = 0, -40 + halign = center + valign = center +} diff --git a/machines/fujin/disko-config.nix b/machines/fujin/disko-config.nix new file mode 100644 index 0000000..800d4fb --- /dev/null +++ b/machines/fujin/disko-config.nix @@ -0,0 +1,57 @@ +{ config, lib, pkgs, username, ... }: + +{ + disko.devices = { + disk = { + main = { + device = "/dev/nvme1n1"; + type = "disk"; + content = { + type = "gpt"; + partitions = { + boot = { + size = "1M"; + type = "EF02"; # for grub MBR + }; + root = { + size = "100%"; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; # Override existing partition + # Subvolumes must set a mountpoint in order to be mounted, + # unless their parent is mounted + subvolumes = { + # Subvolume name is different from mountpoint + "/rootfs" = { + mountpoint = "/"; + }; + # Subvolume name is the same as the mountpoint + "/home" = { + mountOptions = [ "compress=zstd" ]; + mountpoint = "/home"; + }; + # Sub(sub)volume doesn't need a mountpoint as its parent is mounted + "/home/${username}" = { }; + "/nix" = { + mountOptions = [ + "compress=zstd" + "noatime" + ]; + mountpoint = "/nix"; + }; + }; + + mountpoint = "/partition-root"; + swap = { + swapfile = { + size = "32G"; + }; + }; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/machines/fujin/hardware-configuration.nix b/machines/fujin/hardware-configuration.nix new file mode 100644 index 0000000..7975732 --- /dev/null +++ b/machines/fujin/hardware-configuration.nix @@ -0,0 +1,30 @@ +{ config, lib, pkgs, modulesPath, ... }: + +{ + imports = [ (modulesPath + "/installer/scan/not-detected.nix") ]; + + boot = { + loader.grub = { + enable = true; + useOSProber = true; + }; + + initrd = { + availableKernelModules = + [ "nvme" "xhci_pci" "usb_storage" "sd_mod" "sdhci_pci" ]; + kernelModules = [ ]; + }; + kernelModules = [ "kvm-amd" ]; + + # allow perf as user | needed for intellij to run profiler + kernel.sysctl."kernel.perf_event_paranoid" = 1; + kernel.sysctl."kernel.kptr_restrict" = lib.mkForce 0; + }; + + networking.useDHCP = lib.mkDefault true; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + + hardware.nvidia.prime = { + amdgpuBusId = lib.mkForce "PCI:7:0:0"; + }; +} diff --git a/machines/fujin/main/.sops.yaml b/machines/fujin/main/.sops.yaml new file mode 100644 index 0000000..0adf323 --- /dev/null +++ b/machines/fujin/main/.sops.yaml @@ -0,0 +1,9 @@ +keys: + - &primary age19wvqtn4ju6k4vs8fxr34unl6xx4cv04jw0lx9ps20xlde927zfssgl4qke + - &omen age1jggd0cqn7c3ajqphnd0tt7kud3tqdz6uv3mkghhkzdtf4f0xrp2qtuvsks +creation_rules: + - path_regex: secrets/secrets.yaml$ + key_groups: + - age: + - *primary + - *omen diff --git a/machines/fujin/main/default.nix b/machines/fujin/main/default.nix new file mode 100644 index 0000000..5129e38 --- /dev/null +++ b/machines/fujin/main/default.nix @@ -0,0 +1,111 @@ +{ inputs, config, lib, pkgs, username, extraHomeModules, ... }: + +{ + imports = [ + ../../minimal.nix + ../hardware-configuration.nix + ../disko-config.nix + + ./sops.nix + ]; + + users.users.${username} = { + description = "NixOS Omen Laptop"; + hashedPassword = + "$6$5xuxfP8HapkkyDa5$qr2wkpibMaNSIiJIPojWC4CO1X31HNJZEfmYfReYrwOSoflf0rMrQk.EZj5uzh/K/NalQMnCiDcmvFBuf9a5p0"; + packages = with pkgs; [ + # thunar plugin to manager archives + xfce.thunar-archive-plugin + ]; + }; + + programs = { + nix-ld.dev.enable = true; + + light.enable = true; + + nm-applet.enable = true; + + gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + }; + + ### + # Thunar configurations + ### + programs.thunar.enable = true; + programs.xfconf.enable = true; # needed to save preferences + services.gvfs.enable = true; # Mount, trash, and other functionalities + services.tumbler.enable = true; # Thumbnail support for images + ### + ### + + dov = { + development.emacs.enable = true; + + virtualisation.docker.enable = true; + }; + + ### + # Home Manger configuration + ### + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + backupFileExtension = "backup"; + extraSpecialArgs = { inherit inputs username; }; + + users."${username}" = { imports = [ ./home.nix ] ++ extraHomeModules; }; + }; + + stylix = { + enable = true; + base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-hard.yaml"; + + fonts = { + serif = { + package = pkgs.dejavu_fonts; + name = "DejaVu Serif"; + }; + + sansSerif = { + package = pkgs.dejavu_fonts; + name = "DejaVu Sans"; + }; + + monospace = { + package = pkgs.dejavu_fonts; + name = "DejaVu Sans Mono"; + }; + + emoji = { + package = pkgs.noto-fonts-emoji; + name = "Noto Color Emoji"; + }; + }; + }; + + fonts.packages = with pkgs; + [ + noto-fonts + noto-fonts-cjk-sans + noto-fonts-emoji + liberation_ttf + fira-code + fira + fira-code-symbols + mplus-outline-fonts.githubRelease + dina-font + proggyfonts + emacs-all-the-icons-fonts + emacsPackages.all-the-icons + font-awesome_5 + source-code-pro + ] ++ builtins.filter lib.attrsets.isDerivation + (builtins.attrValues pkgs.nerd-fonts); + + # DO NOT CHANGE AT ANY POINT! + system.stateVersion = "25.11"; +} diff --git a/machines/fujin/main/home.nix b/machines/fujin/main/home.nix new file mode 100644 index 0000000..4efa87a --- /dev/null +++ b/machines/fujin/main/home.nix @@ -0,0 +1,116 @@ +{ config, lib, pkgs, username, ... }: + +{ + home = { + stateVersion = "25.11"; + username = username; + homeDirectory = "/home/${username}"; + }; + + dov = { + shell = { + zsh = { + enable = true; + shellAliases = { + ll = "eza -al"; + sc = "source $HOME/.zshrc"; + psax = "ps ax | grep"; + cp = "rsync -ah --progress"; + }; + }; + + addition.starship.enable = true; + }; + + browser.zen.enable = true; + + #window-manager.hypr.enable = true; + + bar.waybar.enable = true; + + launcher.wofi.enable = true; + + kanshi.enable = true; + + terminal.alacritty.enable = true; + }; + + programs = { + home-manager.enable = true; + + git = { + enable = true; + userName = "Alexander"; + userEmail = "alexander0derevianko@gmail.com"; + + extraConfig = { + safe = { + directory = ["/home/${username}/nixos-dotfiles" "/home/${username}/.cache/nix"]; + }; + }; + }; + }; + + home.packages = with pkgs; [ + eza + + # if you enable gtk theames + # this is needed to fix "error: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name ca.desrt.dconf was not provided by any .service files" + dconf + + # Video player + vlc + + # social + telegram-desktop + thunderbird-latest + element-desktop + #teams-for-linux + #webcord + discord + + # development + jetbrains.idea-ultimate + jetbrains.webstorm + #jetbrains.pycharm-community-src + direnv + semgrep + devpod + tmux + bottles + + #torrent + qbittorrent + + #kdePackages.kate + kdePackages.ark + keepassxc + #virt-manager + #vial #keyboard configurator + #qmk + + #libreoffice + grim + slurp + wl-clipboard + #cloudflared + kdePackages.okular #pdf tool + #nextcloud-client + + #music + #mpd + #mpv + #mpc-cli + ]; + + stylix = { + enable = true; + autoEnable = true; + targets = { + kde.enable = false; + }; + }; + + # blutooth applet + services.blueman-applet.enable = true; +} diff --git a/machines/fujin/main/secrets/secrets.yaml b/machines/fujin/main/secrets/secrets.yaml new file mode 100644 index 0000000..d1ff9cb --- /dev/null +++ b/machines/fujin/main/secrets/secrets.yaml @@ -0,0 +1,30 @@ +omen-password: ENC[AES256_GCM,data:91HK7H+HRX7LMGaIt5dCzrjAlpLj1tx0p9uhvq5P/LBpuaHmRk1n2nb63wdqkOlkZY15Fe+VE4YF8tbX6XelfeFX9xd347/96A==,iv:j5QmvKK5BQxnwO2Z2cCd+skxK4dH7qIHOH7sX0q4VYs=,tag:RyTMZNMfCAmgfki9xYv61w==,type:str] +sops: + kms: [] + gcp_kms: [] + azure_kv: [] + hc_vault: [] + age: + - recipient: age19wvqtn4ju6k4vs8fxr34unl6xx4cv04jw0lx9ps20xlde927zfssgl4qke + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB0LzBjYnZBbWZicGN1YlFK + bjR0aHkvL3N0RXpLcXFXbVpNY1ovV2xBU1FJCkFBZ1JVbk9ROEw5a2pIVVdabmla + REtLRUlHSjFUVVFET3orMkhaKzQ4YVEKLS0tIERXaTJzRWMyUWcwb3NUREszbG5j + R2dBRU1oY1RVQnQzSFREWW8rbmszU0EKliqft7wFfJT95O4akHvLx/dLGVVLkqlG + y0ClO2nT3FiA8Ajyrdz87pPsBiRNyIlNeER/FhY2IMMKcBP3fE/6dA== + -----END AGE ENCRYPTED FILE----- + - recipient: age1jggd0cqn7c3ajqphnd0tt7kud3tqdz6uv3mkghhkzdtf4f0xrp2qtuvsks + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBjQy9GRURacHhOM0h1bmFF + TXoyWGdabEYxYjFHaWdTRE9TWmtjdHZDZkNjCmtQZ29xenRJWGhUWmxtVTdZVGY1 + VXFYbjZEVFlxQjRueHE2QytobkU0TGMKLS0tIGNxcHplS3k5WjMzdGI0YzljQ0FL + U0hyYmh6WVRoZU9BbXFCc3NCdXQ0VXMKnlqD0FWix3qBQN5VpIaY0EG9VELS25qI + yzygv1MENSA+FMQnRhNfk/lokvLaIJVQqZATxUBZF0aPmzCDisV7RQ== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2025-01-03T18:26:59Z" + mac: ENC[AES256_GCM,data:o/FchUUVE+iNrlirwcHBDspkxEAd/Udy15Fkj5aF8en1CfQfLzl94JTjPDbvzRIRxb6ToBMje1KMUew1rYP76o3MJfI76UfgsrJFdaBLL1ukxYOk7ZssFb/uas56QR+wabOO3QdNPqPVhqWMTE17+JqFLxuANJes8S2MvUfD6gY=,iv:82vLA5ywDQqN269Xm9RH8rblXU0qeA2cI+NmXlRXa2I=,tag:NsJGmnwkjLd4ztZT1TzC9g==,type:str] + pgp: [] + unencrypted_suffix: _unencrypted + version: 3.9.1 diff --git a/machines/fujin/main/sops.nix b/machines/fujin/main/sops.nix new file mode 100644 index 0000000..8f3e436 --- /dev/null +++ b/machines/fujin/main/sops.nix @@ -0,0 +1,12 @@ +{ config, lib, pkgs, inputs, ... }: + +{ + sops = { + defaultSopsFile = ./secrets/secrets.yaml; + age = { + sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; + keyFile = "/var/lib/sops-nix/keys.txt"; + generateKey = true; + }; + }; +} diff --git a/machines/fujin/minimal/default.nix b/machines/fujin/minimal/default.nix new file mode 100644 index 0000000..bb0153e --- /dev/null +++ b/machines/fujin/minimal/default.nix @@ -0,0 +1,32 @@ +{ inputs, config, lib, pkgs, username, extraHomeModules, ... }: + +{ + imports = [ + ../../minimal.nix + ../hardware-configuration.nix + ../disko-config.nix + + ]; + + users.users.${username} = { + description = "NixOS Omen Laptop"; + hashedPassword = + "$6$5xuxfP8HapkkyDa5$qr2wkpibMaNSIiJIPojWC4CO1X31HNJZEfmYfReYrwOSoflf0rMrQk.EZj5uzh/K/NalQMnCiDcmvFBuf9a5p0"; + packages = with pkgs; [ ]; + }; + + ### + # Home Manger configuration + ### + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + backupFileExtension = "backup"; + extraSpecialArgs = { inherit inputs username; }; + + users."${username}" = { imports = [ ./home.nix ] ++ extraHomeModules; }; + }; + + # DO NOT CHANGE AT ANY POINT! + system.stateVersion = "25.11"; +} diff --git a/machines/fujin/minimal/home.nix b/machines/fujin/minimal/home.nix new file mode 100644 index 0000000..69f0acb --- /dev/null +++ b/machines/fujin/minimal/home.nix @@ -0,0 +1,29 @@ +{ config, lib, pkgs, username, ... }: + +{ + home = { + stateVersion = "25.11"; + username = username; + homeDirectory = "/home/${username}"; + }; + + dov = { + shell = { + zsh = { + enable = true; + shellAliases = { + ll = "eza -al"; + sc = "source $HOME/.zshrc"; + psax = "ps ax | grep"; + cp = "rsync -ah --progress"; + }; + }; + }; + }; + + programs.home-manager.enable = true; + + home.packages = with pkgs; [ + eza + ]; +} diff --git a/machines/minimal.nix b/machines/minimal.nix new file mode 100644 index 0000000..0f9f3c8 --- /dev/null +++ b/machines/minimal.nix @@ -0,0 +1,90 @@ +{ inputs, config, lib, pkgs, username, ... }: + +let flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs; +in { + + users.mutableUsers = false; + + users.users.${username} = { + isNormalUser = true; + extraGroups = [ "networkmanager" "wheel" ]; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBcGhVpjmWEw1GEw0y/ysJPa2v3+u/Rt/iES/Se2huH2 alexander0derevianko@gmail.com" + ]; + + shell = pkgs.zsh; + }; + + environment.systemPackages = with pkgs; [ + vim + wget + ripgrep + ]; + + programs = { + zsh.enable = true; + }; + + services.openssh = { + enable = true; + settings = { + # Opinionated: forbid root login through SSH. + PermitRootLogin = "no"; + # Opinionated: use keys only. + # Remove if you want to SSH using passwords + PasswordAuthentication = false; + }; + }; + + nixpkgs = { + # You can add overlays here + overlays = [ ]; + # Configure your nixpkgs instance + config = { + # Disable if you don't want unfree packages + allowUnfree = true; + }; + }; + + nix = { + settings = { + # Enable flakes and new 'nix' command + experimental-features = "nix-command flakes"; + # Opinionated: disable global registry + flake-registry = ""; + + # Allow user to reubild nixos without sudo + trusted-users = [ "root" username ]; + }; + # Opinionated: disable channels + channel.enable = false; + + # Opinionated: make flake registry and nix path match flake inputs + registry = lib.mkDefault (lib.mapAttrs (_: flake: { inherit flake; }) flakeInputs); + nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs; + }; + + boot.loader.grub.enable = true; + boot.loader.grub.useOSProber = true; + + time.timeZone = "Europe/Warsaw"; + + # Select internationalisation properties. + i18n = { + defaultLocale = "en_US.UTF-8"; + + extraLocaleSettings = { + LC_ADDRESS = "en_GB.UTF-8"; + LC_IDENTIFICATION = "en_GB.UTF-8"; + LC_MEASUREMENT = "en_GB.UTF-8"; + LC_MONETARY = "en_GB.UTF-8"; + LC_NAME = "en_GB.UTF-8"; + LC_NUMERIC = "en_GB.UTF-8"; + LC_PAPER = "en_GB.UTF-8"; + LC_TELEPHONE = "en_GB.UTF-8"; + LC_TIME = "en_GB.UTF-8"; + }; + }; + + security.rtkit.enable = true; +} diff --git a/machines/susano/default.nix b/machines/susano/default.nix index 471011e..92ac85b 100644 --- a/machines/susano/default.nix +++ b/machines/susano/default.nix @@ -132,7 +132,6 @@ in { ### # My Services ### - dov = { # Reverse Proxy reverse-proxy = { diff --git a/modules/default.nix b/modules/default.nix index 4ddea19..866c0eb 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -10,5 +10,6 @@ ./searxng ./auth ./development + ./window-manager ]; } diff --git a/modules/development/default.nix b/modules/development/default.nix index 8a5e0b6..be8ed05 100644 --- a/modules/development/default.nix +++ b/modules/development/default.nix @@ -3,5 +3,6 @@ { imports = [ ./nix-vscode-server + ./emacs ]; } diff --git a/modules/development/emacs/default.nix b/modules/development/emacs/default.nix new file mode 100644 index 0000000..5eb1e22 --- /dev/null +++ b/modules/development/emacs/default.nix @@ -0,0 +1,79 @@ +{ inputs, config, lib, pkgs, username, ... }: + +with lib; + +let + cfg = config.dov.development.emacs; +in { + + options.dov.development.emacs = { enable = mkEnableOption "emacs config"; }; + + config = mkIf cfg.enable { + nixpkgs.overlays = [ + inputs.emacs-overlay.overlay + ]; + + users.users."${username}" = { + + packages = with pkgs; [ + ## Emacs itself + binutils # native-comp needs 'as', provided by this + # 28.2 + native-comp + ((emacsPackagesFor emacs-unstable).emacsWithPackages (epkgs: [ + epkgs.vterm + epkgs.treesit-grammars.with-all-grammars + epkgs.mu4e + epkgs.org-mime + + ])) + + ## Doom dependencies + git + (ripgrep.override {withPCRE2 = true;}) + gnutls # for TLS connectivity + + ## Optional dependencies + fd # faster projectile indexing + imagemagick # for image-dired + pinentry-emacs # in-emacs gnupg prompts + zstd # for undo-fu-session/undo-tree compression + + ## Module dependencies + # :checkers spell + (aspellWithDicts (ds: with ds; [ en en-computers en-science ])) + # :tools editorconfig + editorconfig-core-c # per-project style config + # :tools lookup & :lang org +roam + sqlite + # :lang latex & :lang org (latex previews) + texlive.combined.scheme-medium + # :lang nix + nixfmt-classic + #nixd + nil + # :lang lisp + sbcl + # :lang sh + shellcheck + # :lang typescript + #javascript-typescript-langserver # deprecated + deno + # :lang go + # go + # gopls + # gotests + # gomodifytags + # gore + # gotools + # :lang ruby + ruby + rbenv + rubocop + + isync # mu4e related + ]; + + }; + }; + +} diff --git a/modules/virtualisation/docker/default.nix b/modules/virtualisation/docker/default.nix index 9d8a333..1c0bc8b 100644 --- a/modules/virtualisation/docker/default.nix +++ b/modules/virtualisation/docker/default.nix @@ -9,7 +9,7 @@ in { enable = mkEnableOption "docker config"; username = mkOption { default = "susano"; - type = types.string; + type = types.str; }; isBtrfsStorageDriver = mkOption { default = true; diff --git a/modules/window-manager/default.nix b/modules/window-manager/default.nix new file mode 100644 index 0000000..3149a99 --- /dev/null +++ b/modules/window-manager/default.nix @@ -0,0 +1,7 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + ./hypr + ]; +} diff --git a/modules/window-manager/hypr/default.nix b/modules/window-manager/hypr/default.nix new file mode 100644 index 0000000..14fc5b2 --- /dev/null +++ b/modules/window-manager/hypr/default.nix @@ -0,0 +1,282 @@ +{ inputs, config, lib, pkgs, ... }: + +with lib; + +let + colors = config.lib.stylix.colors; + cfg = config.dov.window-manager.hypr; +in { + options.dov.window-manager.hypr.enable = mkEnableOption "hypr configuration"; + config = mkIf cfg.enable { + programs.hyprland = { + enable = true; + xwayland.enable = true; + }; + + environment = { + systemPackages = with pkgs; [ + wlr-randr + wdisplays + ]; + + sessionVariables = { + WLR_NO_HARWARE_CURSORS = "1"; + NIXOS_OZONE_WL = "1"; + }; + }; + + hardware = { + graphics.enable = true; + nvidia.modesetting.enable = true; + }; + + # For screen sharing + services.pipewire.enable = true; + xdg = { + portal = { + enable = true; + extraPortals = with pkgs; [ + xdg-desktop-portal-wlr + xdg-desktop-portal-gtk + xdg-desktop-portal-gnome + xdg-desktop-portal + ]; + }; + }; + + home-manager.config = { + home.packages = with pkgs; [ + swww + mako + pipewire + wireplumber + libnotify + kitty + jq # used in lock to get language + wayland-protocols + + #hyprland extensions + hyprlock + hypridle + ]; + + wayland.windowManager.hyprland = { + enable = true; + xwayland.enable = true; + package = inputs.hyprland.packages.${pkgs.system}.hyprland; + plugins = [ + inputs.split-monitor-workspaces.packages.${pkgs.system}.split-monitor-workspaces + ]; + + settings = { + monitor = ",highres,auto,1"; + source = "~/.config/hypr/colors"; + + env = [ + "LIBVA_DRIVER_NAME,nvidia" + "XDG_SESSION_TYPE,wayland" + "WLR_NO_HARDWARE_CURSORS,1" + ]; + + #Autostart + exec = [ + # Fix slow startup + "systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" + "dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" + ]; + + exec-once = [ + "mako" + "polkit-kde-agent" + "emacs --fg-daemon" + "hypridle" + "kanshi" + "virsh net-start default" + #"thunderbird" + #"element-desktop" + "keepassxc" + "dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP" + ] ++ lib.optionals config.home-manager.config.dov.bar.waybar.enable [ "waybar" ]; + + "$mainMod" = "SUPER"; + + bind = [ + "$mainMod, G, fullscreen," + "$mainMod, t, togglegroup" + "$mainMod, v, togglefloating" + "$mainMod, s, togglesplit" + + #bind = $mainMod, RETURN, exec, kitty + "$mainMod, RETURN, exec, alacritty" + "$mainMod, o, exec, emacsclient -c" + "SUPER_SHIFT, RETURN, exec, thunar" + "SUPER_SHIFT, l, exec, hyprctl switchxkblayout at-translated-set-2-keyboard 0 && hyprlock" + + #bind = $mainMod, M, exit, + "SUPER_SHIFT, q, killactive," + + # Switch Keyboard Layouts + "$mainMod, SPACE, exec, hyprctl switchxkblayout teclado-gamer-husky-blizzard next" + + '', Print, exec, grim -g "$(slurp)" - | wl-copy'' + '' + SHIFT, Print, exec, IMG=~/Pictures/$(date +%Y-%m-%d_%H-%m-%s).png && grim -g "$(slurp)" $IMG'' + + # Functional keybinds + ",XF86AudioMicMute,exec,pamixer --default-source -t" + ",XF86MonBrightnessDown,exec,brightnessctl s 20-" + ",XF86MonBrightnessUp,exec,brightnessctl s 20+" + ",XF86AudioMute,exec,amixer -q sset Master toggle" + ",XF86AudioLowerVolume,exec,amixer -q sset Master 5%-" + ",XF86AudioRaiseVolume,exec,amixer -q sset Master 5%+" + ",XF86AudioPlay,exec,playerctl play-pause" + ",XF86AudioPause,exec,playerctl play-pause" + + # to switch between windows in a floating workspace + "SUPER,Tab,changegroupactive, f" + "SUPER_SHIFT,Tab,changegroupactive, b" + + # Move focus with mainMod + arrow keys + "$mainMod, h, movefocus, l" + "$mainMod, l, movefocus, r" + "$mainMod, k, movefocus, u" + "$mainMod, j, movefocus, d" + + # Switch workspaces with mainMod + [0-9] + "$mainMod, 1, split-workspace, 1" + "$mainMod, 2, split-workspace, 2" + "$mainMod, 3, split-workspace, 3" + "$mainMod, 4, split-workspace, 4" + "$mainMod, 5, split-workspace, 5" + "$mainMod, 6, split-workspace, 6" + "$mainMod, 7, split-workspace, 7" + "$mainMod, 8, split-workspace, 8" + "$mainMod, 9, split-workspace, 9" + "$mainMod, 0, split-workspace, 10" + + # Move active window to a workspace with mainMod + SHIFT + [0-9] + "$mainMod SHIFT, 1, split-movetoworkspace, 1" + "$mainMod SHIFT, 2, split-movetoworkspace, 2" + "$mainMod SHIFT, 3, split-movetoworkspace, 3" + "$mainMod SHIFT, 4, split-movetoworkspace, 4" + "$mainMod SHIFT, 5, split-movetoworkspace, 5" + "$mainMod SHIFT, 6, split-movetoworkspace, 6" + "$mainMod SHIFT, 7, split-movetoworkspace, 7" + "$mainMod SHIFT, 8, split-movetoworkspace, 8" + "$mainMod SHIFT, 9, split-movetoworkspace, 9" + "$mainMod SHIFT, 0, split-movetoworkspace, 10" + + # Scroll through existing workspaces with mainMod + scroll + "$mainMod, mouse_down, split-workspace, e+1" + "$mainMod, mouse_up, split-workspace, e-1" + "$mainMod,SPACE, exec, hyprctl switchxkblayout at-translated-set-2-keyboard next" + ] ++ lib.optionals dov.launcher.wofi.enable + [ "$mainMod, p, exec, wofi --show drun" ]; + + bindm = [ + "$mainMod, mouse:272, movewindow" + "$mainMod, mouse:273, resizewindow" + "ALT, mouse:272, resizewindow" + ]; + + input = { + kb_layout = "us,ru,ua"; + kb_options = "grp:win_space_toggle"; + + follow_mouse = 1; + + touchpad = { natural_scroll = false; }; + + sensitivity = 0; + }; + + general = { + gaps_in = 5; + gaps_out = 20; + border_size = 2; + "col.active_border" = + lib.mkForce "rgba(33ccffee) rgba(00ff99ee) 45deg"; + "col.inactive_border" = lib.mkForce "rgba(595959aa)"; + + layout = "dwindle"; + }; + + decoration = { + rounding = 10; + + shadow = { + enabled = true; + range = 4; + render_power = 3; + }; + }; + + animations = { + enabled = "yes"; + + bezier = "ease,0.4,0.02,0.21,1"; + + animation = [ + "windows, 1, 3.5, ease, slide" + "windowsOut, 1, 3.5, ease, slide" + "border, 1, 6, default" + "fade, 1, 3, ease" + "workspaces, 1, 3.5, ease" + ]; + }; + + dwindle = { + pseudotile = "yes"; + preserve_split = "yes"; + }; + + master = { new_status = "master"; }; + + gestures = { workspace_swipe = false; }; + + workspace = [ + #"0, monitor:DP-1" + "8, monitor:e-DP-1" + "9, monitor:e-DP-1" + #"9, on-created-empty:[tiled] thunderbird" + ]; + + windowrulev2 = [ + "workspace 9, class:^(.*thunderbird.*)$" + "group, class:^(.*thunderbird.*)$" + "workspace 9, class:^(.*Element.*)$" + "group, class:^(.*Element.*)$" + "workspace 8, title:^(.*KeePassXC.*)$" + "float, class:^(.*steam.*)$" + "noinitialfocus,class:(jetbrains-)(.*),title:^win(.*), initialTitle:win.*, floating:1" + ]; + }; + }; + + home.file.".config/hypr/colors".text = '' + $background = ${colors.base00} + $foreground = ${colors.base05} + + $color0 = ${colors.base00} + $color1 = ${colors.base01} + $color2 = ${colors.base02} + $color3 = ${colors.base03} + $color4 = ${colors.base04} + $color5 = ${colors.base05} + $color6 = ${colors.base06} + $color7 = ${colors.base07} + $color8 = ${colors.base08} + $color9 = ${colors.base09} + $color10 = ${colors.base0A} + $color11 = ${colors.base0B} + $color12 = ${colors.base0C} + $color13 = ${colors.base0D} + $color14 = ${colors.base0E} + $color15 = ${colors.base0F} + ''; + + xdg.configFile."hypr/hyprlock.conf".source = ./hyprlock.conf; + xdg.configFile."hypr/hypridle.conf".source = ./hypridle.conf; + }; + }; +}