From 15b909473e9f246dd6f9bf4775d9f41c654857a6 Mon Sep 17 00:00:00 2001 From: Avery Date: Fri, 28 Jun 2024 18:15:13 +0200 Subject: [PATCH] 2 last months --- README.md | 50 +++-- common/home.nix | 2 +- flake.lock | 157 ++++++++------ flake.nix | 82 ++++---- hosts/greatyamada/nixos.nix | 35 ++-- hosts/greatyamada/services/adguardhome.nix | 0 hosts/greatyamada/services/default.nix | 13 +- hosts/greatyamada/services/forgejo.nix | 10 +- hosts/greatyamada/services/invidious.nix | 40 ++++ hosts/greatyamada/services/jellyfin.nix | 20 ++ .../greatyamada/services/matrix-internal.nix | 14 ++ hosts/greatyamada/services/matrix.nix | 34 +++ .../greatyamada/services/minecraft/bukkit.yml | 33 +++ .../services/minecraft/data-directory.nix | 1 + .../services/minecraft/default.nix | 82 ++++++++ .../services/minecraft/plugins/default.nix | 4 + .../plugins/packages/essentialsx.nix | 24 +++ .../services/minecraft/server-icon.png | Bin 0 -> 9671 bytes .../greatyamada/services/minecraft/spigot.yml | 169 +++++++++++++++ .../services/nginx-local-config.nix | 7 + hosts/greatyamada/services/nginx.nix | 19 ++ hosts/greatyamada/services/postgresql.nix | 1 + hosts/greatyamada/services/radicale.nix | 28 +++ hosts/totsugeki/desktop/default.nix | 59 ------ hosts/totsugeki/desktop/dunst.nix | 31 --- hosts/totsugeki/desktop/hyprland.nix | 184 ---------------- hosts/totsugeki/desktop/qt.nix | 7 - hosts/totsugeki/desktop/rofi.nix | 176 ---------------- .../desktop/scripts/change-wallpaper.nix | 81 ------- .../totsugeki/desktop/scripts/colorpicker.nix | 12 -- .../desktop/scripts/currently-playing.nix | 29 --- .../totsugeki/desktop/scripts/screenshot.nix | 36 ---- .../desktop/scripts_legacy/bin/now-playing.sh | 18 -- .../scripts_legacy/bin/persistent-waybar.sh | 5 - .../scripts_legacy/bin/play_to_soundboard.sh | 3 - .../scripts_legacy/bin/setup_soundboard.sh | 7 - .../desktop/scripts_legacy/bin/volumectl.sh | 72 ------- hosts/totsugeki/desktop/waybar.nix | 197 ------------------ hosts/totsugeki/home-manager/default.nix | 1 + .../home-manager/desktop/default.nix | 36 ++++ .../{ => home-manager}/desktop/firefox.nix | 0 .../{ => home-manager}/desktop/gtk.nix | 0 .../{ => home-manager}/desktop/kitty.nix | 2 +- .../home-manager/desktop/plasma/default.nix | 16 ++ .../home-manager/desktop/plasma/hotkeys.nix | 27 +++ .../home-manager/desktop/plasma/input.nix | 15 ++ .../home-manager/desktop/plasma/krohnkite.nix | 23 ++ .../home-manager/desktop/plasma/theme.nix | 59 ++++++ .../development/default.nix | 3 +- .../development/nixvim/completion.nix | 0 .../development/nixvim/default.nix | 0 .../development/nixvim/lsp.nix | 0 .../development/nixvim/lualine.nix | 0 .../development/nixvim/neo-tree.nix | 0 .../development/nixvim/none-ls.nix | 0 .../development/nixvim/treesitter.nix | 0 .../home-manager/scripts/default.nix | 6 + .../scripts/play-on-soundboard.nix | 16 ++ .../home-manager/scripts/setup-soundboard.nix | 13 ++ .../{nixos.nix => nixos/default.nix} | 64 +++--- hosts/totsugeki/nixos/filesystems.nix | 26 +++ hosts/totsugeki/nixos/plasma.nix | 10 + hosts/totsugeki/nixos/steam.nix | 7 + 63 files changed, 963 insertions(+), 1103 deletions(-) create mode 100644 hosts/greatyamada/services/adguardhome.nix create mode 100644 hosts/greatyamada/services/invidious.nix create mode 100644 hosts/greatyamada/services/jellyfin.nix create mode 100644 hosts/greatyamada/services/matrix-internal.nix create mode 100644 hosts/greatyamada/services/matrix.nix create mode 100644 hosts/greatyamada/services/minecraft/bukkit.yml create mode 100644 hosts/greatyamada/services/minecraft/data-directory.nix create mode 100644 hosts/greatyamada/services/minecraft/default.nix create mode 100644 hosts/greatyamada/services/minecraft/plugins/default.nix create mode 100644 hosts/greatyamada/services/minecraft/plugins/packages/essentialsx.nix create mode 100644 hosts/greatyamada/services/minecraft/server-icon.png create mode 100644 hosts/greatyamada/services/minecraft/spigot.yml create mode 100644 hosts/greatyamada/services/nginx-local-config.nix create mode 100644 hosts/greatyamada/services/nginx.nix create mode 100644 hosts/greatyamada/services/postgresql.nix create mode 100644 hosts/greatyamada/services/radicale.nix delete mode 100644 hosts/totsugeki/desktop/default.nix delete mode 100644 hosts/totsugeki/desktop/dunst.nix delete mode 100644 hosts/totsugeki/desktop/hyprland.nix delete mode 100644 hosts/totsugeki/desktop/qt.nix delete mode 100644 hosts/totsugeki/desktop/rofi.nix delete mode 100644 hosts/totsugeki/desktop/scripts/change-wallpaper.nix delete mode 100644 hosts/totsugeki/desktop/scripts/colorpicker.nix delete mode 100644 hosts/totsugeki/desktop/scripts/currently-playing.nix delete mode 100644 hosts/totsugeki/desktop/scripts/screenshot.nix delete mode 100755 hosts/totsugeki/desktop/scripts_legacy/bin/now-playing.sh delete mode 100755 hosts/totsugeki/desktop/scripts_legacy/bin/persistent-waybar.sh delete mode 100755 hosts/totsugeki/desktop/scripts_legacy/bin/play_to_soundboard.sh delete mode 100755 hosts/totsugeki/desktop/scripts_legacy/bin/setup_soundboard.sh delete mode 100755 hosts/totsugeki/desktop/scripts_legacy/bin/volumectl.sh delete mode 100644 hosts/totsugeki/desktop/waybar.nix create mode 100644 hosts/totsugeki/home-manager/default.nix create mode 100644 hosts/totsugeki/home-manager/desktop/default.nix rename hosts/totsugeki/{ => home-manager}/desktop/firefox.nix (100%) rename hosts/totsugeki/{ => home-manager}/desktop/gtk.nix (100%) rename hosts/totsugeki/{ => home-manager}/desktop/kitty.nix (98%) create mode 100644 hosts/totsugeki/home-manager/desktop/plasma/default.nix create mode 100644 hosts/totsugeki/home-manager/desktop/plasma/hotkeys.nix create mode 100644 hosts/totsugeki/home-manager/desktop/plasma/input.nix create mode 100644 hosts/totsugeki/home-manager/desktop/plasma/krohnkite.nix create mode 100644 hosts/totsugeki/home-manager/desktop/plasma/theme.nix rename hosts/totsugeki/{ => home-manager}/development/default.nix (96%) rename hosts/totsugeki/{ => home-manager}/development/nixvim/completion.nix (100%) rename hosts/totsugeki/{ => home-manager}/development/nixvim/default.nix (100%) rename hosts/totsugeki/{ => home-manager}/development/nixvim/lsp.nix (100%) rename hosts/totsugeki/{ => home-manager}/development/nixvim/lualine.nix (100%) rename hosts/totsugeki/{ => home-manager}/development/nixvim/neo-tree.nix (100%) rename hosts/totsugeki/{ => home-manager}/development/nixvim/none-ls.nix (100%) rename hosts/totsugeki/{ => home-manager}/development/nixvim/treesitter.nix (100%) create mode 100644 hosts/totsugeki/home-manager/scripts/default.nix create mode 100644 hosts/totsugeki/home-manager/scripts/play-on-soundboard.nix create mode 100644 hosts/totsugeki/home-manager/scripts/setup-soundboard.nix rename hosts/totsugeki/{nixos.nix => nixos/default.nix} (62%) create mode 100644 hosts/totsugeki/nixos/filesystems.nix create mode 100644 hosts/totsugeki/nixos/plasma.nix create mode 100644 hosts/totsugeki/nixos/steam.nix diff --git a/README.md b/README.md index 61e4436..fde2c5a 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,42 @@ # NixOS system configurations -## 🐬 Totsugeki +## Installation (WIP) + +## Hosts + +### 🐬 Totsugeki Configuration files for my desktop -### Programs +#### Programs -Name | Type -:-: | :-: -Hyprland | Wayland compositor -Hyprlock | Screen locker -Waybar | Statusbar -dunst | Notification daemon -rofi | Launcher -swww | Wallpaper daemon -Neovim | Text editor -Firefox | Web browser -Dolphin | File browser -qBittorrent | Torrent client +| Name | Type | +| :----------: | :-----------------: | +| KDE Plasma 6 | Desktop environment | +| Krohnkite | Auto-tiling plugin | +| Neovim | Text editor | +| Firefox | Web browser | +| Dolphin | File browser | +| qBittorrent | Torrent client | +#### Games -## 🐳 Great Yamada +- Steam +- Minecraft (Prism Launcher) +- osu! (Lazer client) +- r2modman (Mod manager) +- ProtonUp-Qt + +### 🐳 Great Yamada Configuration for my home server -### Services +#### Services **Still a WIP** -Name | Type | Public-facing -:-: | :-: | :-: -Nginx | Web server and reverse proxy | x -PostgreSQL | Database engine -Forgejo | Git repository | x - +| Name | Type | Public-facing | +| :--------: | :--------------------------: | :-----------: | +| Nginx | Web server and reverse proxy | x | +| PostgreSQL | Database engine | +| Forgejo | Git repository | x | diff --git a/common/home.nix b/common/home.nix index 494841f..b2de5c3 100644 --- a/common/home.nix +++ b/common/home.nix @@ -6,7 +6,7 @@ packages = with pkgs; [ python3 rclone xdg-utils ]; sessionVariables = { EDITOR = "nvim"; - DOTNET_ROOT = "${pkgs.dotnet-sdk_7}"; + DOTNET_ROOT = "${pkgs.dotnet-sdk_8}"; }; sessionPath = [ "$HOME/.dotnet/tools" ]; }; diff --git a/flake.lock b/flake.lock index 7216918..4589dbb 100644 --- a/flake.lock +++ b/flake.lock @@ -9,11 +9,11 @@ ] }, "locked": { - "lastModified": 1711099426, - "narHash": "sha256-HzpgM/wc3aqpnHJJ2oDqPBkNsqWbW0WfWUO8lKu8nGk=", + "lastModified": 1717408969, + "narHash": "sha256-Q0OEFqe35fZbbRPPRdrjTUUChKVhhWXz3T9ZSKmaoVY=", "owner": "numtide", "repo": "devshell", - "rev": "2d45b54ca4a183f2fdcf4b19c895b64fbf620ee8", + "rev": "1ebbe68d57457c8cae98145410b164b5477761f4", "type": "github" }, "original": { @@ -60,11 +60,11 @@ ] }, "locked": { - "lastModified": 1712014858, - "narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=", + "lastModified": 1717285511, + "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "9126214d0a59633752a136528f5f3b9aa8565b7d", + "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8", "type": "github" }, "original": { @@ -91,21 +91,30 @@ "type": "github" } }, - "flake-utils_2": { + "git-hooks": { "inputs": { - "systems": "systems_2" + "flake-compat": "flake-compat_2", + "gitignore": "gitignore", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ], + "nixpkgs-stable": [ + "nixvim", + "nixpkgs" + ] }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "lastModified": 1717664902, + "narHash": "sha256-7XfBuLULizXjXfBYy/VV+SpYMHreNRHk9nKMsm1bgb4=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "cc4d466cb1254af050ff7bdf47f6d404a7c646d1", "type": "github" }, "original": { - "owner": "numtide", - "repo": "flake-utils", + "owner": "cachix", + "repo": "git-hooks.nix", "type": "github" } }, @@ -113,7 +122,7 @@ "inputs": { "nixpkgs": [ "nixvim", - "pre-commit-hooks", + "git-hooks", "nixpkgs" ] }, @@ -138,11 +147,11 @@ ] }, "locked": { - "lastModified": 1713527814, - "narHash": "sha256-0NJLgMKvv+HluzeHei/m8vDhX3xovNLkMw/idwIJ218=", + "lastModified": 1718526747, + "narHash": "sha256-sKrD/utGvmtQALvuDj4j0CT3AJXP1idOAq2p+27TpeE=", "owner": "nix-community", "repo": "home-manager", - "rev": "0184c8180f5cbb8e3a54a239b874fe849d3073cb", + "rev": "0a7ffb28e5df5844d0e8039c9833d7075cdee792", "type": "github" }, "original": { @@ -159,11 +168,32 @@ ] }, "locked": { - "lastModified": 1712989663, - "narHash": "sha256-r2X/DIAyKOLiHoncjcxUk1TENWDTTaigRBaY53Cts/w=", + "lastModified": 1718141734, + "narHash": "sha256-cA+6l8ZCZ7MXGijVuY/1f55+wF/RT4PlTR9+g4bx86w=", "owner": "nix-community", "repo": "home-manager", - "rev": "40ab43ae98cb3e6f07eaeaa3f3ed56d589da21b0", + "rev": "892f76bd0aa09a0f7f73eb41834b8a904b6d0fad", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_3": { + "inputs": { + "nixpkgs": [ + "plasma-manager", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1714377222, + "narHash": "sha256-UsDsjWCKlWn8vbXi8Zza9Hkq3xyk8fpvFNo2VM5S74E=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "2af7c78b7bb9cf18406a193eba13ef9f99388f49", "type": "github" }, "original": { @@ -180,11 +210,11 @@ ] }, "locked": { - "lastModified": 1711763326, - "narHash": "sha256-sXcesZWKXFlEQ8oyGHnfk4xc9f2Ip0X/+YZOq3sKviI=", + "lastModified": 1717976995, + "narHash": "sha256-u3HBinyIyUvL1+N816bODpJmSQdgn0Mbb8BprFw7kqo=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "36524adc31566655f2f4d55ad6b875fb5c1a4083", + "rev": "315aa649ba307704db0b16c92f097a08a65ec955", "type": "github" }, "original": { @@ -195,27 +225,27 @@ }, "nixpkgs": { "locked": { - "lastModified": 1713297878, - "narHash": "sha256-hOkzkhLT59wR8VaMbh1ESjtZLbGi+XNaBN6h49SPqEc=", + "lastModified": 1718276662, + "narHash": "sha256-p0KXZc6ekKXwYcMeyS5Hs9uTQKoSDkJW1QDf0gkilLk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "66adc1e47f8784803f2deb6cacd5e07264ec2d5c", + "rev": "b17538d34de26bf52626a9caff104a267abd991a", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-unstable", "repo": "nixpkgs", + "rev": "b17538d34de26bf52626a9caff104a267abd991a", "type": "github" } }, "nixpkgs-stable": { "locked": { - "lastModified": 1713434076, - "narHash": "sha256-+/p5edwlkqKZc6GDAQl+92Hoe1f3NNbUF9uj+X9H3pU=", + "lastModified": 1718478900, + "narHash": "sha256-v43N1gZLcGkhg3PdcrKUNIZ1L0FBzB2JqhIYEyKAHEs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8494ae076b7878d61a7d2d25e89a847fe8f8364c", + "rev": "c884223af91820615a6146af1ae1fea25c107005", "type": "github" }, "original": { @@ -230,19 +260,20 @@ "devshell": "devshell", "flake-compat": "flake-compat", "flake-parts": "flake-parts", + "git-hooks": "git-hooks", "home-manager": "home-manager_2", "nix-darwin": "nix-darwin", "nixpkgs": [ "nixpkgs" ], - "pre-commit-hooks": "pre-commit-hooks" + "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1713530381, - "narHash": "sha256-54sXzrwhKkI9uzeHRPNtpB4pCQqIkzzr1FFUiG4znQU=", + "lastModified": 1718578900, + "narHash": "sha256-BX0aRxoE3zOrX9vsm6zTcby0cpfc6z3olWkvbmKXi+Q=", "owner": "nix-community", "repo": "nixvim", - "rev": "83a7ce9846b1b01a34b3e6b25077c1a5044ad7b3", + "rev": "36b4a39b2bd3bafc0cfd28bf94e1b21f142b6884", "type": "github" }, "original": { @@ -251,31 +282,24 @@ "type": "github" } }, - "pre-commit-hooks": { + "plasma-manager": { "inputs": { - "flake-compat": "flake-compat_2", - "flake-utils": "flake-utils_2", - "gitignore": "gitignore", + "home-manager": "home-manager_3", "nixpkgs": [ - "nixvim", - "nixpkgs" - ], - "nixpkgs-stable": [ - "nixvim", "nixpkgs" ] }, "locked": { - "lastModified": 1712897695, - "narHash": "sha256-nMirxrGteNAl9sWiOhoN5tIHyjBbVi5e2tgZUgZlK3Y=", - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "40e6053ecb65fcbf12863338a6dcefb3f55f1bf8", + "lastModified": 1718567165, + "narHash": "sha256-nhg4r4Kn3deooPiNao8oH/K7CcvRotDzBtg00MXiZkU=", + "owner": "pjones", + "repo": "plasma-manager", + "rev": "b906c67581fa12ad2821f295b37b5733fcc76926", "type": "github" }, "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", + "owner": "pjones", + "repo": "plasma-manager", "type": "github" } }, @@ -284,6 +308,7 @@ "home-manager": "home-manager", "nixpkgs": "nixpkgs", "nixvim": "nixvim", + "plasma-manager": "plasma-manager", "sops-nix": "sops-nix" } }, @@ -295,11 +320,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1713532771, - "narHash": "sha256-vfKxhYVMzG2tg48/1rewBoSLCrKIjQsG1j7Nm/Y2gf4=", + "lastModified": 1718506969, + "narHash": "sha256-Pm9I/BMQHbsucdWf6y9G3xBZh3TMlThGo4KBbeoeczg=", "owner": "Mic92", "repo": "sops-nix", - "rev": "a929a011a09db735abc45a8a45d1ff7fdee62755", + "rev": "797ce4c1f45a85df6dd3d9abdc53f2691bea9251", "type": "github" }, "original": { @@ -323,18 +348,24 @@ "type": "github" } }, - "systems_2": { + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "lastModified": 1718139168, + "narHash": "sha256-1TZQcdETNdJMcfwwoshVeCjwWfrPtkSQ8y8wFX3it7k=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "1cb529bffa880746a1d0ec4e0f5076876af931f1", "type": "github" }, "original": { - "owner": "nix-systems", - "repo": "default", + "owner": "numtide", + "repo": "treefmt-nix", "type": "github" } } diff --git a/flake.nix b/flake.nix index 4e27af9..95412d0 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,9 @@ description = "System configurations"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + # nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + nixpkgs.url = + "github:nixos/nixpkgs/b17538d34de26bf52626a9caff104a267abd991a"; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; @@ -15,40 +17,50 @@ url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; }; - }; - - outputs = { self, nixpkgs, home-manager, nixvim, sops-nix }@inputs: { - nixosConfigurations = { - totsugeki = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - ./common/nixos.nix - ./hosts/totsugeki/nixos.nix - home-manager.nixosModules.home-manager - sops-nix.nixosModules.sops - { - home-manager.useUserPackages = true; - home-manager.users.avery = { - imports = [ - nixvim.homeManagerModules.nixvim - ./common/home.nix - ./common/zsh - ./hosts/totsugeki/desktop - ./hosts/totsugeki/development - ]; - }; - } - ]; - }; - greatyamada = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - modules = [ - ./common/nixos.nix - ./hosts/greatyamada/nixos.nix - ./hosts/greatyamada/services - sops-nix.nixosModules.sops - ]; - }; + plasma-manager = { + url = "github:pjones/plasma-manager"; + inputs.nixpkgs.follows = "nixpkgs"; }; }; + + outputs = + { self, nixpkgs, home-manager, nixvim, sops-nix, plasma-manager }@inputs: { + nixosConfigurations = { + totsugeki = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./common/nixos.nix + ./hosts/totsugeki/nixos + ./hosts/greatyamada/services/minecraft + sops-nix.nixosModules.sops + home-manager.nixosModules.home-manager + { + home-manager = { + backupFileExtension = "bak"; + useUserPackages = true; + users.avery = { + imports = [ + nixvim.homeManagerModules.nixvim + plasma-manager.homeManagerModules.plasma-manager + ./common/home.nix + ./common/zsh + ./hosts/totsugeki/home-manager + ]; + }; + }; + } + ]; + specialArgs = { inherit inputs; }; + }; + greatyamada = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./common/nixos.nix + ./hosts/greatyamada/nixos.nix + ./hosts/greatyamada/services + sops-nix.nixosModules.sops + ]; + }; + }; + }; } diff --git a/hosts/greatyamada/nixos.nix b/hosts/greatyamada/nixos.nix index 690e36c..1bf16da 100644 --- a/hosts/greatyamada/nixos.nix +++ b/hosts/greatyamada/nixos.nix @@ -13,28 +13,31 @@ device = "/dev/disk/by-uuid/61050e8d-41c6-4c37-98a9-d8b0cdce6903"; fsType = "btrfs"; options = [ "compress=zstd:15" "subvol=/home" ]; - } + }; "/mnt/Datos" = { - device = "/dev/disk/by-uuid/6a5274fc-8ee8-41ae-b7a0-867e5bbc25f4"; - fsType = "btrfs"; - options = [ "compress=zstd:15" ]; - } + device = "/dev/disk/by-uuid/6a5274fc-8ee8-41ae-b7a0-867e5bbc25f4"; + fsType = "btrfs"; + options = [ "compress=zstd:15" ]; + }; + "/mnt/Datos/minecraft" = { + device = "/dev/disk/by-uuid/6a5274fc-8ee8-41ae-b7a0-867e5bbc25f4"; + fsType = "btrfs"; + options = [ "compress=zstd:4" "subvol=/minecraft" ]; + }; "/mnt/Datos/music" = { - device = "/dev/disk/by-uuid/6a5274fc-8ee8-41ae-b7a0-867e5bbc25f4"; - fsType = "btrfs"; - options = [ "compress=zstd:15" "subvol=/music" ]; - } + device = "/dev/disk/by-uuid/6a5274fc-8ee8-41ae-b7a0-867e5bbc25f4"; + fsType = "btrfs"; + options = [ "subvol=/music" ]; + }; "/var/www" = { - device = "/dev/disk/by-uuid/6a5274fc-8ee8-41ae-b7a0-867e5bbc25f4"; - fsType = "btrfs"; - options = [ "compress=zstd:15" "subvol=/html" ]; - } + device = "/dev/disk/by-uuid/6a5274fc-8ee8-41ae-b7a0-867e5bbc25f4"; + fsType = "btrfs"; + options = [ "compress=zstd:15" "subvol=/html" ]; + }; }; networking = { - firewall = { - enable = true; - }; + firewall.enable = true; hostName = "greatyamada"; networkmanager.enable = true; useDHCP = lib.mkDefault false; diff --git a/hosts/greatyamada/services/adguardhome.nix b/hosts/greatyamada/services/adguardhome.nix new file mode 100644 index 0000000..e69de29 diff --git a/hosts/greatyamada/services/default.nix b/hosts/greatyamada/services/default.nix index 9aaf87a..c06dfbb 100644 --- a/hosts/greatyamada/services/default.nix +++ b/hosts/greatyamada/services/default.nix @@ -1 +1,12 @@ -{ ... }: { imports = [ ./nginx.nix ./forgejo.nix ]; } +{ ... }: { + imports = [ + ./nginx.nix + ./forgejo.nix + ./invidious.nix + ./jellyfin.nix + ./postgresql.nix + ./radicale.nix + ]; + # TODO: adguardhome matrix matrix-second minecraft terraria factorio coturn mautrix-whatsapp wireguard + # paperlessngx +} diff --git a/hosts/greatyamada/services/forgejo.nix b/hosts/greatyamada/services/forgejo.nix index 79ef926..acfc272 100644 --- a/hosts/greatyamada/services/forgejo.nix +++ b/hosts/greatyamada/services/forgejo.nix @@ -40,12 +40,10 @@ in { }; }; }; - nginx = { - virtualHosts."git.rcia.dev" = { - locations."/" = { - proxyPass = "http://127.0.0.1:3000"; - clientMaxBodySize = "200M"; - }; + nginx.virtualHosts."git.rcia.dev" = { + locations."/" = { + proxyPass = "http://127.0.0.1:3000"; + clientMaxBodySize = "200M"; }; }; }; diff --git a/hosts/greatyamada/services/invidious.nix b/hosts/greatyamada/services/invidious.nix new file mode 100644 index 0000000..918dd33 --- /dev/null +++ b/hosts/greatyamada/services/invidious.nix @@ -0,0 +1,40 @@ +{ ... }: +let nginxLocalServiceConfig = import ./nginx-local-config.nix; +in { + services = { + invidious = { + enable = true; + settings = { + check_tables = true; + db.user = "invidious"; + default_user_preferences = { + locale = "es"; + dark_mode = "dark"; + autoplay = true; + video_loop = true; + quality = "dash"; + volume = 20; + }; + }; + database = { + createLocally = false; + passwordFile = "/var/lib/invidious/db_password"; + }; + hmacKeyFile = "/var/lib/invidious/hmac_key"; + }; + nginx.virtualHosts."iv.rcia.dev" = { + locations."/" = { proxyPass = "http://127.0.0.1:3000"; }; + extraConfig = nginxLocalServiceConfig; + }; + }; + sops.secrets = { + "invidious/db_password" = { + path = "/var/lib/invidious/db_password"; + owner = "invidious"; + }; + "invidious/hmac" = { + path = "/var/lib/invidious/hmac_key"; + owner = "invidious"; + }; + }; +} diff --git a/hosts/greatyamada/services/jellyfin.nix b/hosts/greatyamada/services/jellyfin.nix new file mode 100644 index 0000000..77e1667 --- /dev/null +++ b/hosts/greatyamada/services/jellyfin.nix @@ -0,0 +1,20 @@ +{ pkgs, ... }: +let + jellyfinPath = "/mnt/Datos/jellyfin/"; + nginxLocalServiceConfig = import ./nginx-local-config.nix; +in { + services = { + jellyfin = { + enable = true; + configDir = jellyfinPath + "config/"; + dataDir = jellyfinPath + "data/"; + }; + nginx.virtualHosts."jellyfin.rcia.dev" = { + locations."/" = { + proxyPass = "http://127.0.0.1:8096"; + clientMaxBodySize = "10M"; + }; + extraConfig = nginxLocalServiceConfig; + }; + }; +} diff --git a/hosts/greatyamada/services/matrix-internal.nix b/hosts/greatyamada/services/matrix-internal.nix new file mode 100644 index 0000000..e4f359d --- /dev/null +++ b/hosts/greatyamada/services/matrix-internal.nix @@ -0,0 +1,14 @@ +{ }: { + containers.matrix-bridges = { + autoStart = true; + config = { config, pkgs }: { + services.matrix-synapse = { + enable = true; + settings = { + server_name = "matrix-int.rcia.dev"; + listeners = [ { } ]; + }; + }; + }; + }; +} diff --git a/hosts/greatyamada/services/matrix.nix b/hosts/greatyamada/services/matrix.nix new file mode 100644 index 0000000..839afc5 --- /dev/null +++ b/hosts/greatyamada/services/matrix.nix @@ -0,0 +1,34 @@ +{ pkgs, ... }: +let dataDir = "/mnt/Datos/synapse"; +in { + services.matrix-synapse = { + enable = true; + settings = { + server_name = "rcia.dev"; + listeners = [{ + port = 8008; + bind_addresses = [ "synapse" ]; + tls = false; + type = http; + x_forwarded = true; + resources = [{ + names = [ "client" "federation" ]; + compress = false; + }]; + }]; + media_store_path = dataDir + "/media_store"; + max_upload_size = "100M"; + enable_registration = false; + report_stats = true; + signing_key_path = "/var/lib/matrix-synapse/matrix.rcia.dev.signing.key"; + turn_user_lifetime = "1h"; + turn_uris = [ "turn:rcia.dev:3478" "turn:rcia.dev:3479" ]; + }; + }; + sops.secrets = { + "matrix/secrets" = { + path = "/var/lib/matrix-synapse/secrets"; + owner = "matrix-synapse"; + } + } +} diff --git a/hosts/greatyamada/services/minecraft/bukkit.yml b/hosts/greatyamada/services/minecraft/bukkit.yml new file mode 100644 index 0000000..c3528dc --- /dev/null +++ b/hosts/greatyamada/services/minecraft/bukkit.yml @@ -0,0 +1,33 @@ +# Managed by NixOS configuration +settings: + use-map-color-cache: true + allow-end: true + warn-on-overload: true + permissions-file: permissions.yml + update-folder: update + plugin-profiling: false + connection-throttle: 4000 + query-plugins: true + deprecated-verbose: default + shutdown-message: Servidor cerrado + minimum-api: none +spawn-limits: + axolotls: 5 + water-underground-creature: 5 + monsters: 120 + animals: 20 + water-animals: 5 + water-ambient: 20 + ambient: 15 +chunk-gc: + period-in-ticks: 600 +ticks-per: + axolotl-spawns: 1 + water-underground-creature-spawns: 1 + animal-spawns: 400 + monster-spawns: 1 + water-spawns: 1 + water-ambient-spawns: 1 + ambient-spawns: 1 + autosave: 6000 +aliases: now-in-commands.yml diff --git a/hosts/greatyamada/services/minecraft/data-directory.nix b/hosts/greatyamada/services/minecraft/data-directory.nix new file mode 100644 index 0000000..d6265e0 --- /dev/null +++ b/hosts/greatyamada/services/minecraft/data-directory.nix @@ -0,0 +1 @@ +"/minecraft" diff --git a/hosts/greatyamada/services/minecraft/default.nix b/hosts/greatyamada/services/minecraft/default.nix new file mode 100644 index 0000000..942c3d5 --- /dev/null +++ b/hosts/greatyamada/services/minecraft/default.nix @@ -0,0 +1,82 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.services.minecraft-server; + + bukkitConfigFile = ./bukkit.yml; + + spigotConfigFile = ./spigot.yml; + + cfgToString = v: if builtins.isBool v then lib.boolToString v else toString v; + + eulaFile = builtins.toFile "eula.txt" '' + # eula.txt managed by NixOS configuration + eula=true + ''; + + opsFile = builtins.toFile "ops.json" (builtins.toJSON [{ + name = "aveeeeryy"; + uuid = "b65a1bc3-c6a0-4e8c-99b8-3538cfec0cfc"; + level = 4; + bypassesPlayerLimit = true; + }]); + + serverPropertiesFile = pkgs.writeText "server.properties" ('' + # server.properties managed by NixOS configuration + '' + lib.concatStringsSep "\n" + (lib.mapAttrsToList (n: v: "${n}=${cfgToString v}") cfg.serverProperties)); + + serverIcon = ./server-icon.png; + +in { + imports = [ ./plugins ]; + services.minecraft-server = { + enable = true; + package = pkgs.papermc.override { + mcVersion = "1.20.6"; + buildNum = "147"; + }; + declarative = true; + eula = true; + openFirewall = true; + jvmOpts = + "-Xms4G -Xmx4G -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true"; + serverProperties = { + difficulty = "hard"; + enable-rcon = false; + enforce-secure-profile = false; + enforce-whitelist = true; + hide-online-players = true; + motd = "NixOS server"; + online-mode = true; + pvp = false; + server-port = 13914; + spawn-protection = 0; + white-list = true; + }; + dataDir = import ./data-directory.nix; + }; + # Overriden to have a non-declarative whitelist + systemd.services.minecraft-server.preStart = lib.mkForce '' + ln -sf ${eulaFile} eula.txt + cp -f ${bukkitConfigFile} bukkit.yml + chmod +w bukkit.yml + cp -f ${spigotConfigFile} spigot.yml + chmod +w spigot.yml + cp -f ${opsFile} ops.json + chmod +w ops.json + ln -sf ${serverIcon} server-icon.png + if [ -e .declarative ]; then + # Was declarative before, no need to back up anything + cp -f ${serverPropertiesFile} server.properties + else + # Declarative for the first time, backup stateful files + cp -b --suffix=.stateful ${serverPropertiesFile} server.properties + + # server.properties must have write permissions, because every time + # the server starts it first parses the file and then regenerates it.. + chmod +w server.properties + echo "Autogenerated file that signifies that this server configuration is managed declaratively by NixOS" \ + > .declarative + fi + ''; +} diff --git a/hosts/greatyamada/services/minecraft/plugins/default.nix b/hosts/greatyamada/services/minecraft/plugins/default.nix new file mode 100644 index 0000000..6fdc0d1 --- /dev/null +++ b/hosts/greatyamada/services/minecraft/plugins/default.nix @@ -0,0 +1,4 @@ +{ pkgs, ... }: { + environment.systemPackages = with pkgs; + [ (callPackage ./packages/essentialsx.nix { }) ]; +} diff --git a/hosts/greatyamada/services/minecraft/plugins/packages/essentialsx.nix b/hosts/greatyamada/services/minecraft/plugins/packages/essentialsx.nix new file mode 100644 index 0000000..1e6be0e --- /dev/null +++ b/hosts/greatyamada/services/minecraft/plugins/packages/essentialsx.nix @@ -0,0 +1,24 @@ +{ config, lib, stdenv, fetchurl }: + +stdenv.mkDerivation rec { + pname = "EssentialsX"; + version = "2.20.1"; + + src = fetchurl { + url = + "https://github.com/EssentialsX/Essentials/releases/download/${version}/EssentialsX-${version}.jar"; + hash = "sha256-gC6jC9pGDKRZfoGJJYFpM8EjsI2BJqgU+sKNA6Yb9UI="; + }; + + unpackPhase = ":"; + + installPhase = '' + ln -sf EssentialsX-${version}.jar $out + ''; + + meta = { + description = "The modern Essentials suite for Spigot and Paper."; + homepage = "https://essentialsx.net/"; + license = lib.licenses.gpl3Plus; + }; +} diff --git a/hosts/greatyamada/services/minecraft/server-icon.png b/hosts/greatyamada/services/minecraft/server-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..253c653101c04a7e79dedc6c0e423d417ae348a0 GIT binary patch literal 9671 zcmeAS@N?(olHy`uVBq!ia0y~yU~m9o4mJh`hEBoB zpYQRPNlf)rv{RpF@}lWTf6VmQy2mj^H_jU?yO|mL%P5L@#p;wBYD;Tl1e@SgTV!_nAac#1SDEjtPP8tf3Jd7gtS8QgZ(7$^U=FWAT%! zlUFmj^|4-A;8gVILH&o_(VHda7fn9ox#0WJZT80+ALw1ky7BG%#@y|G4F`-1mX`k6 zs%G%pvug2T*Zzisxep%gT70tlz*9bhPfNVpo_H|M`j;eFVZS*46!YQj4*zG}j;@wp z&hId7m)Cs;_VxoVotv)P-jjXx?(Kc!xBu!Gb`=&Kt|21szhD#OWRuNa&32T5fkCpwHKN2hKQ}iu zuY|$5C^fMpHASI3vm`^o-P1Q9ypd0wfkA=6)5S5Q;?~pZ^bN7sOYd#}c5nHexVU@` z76*ZZMwf}xB!k2}4O>y5dgo)c)AI_1(oN=hKAALe&c@{G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&`s+AJ1($*vY!=r&+ba#-%e#zfbGh`Tg$=-s}GH#b?)jK415}QkE?@_U+0Kp}Whz zwKTg}u2K5?G+RSU8$P=}D}ccA7}cp^V5! zUltwxX_lOAc$W9v)`pEuM`9*?Q`pep-eTJ~pebk=!zw>e5W3%}+pEP$poi;mq-Rqc@GT+Vu z^=%tAYZWd$%3-p2vVj=$v2UwfENAbVQIMr6TYq@9zSq+A+muVN_RiT;*)+kxKt4)lrKHali`N_R zUdg@LQ=V(~`0hi?Bo~2wTJ}q{u0CO4V4e(G3-JAPyxp3}noWY;`+hESJILJT&9#y7 z)<)Nh$xmVytXC*Z>@*Z*_-l7zHe;V2)9h|0W5&aREq!S*8HVdtdG(08tYTq4!s8;i zVXfB1>FQTz_3Tvm$~4dCb<-~EZk^p-7s{^c2yvSzKRE6tQf17v{FT_TWnDq1FMpph ztH7IC*ju1DSFUWy=Y{vOGEE*|VsZXv@Ip-UshH-&#=;{;e^>oEcKzS#pF87!u65b` zqe4XbjGk)87T5fPj>jfi1gGn;itW7_a(nsopoi<_8T_tEHgSl?FA!U{!c(VUUFOEk zN`UyoGS*mGmqpG`7l&uyFDFNssV$aC;d z`_ef-{+{-0+F!Bg@8`Y)`=>XRO`f20FrZ0L#YfQl%{zB116+T8vl^Bg-Hn;eX{RQ#NC@Zl`S=;b@PnQuf1{J8nr_KB_2l0u7)GxA?Wugw3y zc{RhmIT^dxEt+pO&5r93?<4~q7VEDK8A}#1te#k`GsQ!_cD}7|MJnHq2P+PRoPP9{ zmARyqb*)?N^-$HaFC0GGbGb%3<=#zVE2l<8ERhwx`#<}1!S2S% zX>AG#>7Ea!`SKk*#T3NwTwFJ9Z$iP6yag;To0>nzSFHbjIH>KLx%IF2zq "$WALLPAPER_PATH/.current_path" - fi - - CURRENT_WALLPAPER=$(cat "$WALLPAPER_PATH/.current_path") - CURRENT_WP_INDEX=-1 - # Get the current wallpaper's index - for index in "''${!WALLPAPERS[@]}"; do - if [ "''${WALLPAPERS[$index]}" = "$CURRENT_WALLPAPER" ]; then - CURRENT_WP_INDEX=$index - fi - done - - if [ "$CURRENT_WP_INDEX" -eq -1 ]; then - CURRENT_WP_INDEX=0 - fi - - if [ "$1" = "previous" ]; then - WALLPAPER="''${WALLPAPERS[$CURRENT_WP_INDEX - 1]}" - TRANSITION_ANGLE=300 - elif [ "$1" = "next" ]; then - NEXT_INDEX=$((CURRENT_WP_INDEX + 1)) - if [ "$NEXT_INDEX" = "''${#WALLPAPERS[@]}" ]; then - NEXT_INDEX=0 - fi - WALLPAPER=''${WALLPAPERS[$NEXT_INDEX]} - TRANSITION_ANGLE=120 - elif [ "$1" = "open-menu" ]; then - INPUT="" - for index in "''${!WALLPAPERS[@]}"; do - if [ "$index" = "$CURRENT_WP_INDEX" ]; then - continue - fi - _WALLPAPER=''${WALLPAPERS[$index]} - _WALLPAPER_NAME=$(basename "$_WALLPAPER") - INPUT+="$_WALLPAPER_NAME\0icon\x1f$_WALLPAPER" - if [ ! $((index + 1)) -eq ''${#WALLPAPERS[@]} ]; then - INPUT+=$'\n' - fi - done - if ! WALLPAPER=$(echo -en "$INPUT" | rofi -dmenu -mesg "Cambiar fondo de pantalla" -p "" -i -theme ~/.config/rofi/wallpaper_selector.rasi); then - exit 1 - fi - WALLPAPER="$WALLPAPER_PATH/$WALLPAPER" - TRANSITION_ANGLE=270 - else - echo "Unknown first argument: $1" - exit 1 - fi - - if [ -z "$WALLPAPER" ]; then - exit 1 - fi - - WALLPAPER_NAME=$(basename "$WALLPAPER") - echo "Setting wallpaper to $WALLPAPER" - echo "$WALLPAPER" > "$WALLPAPER_PATH/.current_path" - ln -sf "$WALLPAPER" "$WALLPAPER_PATH/.current_image" - dunstify -i "$WALLPAPER" -t 2800 "Cambiando fondo de pantalla" "Cambiando a $WALLPAPER_NAME" - swww img\ - --transition-type wipe\ - --transition-angle $TRANSITION_ANGLE\ - --transition-step 90\ - --transition-duration 1\ - --transition-fps 165\ - "$WALLPAPER" - - ''; -} diff --git a/hosts/totsugeki/desktop/scripts/colorpicker.nix b/hosts/totsugeki/desktop/scripts/colorpicker.nix deleted file mode 100644 index 8423346..0000000 --- a/hosts/totsugeki/desktop/scripts/colorpicker.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs }: - -pkgs.writeShellApplication { - name = "colorpicker"; - runtimeInputs = with pkgs; [ dunst hyprpicker imagemagick wl-clipboard ]; - text = '' - COLOR=$(hyprpicker --no-fancy --autocopy) - convert -size 1x1 xc:"$COLOR" "$HOME/.cache/.tmp_colorpicker.jpg" - dunstify -i "$HOME/.cache/.tmp_colorpicker.jpg" "Color copiado" "$COLOR" - rm "$HOME/.cache/.tmp_colorpicker.jpg" - ''; -} diff --git a/hosts/totsugeki/desktop/scripts/currently-playing.nix b/hosts/totsugeki/desktop/scripts/currently-playing.nix deleted file mode 100644 index d3224bc..0000000 --- a/hosts/totsugeki/desktop/scripts/currently-playing.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ pkgs }: - -pkgs.writeShellApplication { - name = "get_fancy_currently_playing"; - runtimeInputs = [ pkgs.playerctl ]; - text = '' - STRING="" - case $(playerctl status 2> /dev/stdout) in - "Playing") - STRING+="⏵ " - ;; - "Paused") - STRING+="⏸ " - ;; - "No players found") - exit 1 - ;; - esac - ARTIST=$(playerctl metadata xesam:artist) - if [[ -n $ARTIST ]]; then - STRING+="$ARTIST // " - fi - TITLE=$(playerctl metadata xesam:title) - if [[ -n $TITLE ]]; then - STRING+="$TITLE" - fi - echo -e "$STRING" - ''; -} diff --git a/hosts/totsugeki/desktop/scripts/screenshot.nix b/hosts/totsugeki/desktop/scripts/screenshot.nix deleted file mode 100644 index 75ade5a..0000000 --- a/hosts/totsugeki/desktop/scripts/screenshot.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ pkgs }: - -pkgs.writeShellApplication { - name = "screenshot"; - runtimeInputs = with pkgs; [ - dunst - grim - libjxl - slurp - wl-clipboard - xdg-user-dirs - ]; - text = '' - usage() { - echo "Usage: screenshot { full | section }" - exit 1 - } - - test -n 1 || usage - - FILE_NAME=$(date +'Screenshot_%Y%m%d_%H%M%S') - TEMPORARY_PATH="/tmp/$FILE_NAME.png" - SCREENSHOT_PATH="$(xdg-user-dir PICTURES)/$FILE_NAME.jxl" - if [ "$1" == "full" ]; then - grim "$TEMPORARY_PATH" - elif [ "$1" == "section" ]; then - grim -g "$(slurp -b '#000000aa' -w 0)" "$TEMPORARY_PATH" - else - usage - fi - wl-copy < "$TEMPORARY_PATH" - cjxl "$TEMPORARY_PATH" "$SCREENSHOT_PATH" - dunstify --raw_icon="$TEMPORARY_PATH" "Captura de pantalla realizada" "Guardada como $FILE_NAME.jxl" - rm "$TEMPORARY_PATH" - ''; -} diff --git a/hosts/totsugeki/desktop/scripts_legacy/bin/now-playing.sh b/hosts/totsugeki/desktop/scripts_legacy/bin/now-playing.sh deleted file mode 100755 index 7ae75b1..0000000 --- a/hosts/totsugeki/desktop/scripts_legacy/bin/now-playing.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - -RPC_HOST=http://localhost:6680/mopidy/rpc -TRACK=$(curl -s -X POST -H Content-Type:application/json -d '{ "method": "core.playback.get_current_track", "jsonrpc": "2.0", "params": {}, "id": 1 }' $RPC_HOST) -TRACK_URI=$(echo $TRACK | jq -r '.result.uri') -IMAGES=$(curl -s -X POST -H Content-Type:application/json -d '{ "method": "core.library.get_images", "jsonrpc": "2.0", "params": { "uris": ["'"$TRACK_URI"'"] }, "id": 1}' $RPC_HOST) -IMAGE_URI=$(echo $IMAGES | jq -r 'first(.result[] | sort_by(.width) | reverse | .[].uri)') -if [[ -n "$IMAGE_URI" ]]; then - if [[ "$IMAGE_URI" == *"local/"* ]]; then - # Image is local - IMAGE="$HOME/.local/share/mopidy/local/images${IMAGE_URI/local\//}" - else - curl -o /tmp/cover.png $IMAGE_URI &> /dev/null - IMAGE="/tmp/cover.png" - fi -fi - -dunstify -r 99902 -I $IMAGE "Reproduciendo" "$(mpc --format '%artist% - %album%\n%title%' current 2> /dev/null)" diff --git a/hosts/totsugeki/desktop/scripts_legacy/bin/persistent-waybar.sh b/hosts/totsugeki/desktop/scripts_legacy/bin/persistent-waybar.sh deleted file mode 100755 index 6444703..0000000 --- a/hosts/totsugeki/desktop/scripts_legacy/bin/persistent-waybar.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env sh - -while true; do - waybar -done diff --git a/hosts/totsugeki/desktop/scripts_legacy/bin/play_to_soundboard.sh b/hosts/totsugeki/desktop/scripts_legacy/bin/play_to_soundboard.sh deleted file mode 100755 index 282cc8c..0000000 --- a/hosts/totsugeki/desktop/scripts_legacy/bin/play_to_soundboard.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -mpv --no-video --audio-device=pipewire/Soundboard --audio-client-name="Soundboard" $@ diff --git a/hosts/totsugeki/desktop/scripts_legacy/bin/setup_soundboard.sh b/hosts/totsugeki/desktop/scripts_legacy/bin/setup_soundboard.sh deleted file mode 100755 index 07d5b83..0000000 --- a/hosts/totsugeki/desktop/scripts_legacy/bin/setup_soundboard.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -pw-cli create-node adapter '{ factory.name=support.null-audio-sink node.name="Soundboard" node.description="Soundboard" media.class=Audio/Sink object.linger=true audio.position=[FL FR] }' -pw-link Soundboard:monitor_FL easyeffects_source:input_FL -pw-link Soundboard:monitor_FR easyeffects_source:input_FR -pw-link Soundboard:monitor_FL easyeffects_sink:playback_FL -pw-link Soundboard:monitor_FR easyeffects_sink:playback_FR diff --git a/hosts/totsugeki/desktop/scripts_legacy/bin/volumectl.sh b/hosts/totsugeki/desktop/scripts_legacy/bin/volumectl.sh deleted file mode 100755 index 3dc3f95..0000000 --- a/hosts/totsugeki/desktop/scripts_legacy/bin/volumectl.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/sh - -VOLUME_REGEX="^(-*|\+*)[0-9]+$" - -if [ "$1" == "output" ]; then - if [[ $2 =~ $VOLUME_REGEX ]]; then - if [ $(pamixer --get-mute) == "true" ]; then - pamixer --unmute > /dev/null - fi - if [ "${2:0:1}" == "-" ]; then - pamixer --allow-boost -d "${2:1}" > /dev/null - elif [ "${2:0:1}" == "+" ]; then - pamixer --allow-boost -i "${2:1}" > /dev/null - fi - volume="$(pamixer --get-volume-human)" - message=" $volume" - elif [ $2 == "toggle-mute" ]; then - if [ $(pamixer --get-mute) == "true" ]; then - pamixer --unmute > /dev/null - volume="$(pamixer --get-volume-human)" - message=" $volume" - else - pamixer --mute > /dev/null - message="󰖁 Silenciado" - fi - else - message="volumectl error: Unknown second argument" - fi -elif [ "$1" == "input" ]; then - if [[ $2 =~ $VOLUME_REGEX ]]; then - if [ $(pamixer --default-source --get-mute) == "true" ]; then - pamixer --default-source --unmute > /dev/null - fi - if [ "${2:0:1}" == "-" ];then - pamixer --default-source --allow-boost -d "${2:1}" > /dev/null - elif [ "${2:0:1}" == "+" ]; then - pamixer --default-source --allow-boost -i "${2:1}" > /dev/null - fi - volume="$(pamixer --default-source --get-volume-human)" - message=" $volume" - elif [ $2 == "toggle-mute" ]; then - if [ $(pamixer --default-source --get-mute) == "true" ]; then - pamixer --default-source --unmute > /dev/null - volume="$(pamixer --default-source --get-volume-human)" - message=" $volume" - else - pamixer --default-source --mute > /dev/null - message=" Silenciado" - fi - else - message="volumectl error: Unknown second argument" - fi -elif [ "$1" == "mpd" ]; then - if [[ $2 =~ $VOLUME_REGEX ]]; then - mpc volume $2 > /dev/null - icon="󰝚" - volume="$(perl -e "print ('$(mpc 2>/dev/null)' =~ /volume:[ ]*([0-9]*%)/);")" - if [ "$volume" == "0%" ]; then - icon="󰝛" - volume="Silenciado" - fi - message="$icon $volume" - else - message="volumectl error: Unknown second argument" - fi -else - message="volumectl error: Unknown first argument" -fi - -volume=$(echo $volume | tr -d "%") - -dunstify --appname "volumectl" --replace 9001 --urgency low --timeout 1250 --hints int:value:$volume "$message" diff --git a/hosts/totsugeki/desktop/waybar.nix b/hosts/totsugeki/desktop/waybar.nix deleted file mode 100644 index 32f3e64..0000000 --- a/hosts/totsugeki/desktop/waybar.nix +++ /dev/null @@ -1,197 +0,0 @@ -{ pkgs, ... }: { - programs.waybar = { - enable = true; - settings = { - primary = { - layer = "top"; - spacing = 0; - position = "bottom"; - mode = "dock"; - modules-left = [ - "clock" - "pulseaudio" - "cpu" - "temperature" - "custom/gpu" - "temperature#gpu" - "memory" - ]; - modules-center = [ "hyprland/workspaces" "hyprland/submap" ]; - modules-right = [ "mpris" ]; - "hyprland/workspaces" = { - format = "{icon}"; - format-icons = { - "1" = "󰈹 "; - "2" = " "; - "3" = " "; - "8" = " "; - "9" = " "; - "10" = " "; - default = " "; - }; - persistent-workspaces = { "*" = 10; }; - sort-by-number = true; - }; - "hyprland/submap" = { format = " {}"; }; - temperature = { - hwmon-path-abs = "/sys/devices/pci0000:00/0000:00:18.3/hwmon"; - input-filename = "temp1_input"; - }; - "temperature#gpu" = { - hwmon-path-abs = - "/sys/devices/pci0000:00/0000:00:03.1/0000:05:00.0/0000:06:00.0/0000:07:00.0/hwmon"; - input-filename = "temp1_input"; - }; - "custom/gpu" = { - exec = "cat /sys/class/drm/card*/device/gpu_busy_percent"; - format = "GPU {}%"; - restart-interval = 2; - }; - mpris = { - format = "{player_icon}{status_icon} {artist} // {title}"; - interval = 0.2; - player-icons = { - default = ""; - firefox = "󰈹 "; - }; - status-icons = { - paused = ""; - playing = ""; - }; - }; - clock = { - tooltip-format = "{calendar}"; - format = " {:%Y-%m-%d %H:%M:%S}"; - interval = 1; - calendar = { - mode = "year"; - mode-mon-col = 2; - weeks-pos = "right"; - on-scroll = 1; - on-click-right = "mode"; - format = { - days = "{}"; - today = "{}"; - weeks = ""; - weekdays = "{}"; - months = "{}"; - }; - }; - }; - cpu = { - format = "CPU {usage}%"; - tooltip = false; - interval = 2; - on-click = "kitty htop"; - }; - memory = { - format = "MEM {used}GB"; - interval = 1; - tooltip-format = "{percentage}%"; - }; - pulseaudio = { - scroll-step = 5; - format = "{icon} {volume}% {format_source}"; - format-muted = "󰖁 {format_source}"; - format-source = " {volume}%"; - format-source-muted = ""; - format-icons = { default = [ "" "" ]; }; - ignored-sinks = [ "Easy Effects Sink" ]; - }; - }; - }; - style = '' - * { - border: none; - background-color: transparent; - font-family: Iosevka Nerd Font; - font-weight: bold; - font-size: 14px; - } - - window#waybar { - background: rgba(30, 30, 46, 0.9); - color: #cdd6f4; - margin: 4px; - } - - tooltip { - background: #1e1e2e; - border: 2px solid #313244; - } - - #mpris { - color: #f5c2e7; - padding-right: 20px; - } - - #workspaces button { - padding: 1px; - color: #cdd6f4; - margin-right: 6px; - } - - #workspaces button.persistent { - color: #cdd6f4; - } - - #workspaces button.focused { - border: 0; - } - - #workspaces button.urgent { - color: #f38ba8; - } - - #workspaces button.empty { - color: #313244; - } - - #workspaces button.active { - color: #cba6f7; - } - - #submap { - color: #cba6f7; - margin-left: 4px; - padding: 0 8px; - } - - #cpu { - color: #f9e2af; - padding-right: 6px; - } - - #temperature { - color: #f9e2af; - padding-right: 12px; - } - - #custom-gpu { - color: #94e2d5; - padding-right: 6px; - } - - #temperature.gpu { - color: #94e2d5; - padding-right: 12px; - } - - #memory { - color: #a6e3a1; - padding-right: 12px; - } - - #pulseaudio { - color: #fab387; - padding-right: 12px; - } - - #clock { - color: #f38ba8; - padding-left: 20px; - padding-right: 12px; - } - ''; - }; -} diff --git a/hosts/totsugeki/home-manager/default.nix b/hosts/totsugeki/home-manager/default.nix new file mode 100644 index 0000000..af8a305 --- /dev/null +++ b/hosts/totsugeki/home-manager/default.nix @@ -0,0 +1 @@ +{ ... }: { imports = [ ./desktop ./development ./scripts ]; } diff --git a/hosts/totsugeki/home-manager/desktop/default.nix b/hosts/totsugeki/home-manager/desktop/default.nix new file mode 100644 index 0000000..a1344cd --- /dev/null +++ b/hosts/totsugeki/home-manager/desktop/default.nix @@ -0,0 +1,36 @@ +{ config, pkgs, ... }: { + imports = [ ./plasma ./firefox.nix ./gtk.nix ./kitty.nix ]; + home = { + packages = with pkgs; [ + gimp + fastfetch + inkscape + libreoffice-qt + obs-studio + picard + protonup-qt + kdePackages.ark + kdePackages.dolphin + kdePackages.dolphin-plugins + kdePackages.kio + kdePackages.kio-extras + kdePackages.kimageformats + kdePackages.qtimageformats + kdePackages.sddm-kcm + mpv + noto-fonts-cjk-sans + nsxiv + osu-lazer-bin + playerctl + prismlauncher + qbittorrent + r2modman + wl-clipboard + element-desktop + vesktop + ]; + }; + nixpkgs.config.allowUnfree = true; + services.easyeffects.enable = true; + xdg.enable = true; +} diff --git a/hosts/totsugeki/desktop/firefox.nix b/hosts/totsugeki/home-manager/desktop/firefox.nix similarity index 100% rename from hosts/totsugeki/desktop/firefox.nix rename to hosts/totsugeki/home-manager/desktop/firefox.nix diff --git a/hosts/totsugeki/desktop/gtk.nix b/hosts/totsugeki/home-manager/desktop/gtk.nix similarity index 100% rename from hosts/totsugeki/desktop/gtk.nix rename to hosts/totsugeki/home-manager/desktop/gtk.nix diff --git a/hosts/totsugeki/desktop/kitty.nix b/hosts/totsugeki/home-manager/desktop/kitty.nix similarity index 98% rename from hosts/totsugeki/desktop/kitty.nix rename to hosts/totsugeki/home-manager/desktop/kitty.nix index 0a6beb9..8116ee4 100644 --- a/hosts/totsugeki/desktop/kitty.nix +++ b/hosts/totsugeki/home-manager/desktop/kitty.nix @@ -3,7 +3,7 @@ enable = true; font = { name = "Iosevka Nerd Font"; - size = 14; + size = 12; }; keybindings = { "ctrl+alt+1" = "goto_tab 1"; diff --git a/hosts/totsugeki/home-manager/desktop/plasma/default.nix b/hosts/totsugeki/home-manager/desktop/plasma/default.nix new file mode 100644 index 0000000..0e94e2a --- /dev/null +++ b/hosts/totsugeki/home-manager/desktop/plasma/default.nix @@ -0,0 +1,16 @@ +{ ... }: { + imports = [ ./input.nix ./hotkeys.nix ./krohnkite.nix ./theme.nix ]; + programs.plasma = { + enable = true; + overrideConfig = true; + workspace.clickItemTo = "open"; + kwin = { + virtualDesktops = { + rows = 1; + number = 10; + }; + effects.desktopSwitching.animation = "slide"; + }; + configFile = { "kded5rc" = { Module-gtkconfig.autoload = false; }; }; + }; +} diff --git a/hosts/totsugeki/home-manager/desktop/plasma/hotkeys.nix b/hosts/totsugeki/home-manager/desktop/plasma/hotkeys.nix new file mode 100644 index 0000000..ab82e4d --- /dev/null +++ b/hosts/totsugeki/home-manager/desktop/plasma/hotkeys.nix @@ -0,0 +1,27 @@ +{ ... }: { + programs.plasma.shortcuts = { + kwin = { + "Switch to Desktop 1" = "Meta+1"; + "Window to Desktop 1" = "Meta+!"; + "Switch to Desktop 2" = "Meta+2"; + "Window to Desktop 2" = ''Meta+"''; + "Switch to Desktop 3" = "Meta+3"; + "Window to Desktop 3" = "Meta+·"; + "Switch to Desktop 4" = "Meta+4"; + "Window to Desktop 4" = "Meta+$"; + "Switch to Desktop 5" = "Meta+5"; + "Window to Desktop 5" = "Meta+%"; + "Switch to Desktop 6" = "Meta+6"; + "Window to Desktop 6" = "Meta+&"; + "Switch to Desktop 7" = "Meta+7"; + "Window to Desktop 7" = "Meta+/"; + "Switch to Desktop 8" = "Meta+8"; + "Window to Desktop 8" = "Meta+("; + "Switch to Desktop 9" = "Meta+9"; + "Window to Desktop 9" = "Meta+)"; + "Switch to Desktop 10" = "Meta+0"; + "Window to Desktop 10" = "Meta+="; + }; + "services/kitty.desktop"."_launch" = "Ctrl+Alt+T"; + }; +} diff --git a/hosts/totsugeki/home-manager/desktop/plasma/input.nix b/hosts/totsugeki/home-manager/desktop/plasma/input.nix new file mode 100644 index 0000000..5debf3c --- /dev/null +++ b/hosts/totsugeki/home-manager/desktop/plasma/input.nix @@ -0,0 +1,15 @@ +{ ... }: { + programs.plasma.configFile = { + kcminputrc."Libinput/9610/54/Glorious Model O" = { + PointerAcceleration = -0.4; + PointerAccelerationProfile = 1; + }; + kxkbrc.Layout = { + LayoutList = "es"; + Use = true; + VariantList = "dvorak"; + Options = "caps:menu"; + ResetOldOptions = true; + }; + }; +} diff --git a/hosts/totsugeki/home-manager/desktop/plasma/krohnkite.nix b/hosts/totsugeki/home-manager/desktop/plasma/krohnkite.nix new file mode 100644 index 0000000..b6930be --- /dev/null +++ b/hosts/totsugeki/home-manager/desktop/plasma/krohnkite.nix @@ -0,0 +1,23 @@ +# TODO: find a way to automatically install krohnkite +{ ... }: { + programs.plasma.configFile.kwinrc = { + Plugins.krohnkiteEnabled = true; + Script-krohnkite = { + enableMonocleLayout = false; + enableSpreadLayout = false; + enableStairLayout = false; + enableThreeColumnLayout = false; + enableTileLayout = false; + ignoreClass = "krunner,yakuake,spectacle,kded5,plasmashell"; + layoutPerActivity = false; + layoutPerDesktop = false; + limitTileWidthRatio = 0.6; + noTileBorder = true; + screenGapBottom = 20; + screenGapLeft = 8; + screenGapRight = 8; + screenGapTop = 8; + tileLayoutGap = 2; + }; + }; +} diff --git a/hosts/totsugeki/home-manager/desktop/plasma/theme.nix b/hosts/totsugeki/home-manager/desktop/plasma/theme.nix new file mode 100644 index 0000000..8262acd --- /dev/null +++ b/hosts/totsugeki/home-manager/desktop/plasma/theme.nix @@ -0,0 +1,59 @@ +{ pkgs, ... }: +let cursorThemeName = "catppuccin-mocha-mauve-cursors"; +in { + home = { + packages = with pkgs; [ + (catppuccin-kde.override { + flavour = [ "mocha" ]; + accents = [ "mauve" ]; + }) + catppuccin-cursors.mochaMauve + ]; + pointerCursor = { + gtk.enable = true; + package = pkgs.catppuccin-cursors.mochaMauve; + name = cursorThemeName; + size = 32; + }; + }; + programs.plasma = { + fonts = { + general = { + family = "Inter Display"; + pointSize = 11; + weight = "medium"; + }; + fixedWidth = { + family = "Iosevka Nerd Font"; + pointSize = 12; + }; + small = { + family = "Inter Display"; + pointSize = 8; + }; + toolbar = { + family = "Inter Display"; + pointSize = 11; + weight = "medium"; + }; + menu = { + family = "Inter Display"; + pointSize = 11; + weight = "medium"; + }; + windowTitle = { + family = "Inter Display"; + pointSize = 11; + weight = "medium"; + }; + }; + workspace = { + colorScheme = "CatppuccinMochaMauve"; + lookAndFeel = "Catppuccin-Mocha-Mauve"; + cursor = { + theme = cursorThemeName; + size = 32; + }; + }; + }; +} diff --git a/hosts/totsugeki/development/default.nix b/hosts/totsugeki/home-manager/development/default.nix similarity index 96% rename from hosts/totsugeki/development/default.nix rename to hosts/totsugeki/home-manager/development/default.nix index 09c92e4..42a8ba4 100644 --- a/hosts/totsugeki/development/default.nix +++ b/hosts/totsugeki/home-manager/development/default.nix @@ -5,7 +5,8 @@ git-credential-manager gnupg pass - dotnet-sdk_7 + # dotnet-sdk_7 + dotnet-sdk_8 # tModLoader unityhub ]; }; diff --git a/hosts/totsugeki/development/nixvim/completion.nix b/hosts/totsugeki/home-manager/development/nixvim/completion.nix similarity index 100% rename from hosts/totsugeki/development/nixvim/completion.nix rename to hosts/totsugeki/home-manager/development/nixvim/completion.nix diff --git a/hosts/totsugeki/development/nixvim/default.nix b/hosts/totsugeki/home-manager/development/nixvim/default.nix similarity index 100% rename from hosts/totsugeki/development/nixvim/default.nix rename to hosts/totsugeki/home-manager/development/nixvim/default.nix diff --git a/hosts/totsugeki/development/nixvim/lsp.nix b/hosts/totsugeki/home-manager/development/nixvim/lsp.nix similarity index 100% rename from hosts/totsugeki/development/nixvim/lsp.nix rename to hosts/totsugeki/home-manager/development/nixvim/lsp.nix diff --git a/hosts/totsugeki/development/nixvim/lualine.nix b/hosts/totsugeki/home-manager/development/nixvim/lualine.nix similarity index 100% rename from hosts/totsugeki/development/nixvim/lualine.nix rename to hosts/totsugeki/home-manager/development/nixvim/lualine.nix diff --git a/hosts/totsugeki/development/nixvim/neo-tree.nix b/hosts/totsugeki/home-manager/development/nixvim/neo-tree.nix similarity index 100% rename from hosts/totsugeki/development/nixvim/neo-tree.nix rename to hosts/totsugeki/home-manager/development/nixvim/neo-tree.nix diff --git a/hosts/totsugeki/development/nixvim/none-ls.nix b/hosts/totsugeki/home-manager/development/nixvim/none-ls.nix similarity index 100% rename from hosts/totsugeki/development/nixvim/none-ls.nix rename to hosts/totsugeki/home-manager/development/nixvim/none-ls.nix diff --git a/hosts/totsugeki/development/nixvim/treesitter.nix b/hosts/totsugeki/home-manager/development/nixvim/treesitter.nix similarity index 100% rename from hosts/totsugeki/development/nixvim/treesitter.nix rename to hosts/totsugeki/home-manager/development/nixvim/treesitter.nix diff --git a/hosts/totsugeki/home-manager/scripts/default.nix b/hosts/totsugeki/home-manager/scripts/default.nix new file mode 100644 index 0000000..82e8246 --- /dev/null +++ b/hosts/totsugeki/home-manager/scripts/default.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: { + home.packages = with pkgs; [ + (import ./play-on-soundboard.nix { inherit pkgs; }) + (import ./setup-soundboard.nix { inherit pkgs; }) + ]; +} diff --git a/hosts/totsugeki/home-manager/scripts/play-on-soundboard.nix b/hosts/totsugeki/home-manager/scripts/play-on-soundboard.nix new file mode 100644 index 0000000..c4ed3ba --- /dev/null +++ b/hosts/totsugeki/home-manager/scripts/play-on-soundboard.nix @@ -0,0 +1,16 @@ +{ pkgs }: + +pkgs.writeShellApplication { + name = "play-on-soundboard"; + runtimeInputs = with pkgs; [ mpv ]; + text = '' + if [ ! -f "/run/user/$UID/soundboard.init" ]; then + setup-soundboard + fi + mpv \ + --no-video\ + --audio-device=pipewire/Soundboard\ + --audio-client-name="Soundboard"\ + "$@" + ''; +} diff --git a/hosts/totsugeki/home-manager/scripts/setup-soundboard.nix b/hosts/totsugeki/home-manager/scripts/setup-soundboard.nix new file mode 100644 index 0000000..90dccc0 --- /dev/null +++ b/hosts/totsugeki/home-manager/scripts/setup-soundboard.nix @@ -0,0 +1,13 @@ +{ pkgs }: + +pkgs.writeShellApplication { + name = "setup-soundboard"; + text = '' + touch "/run/user/$UID/soundboard.init" + pw-cli create-node adapter '{ factory.name=support.null-audio-sink node.name="Soundboard" node.description="Soundboard" media.class=Audio/Sink object.linger=true audio.position=[FL FR] }' + pw-link Soundboard:monitor_FL easyeffects_source:input_FL + pw-link Soundboard:monitor_FR easyeffects_source:input_FR + pw-link Soundboard:monitor_FL easyeffects_sink:playback_FL + pw-link Soundboard:monitor_FR easyeffects_sink:playback_FR + ''; +} diff --git a/hosts/totsugeki/nixos.nix b/hosts/totsugeki/nixos/default.nix similarity index 62% rename from hosts/totsugeki/nixos.nix rename to hosts/totsugeki/nixos/default.nix index 5d75913..a916f91 100644 --- a/hosts/totsugeki/nixos.nix +++ b/hosts/totsugeki/nixos/default.nix @@ -1,4 +1,7 @@ { config, lib, pkgs, ... }: { + + imports = [ ./filesystems.nix ./plasma.nix ./steam.nix ]; + boot = { kernelModules = [ "kvm-amd" ]; kernelPackages = pkgs.linuxKernel.packages.linux_zen; @@ -18,35 +21,10 @@ }; }; - fileSystems = { - "/" = { - device = "/dev/disk/by-uuid/144857c7-877b-46c7-94d9-30a6d6d27cf0"; - fsType = "btrfs"; - options = [ "compress=zstd:15" ]; - }; - - "/boot" = { - device = "/dev/disk/by-uuid/8084-F762"; - fsType = "vfat"; - }; - - "/home" = { - device = "/dev/disk/by-uuid/4bbd6139-7caa-4617-a94f-b185c5f6ca45"; - fsType = "btrfs"; - options = [ "compress=zstd:15" ]; - }; - - "/mnt/Datos" = { - device = "/dev/disk/by-uuid/994ef2bd-a9fb-4414-9a0a-19b150ffa452"; - fsType = "btrfs"; - options = [ "compress=zstd:15" "user" "x-systemd.automount" "exec" ]; - }; - }; - networking = { firewall = { enable = true; - allowedTCPPorts = [ 1111 42595 ]; + allowedTCPPorts = [ 8000 42595 ]; allowedUDPPorts = [ 24642 ]; }; hostName = "totsugeki"; @@ -79,25 +57,19 @@ }; programs = { - hyprland.enable = true; - steam.enable = true; + corectrl = { + enable = true; + gpuOverclock.enable = true; + }; + nix-ld.enable = true; }; - xdg.portal = { - enable = true; - extraPortals = with pkgs; [ xdg-desktop-portal-gtk ]; - }; + xdg.portal.enable = true; services = { - greetd = { + jellyfin = { enable = true; - settings = rec { - initial_session = { - command = "${pkgs.hyprland}/bin/Hyprland"; - user = "avery"; - }; - default_session = initial_session; - }; + openFirewall = true; }; pipewire = { enable = true; @@ -108,6 +80,16 @@ pulse.enable = true; }; udisks2.enable = true; + udev.extraRules = '' + SUBSYSTEM=="usb", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="3000", MODE="0666" + ''; + displayManager = { + defaultSession = "plasma"; + sddm = { + enable = true; + wayland.enable = true; + }; + }; }; systemd = { services = { NetworkManager-wait-online.enable = false; }; }; @@ -117,4 +99,6 @@ }; system.stateVersion = "24.05"; + + users.users.avery.extraGroups = [ "corectrl" ]; } diff --git a/hosts/totsugeki/nixos/filesystems.nix b/hosts/totsugeki/nixos/filesystems.nix new file mode 100644 index 0000000..1d54be4 --- /dev/null +++ b/hosts/totsugeki/nixos/filesystems.nix @@ -0,0 +1,26 @@ +{ ... }: { + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/144857c7-877b-46c7-94d9-30a6d6d27cf0"; + fsType = "btrfs"; + options = [ "compress=zstd:15" ]; + }; + + "/boot" = { + device = "/dev/disk/by-uuid/8084-F762"; + fsType = "vfat"; + }; + + "/home" = { + device = "/dev/disk/by-uuid/4bbd6139-7caa-4617-a94f-b185c5f6ca45"; + fsType = "btrfs"; + options = [ "compress=zstd:15" ]; + }; + + "/mnt/Datos" = { + device = "/dev/disk/by-uuid/994ef2bd-a9fb-4414-9a0a-19b150ffa452"; + fsType = "btrfs"; + options = [ "compress=zstd:15" "user" "x-systemd.automount" "exec" ]; + }; + }; +} diff --git a/hosts/totsugeki/nixos/plasma.nix b/hosts/totsugeki/nixos/plasma.nix new file mode 100644 index 0000000..d4026df --- /dev/null +++ b/hosts/totsugeki/nixos/plasma.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: { + services.desktopManager.plasma6.enable = true; + environment.plasma6.excludePackages = with pkgs.kdePackages; [ + konsole + oxygen + elisa + kate + okular + ]; +} diff --git a/hosts/totsugeki/nixos/steam.nix b/hosts/totsugeki/nixos/steam.nix new file mode 100644 index 0000000..bc13418 --- /dev/null +++ b/hosts/totsugeki/nixos/steam.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: { + programs.steam = { + enable = true; + remotePlay.openFirewall = true; + gamescopeSession.enable = true; + }; +}