From c6a0a4f631dc521bf50b4bf9cbc29dd5170a59c7 Mon Sep 17 00:00:00 2001 From: Tyler Beckman Date: Sat, 21 Dec 2024 11:15:14 -0700 Subject: [PATCH] I did some more stuff --- flake.lock | 219 +++++++++++++++--- flake.nix | 30 ++- home-manager/config/accounts/default.nix | 4 +- home-manager/config/default.nix | 3 + home-manager/config/firefox.nix | 4 +- home-manager/config/flatpak.nix | 15 ++ home-manager/config/gpg.nix | 6 +- home-manager/config/packages.nix | 22 +- home-manager/config/prismlauncher.nix | 6 + home-manager/config/vscode.nix | 1 + home-manager/config/zed.nix | 79 +++++++ home-manager/default.nix | 1 + home-manager/modules/default.nix | 1 + home-manager/modules/prismlauncher.nix | 82 +++++++ hosts/laptop-server/config/default.nix | 1 + hosts/laptop-server/config/mounts.nix | 15 ++ hosts/laptop-server/config/networking.nix | 7 +- .../laptop-server/config/services/default.nix | 2 - .../config/services/jellyfin.nix | 13 +- hosts/laptop/config/fonts.nix | 2 + hosts/laptop/config/nvidia.nix | 2 +- hosts/laptop/config/packages.nix | 10 + hosts/laptop/default.nix | 6 +- nix-on-droid/ty-pixel/default.nix | 15 ++ 24 files changed, 488 insertions(+), 58 deletions(-) create mode 100644 home-manager/config/flatpak.nix create mode 100644 home-manager/config/prismlauncher.nix create mode 100644 home-manager/config/zed.nix create mode 100644 home-manager/modules/prismlauncher.nix create mode 100644 hosts/laptop-server/config/mounts.nix create mode 100644 nix-on-droid/ty-pixel/default.nix diff --git a/flake.lock b/flake.lock index 09bdbb2..c351d72 100755 --- a/flake.lock +++ b/flake.lock @@ -47,11 +47,11 @@ }, "locked": { "dir": "/pkgs/firefox-addons", - "lastModified": 1734235408, - "narHash": "sha256-0yHVZ2+VaW36/RTGHm1x3p+KS1oAWIj+TWObLDUzHfQ=", + "lastModified": 1734648163, + "narHash": "sha256-AK7nqONfzyxUzqVVeRoniO6NRv4SaxPrXwuyY8jtCXs=", "owner": "rycee", "repo": "nur-expressions", - "rev": "02261a5dd442b8c6eb778c31e7967e734bc2ff76", + "rev": "2b5a7eb2719b146f6308dfa51c9a1c4b03d965a3", "type": "gitlab" }, "original": { @@ -72,11 +72,11 @@ ] }, "locked": { - "lastModified": 1734312000, - "narHash": "sha256-cBvZ26RH0rFT6i2Vtv//nUrWqjJ9+0JstMiVE3KJFbQ=", + "lastModified": 1734743419, + "narHash": "sha256-MAl+QDhPVXypYKjLZ6WU5JLY8VjGt4lecdmwCkBwMN8=", "owner": "nix-community", "repo": "flake-firefox-nightly", - "rev": "af7b83dc9687ca992bcad8c9b74485964e25c5a9", + "rev": "dfb2631ee449ba3df206cb8f1d9558f242851e0b", "type": "github" }, "original": { @@ -182,7 +182,7 @@ }, "flake-utils_4": { "inputs": { - "systems": "systems_2" + "systems": "systems_3" }, "locked": { "lastModified": 1710146030, @@ -200,7 +200,7 @@ }, "flake-utils_5": { "inputs": { - "systems": "systems_3" + "systems": "systems_4" }, "locked": { "lastModified": 1681202837, @@ -216,6 +216,30 @@ "type": "github" } }, + "flatpaks": { + "inputs": { + "home-manager": [ + "home-manager" + ], + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems_2" + }, + "locked": { + "lastModified": 1733581530, + "narHash": "sha256-W+orHmF+XpZosrBFAFRs7sS1iVKYveg9SutkzSXMVsI=", + "owner": "GermanBread", + "repo": "declarative-flatpak", + "rev": "b88bd5b65f8e7c35eec0a90cfd6e096b2e7f79c0", + "type": "github" + }, + "original": { + "owner": "GermanBread", + "repo": "declarative-flatpak", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -223,11 +247,11 @@ ] }, "locked": { - "lastModified": 1734093295, - "narHash": "sha256-hSwgGpcZtdDsk1dnzA0xj5cNaHgN9A99hRF/mxMtwS4=", + "lastModified": 1734622215, + "narHash": "sha256-OOfI0XhSJGHblfdNDhfnn8QnZxng63rWk9eeJ2tCbiI=", "owner": "nix-community", "repo": "home-manager", - "rev": "66c5d8b62818ec4c1edb3e941f55ef78df8141a8", + "rev": "1395379a7a36e40f2a76e7b9936cc52950baa1be", "type": "github" }, "original": { @@ -272,6 +296,32 @@ "type": "github" } }, + "nix-formatter-pack": { + "inputs": { + "nixpkgs": [ + "nix-on-droid", + "nixpkgs" + ], + "nmd": [ + "nix-on-droid", + "nmd" + ], + "nmt": "nmt" + }, + "locked": { + "lastModified": 1705252799, + "narHash": "sha256-HgSTREh7VoXjGgNDwKQUYcYo13rPkltW7IitHrTPA5c=", + "owner": "Gerschtli", + "repo": "nix-formatter-pack", + "rev": "2de39dedd79aab14c01b9e2934842051a160ffa5", + "type": "github" + }, + "original": { + "owner": "Gerschtli", + "repo": "nix-formatter-pack", + "type": "github" + } + }, "nix-github-actions": { "inputs": { "nixpkgs": [ @@ -313,6 +363,33 @@ "type": "github" } }, + "nix-on-droid": { + "inputs": { + "home-manager": [ + "home-manager" + ], + "nix-formatter-pack": "nix-formatter-pack", + "nixpkgs": [ + "nixpkgs" + ], + "nixpkgs-docs": "nixpkgs-docs", + "nixpkgs-for-bootstrap": "nixpkgs-for-bootstrap", + "nmd": "nmd" + }, + "locked": { + "lastModified": 1725658585, + "narHash": "sha256-P29z4Gt89n5ps1U7+qmIrj0BuRXGZQSIaOe2+tsPgfw=", + "owner": "nix-community", + "repo": "nix-on-droid", + "rev": "5d88ff2519e4952f8d22472b52c531bb5f1635fc", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-on-droid", + "type": "github" + } + }, "nixos-grub-themes": { "inputs": { "nixpkgs": [ @@ -349,22 +426,38 @@ "type": "github" } }, - "nixpkgs-24-11": { + "nixpkgs-docs": { "locked": { - "lastModified": 1734083684, - "narHash": "sha256-5fNndbndxSx5d+C/D0p/VF32xDiJCJzyOqorOYW4JEo=", + "lastModified": 1705957679, + "narHash": "sha256-Q8LJaVZGJ9wo33wBafvZSzapYsjOaNjP/pOnSiKVGHY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "314e12ba369ccdb9b352a4db26ff419f7c49fa84", + "rev": "9a333eaa80901efe01df07eade2c16d183761fa3", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-24.11", + "ref": "release-23.05", "repo": "nixpkgs", "type": "github" } }, + "nixpkgs-for-bootstrap": { + "locked": { + "lastModified": 1720244366, + "narHash": "sha256-WrDV0FPMVd2Sq9hkR5LNHudS3OSMmUrs90JUTN+MXpA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "49ee0e94463abada1de470c9c07bfc12b36dcf40", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "49ee0e94463abada1de470c9c07bfc12b36dcf40", + "type": "github" + } + }, "nixpkgs-lib": { "locked": { "lastModified": 1734224914, @@ -382,11 +475,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1734119587, - "narHash": "sha256-AKU6qqskl0yf2+JdRdD0cfxX4b9x3KKV5RqA6wijmPM=", + "lastModified": 1734424634, + "narHash": "sha256-cHar1vqHOOyC7f1+tVycPoWTfKIaqkoe1Q6TnKzuti4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3566ab7246670a43abd2ffa913cc62dad9cdf7d5", + "rev": "d3c42f187194c26d9f0309a8ecc469d6c878ce33", "type": "github" }, "original": { @@ -396,18 +489,42 @@ "type": "github" } }, - "nixpkgs_3": { + "nmd": { + "inputs": { + "nixpkgs": [ + "nix-on-droid", + "nixpkgs-docs" + ], + "scss-reset": "scss-reset" + }, "locked": { - "lastModified": 1682134069, - "narHash": "sha256-TnI/ZXSmRxQDt2sjRYK/8j8iha4B4zP2cnQCZZ3vp7k=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "fd901ef4bf93499374c5af385b2943f5801c0833", - "type": "github" + "lastModified": 1705050560, + "narHash": "sha256-x3zzcdvhJpodsmdjqB4t5mkVW22V3wqHLOun0KRBzUI=", + "owner": "~rycee", + "repo": "nmd", + "rev": "66d9334933119c36f91a78d565c152a4fdc8d3d3", + "type": "sourcehut" }, "original": { - "id": "nixpkgs", - "type": "indirect" + "owner": "~rycee", + "repo": "nmd", + "type": "sourcehut" + } + }, + "nmt": { + "flake": false, + "locked": { + "lastModified": 1648075362, + "narHash": "sha256-u36WgzoA84dMVsGXzml4wZ5ckGgfnvS0ryzo/3zn/Pc=", + "owner": "rycee", + "repo": "nmt", + "rev": "d83601002c99b78c89ea80e5e6ba21addcfe12ae", + "type": "gitlab" + }, + "original": { + "owner": "rycee", + "repo": "nmt", + "type": "gitlab" } }, "plasma-manager": { @@ -438,17 +555,34 @@ "colmena": "colmena", "firefox-addons": "firefox-addons", "firefox-nightly": "firefox-nightly", + "flatpaks": "flatpaks", "home-manager": "home-manager", "nix-index-database": "nix-index-database", + "nix-on-droid": "nix-on-droid", "nixos-grub-themes": "nixos-grub-themes", "nixpkgs": "nixpkgs_2", - "nixpkgs-24-11": "nixpkgs-24-11", "plasma-manager": "plasma-manager", "sddm-sugar-candy-nix": "sddm-sugar-candy-nix", "vscode-extensions": "vscode-extensions", "vscode-server": "vscode-server" } }, + "scss-reset": { + "flake": false, + "locked": { + "lastModified": 1631450058, + "narHash": "sha256-muDlZJPtXDIGevSEWkicPP0HQ6VtucbkMNygpGlBEUM=", + "owner": "andreymatin", + "repo": "scss-reset", + "rev": "0cf50e27a4e95e9bb5b1715eedf9c54dee1a5a91", + "type": "github" + }, + "original": { + "owner": "andreymatin", + "repo": "scss-reset", + "type": "github" + } + }, "sddm-sugar-candy-nix": { "inputs": { "nixpkgs": [ @@ -501,6 +635,21 @@ } }, "systems_2": { + "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_3": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -515,7 +664,7 @@ "type": "github" } }, - "systems_3": { + "systems_4": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -539,11 +688,11 @@ ] }, "locked": { - "lastModified": 1734314392, - "narHash": "sha256-EydUadS7omV3SO/4TLeMkLT2JUugvPEtvBoAF43ggWU=", + "lastModified": 1734659394, + "narHash": "sha256-rI7fcI4+J+iAiCvQ0J3hECJJGD9cAVTAFRTj1xrX6Qo=", "owner": "nix-community", "repo": "nix-vscode-extensions", - "rev": "4ef033412f0732794077fcc25af4f79f097ad1e1", + "rev": "1792f1bbfccbd5ebcb745250e4fc57067c6dfd9c", "type": "github" }, "original": { @@ -555,7 +704,9 @@ "vscode-server": { "inputs": { "flake-utils": "flake-utils_5", - "nixpkgs": "nixpkgs_3" + "nixpkgs": [ + "nixpkgs" + ] }, "locked": { "lastModified": 1729422940, diff --git a/flake.nix b/flake.nix index ba201e5..1d2afab 100755 --- a/flake.nix +++ b/flake.nix @@ -4,7 +4,6 @@ inputs = { # General NixOS config nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - nixpkgs-24-11.url = "github:NixOS/nixpkgs/nixos-24.11"; # Colmena unstable colmena = { url = "github:zhaofengli/colmena"; @@ -45,7 +44,7 @@ owner = "rycee"; repo = "nur-expressions"; dir = "/pkgs/firefox-addons"; - + inputs.nixpkgs.follows = "nixpkgs"; }; # VSCode extensions @@ -54,10 +53,27 @@ inputs.nixpkgs.follows = "nixpkgs"; }; # VSCode server support - vscode-server.url = "github:nix-community/nixos-vscode-server"; + vscode-server = { + url = "github:nix-community/nixos-vscode-server"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + # Flatpak support + flatpaks = { + url = "github:GermanBread/declarative-flatpak"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.home-manager.follows = "home-manager"; + }; + # Nix-on-droid support + nix-on-droid = { + url = "github:nix-community/nix-on-droid"; + inputs = { + nixpkgs.follows = "nixpkgs"; + home-manager.follows = "home-manager"; + }; + }; }; - outputs = inputs@{ self, colmena, ... }: let + outputs = inputs@{ self, nixpkgs, colmena, nix-on-droid, ... }: let utils = import ./utils { inherit inputs; secrets = import ./secrets.nix; @@ -85,6 +101,12 @@ ]; }; + # Setup nix-on-droid configurations + nixOnDroidConfigurations.default = nix-on-droid.lib.nixOnDroidConfiguration { + pkgs = import nixpkgs { system = "aarch64-linux"; }; + modules = [ ./nix-on-droid/ty-pixel ]; + }; + # Enable direct flake support for colmena colmenaHive = colmena.lib.makeHive self.outputs.colmena; }; diff --git a/home-manager/config/accounts/default.nix b/home-manager/config/accounts/default.nix index 60bd125..83eda80 100755 --- a/home-manager/config/accounts/default.nix +++ b/home-manager/config/accounts/default.nix @@ -1,7 +1,7 @@ -{ lib, config, ... }: +{ ... }: { imports = [ ./email.nix ./ssh.nix ]; -} \ No newline at end of file +} diff --git a/home-manager/config/default.nix b/home-manager/config/default.nix index d252ab8..78b1b88 100644 --- a/home-manager/config/default.nix +++ b/home-manager/config/default.nix @@ -8,13 +8,16 @@ # Individual files ./beets.nix ./desktop.nix + ./flatpak.nix ./firefox.nix ./gpg.nix ./gtk.nix ./packages.nix ./plasma.nix + ./prismlauncher.nix ./rescrobbled.nix ./thunderbird.nix ./vscode.nix + ./zed.nix ]; } \ No newline at end of file diff --git a/home-manager/config/firefox.nix b/home-manager/config/firefox.nix index 569b8d6..beb9624 100755 --- a/home-manager/config/firefox.nix +++ b/home-manager/config/firefox.nix @@ -160,8 +160,8 @@ }; # NixOS Wiki Search "NixOS Wiki" = { - urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}"; }]; - iconUpdateURL = "https://nixos.wiki/favicon.png"; + urls = [{ template = "https://wiki.nixos.org/w/index.php?search={searchTerms}"; }]; + iconUpdateURL = "https://wiki.nixos.org/nixos.png"; updateInterval = 24 * 60 * 60 * 1000; # every day definedAliases = [ "@nw" ]; }; diff --git a/home-manager/config/flatpak.nix b/home-manager/config/flatpak.nix new file mode 100644 index 0000000..cd96fbf --- /dev/null +++ b/home-manager/config/flatpak.nix @@ -0,0 +1,15 @@ +{ lib, config, ... }: +{ + xdg.systemDirs.data = lib.optionals + config.meta.home-manager.desktop.enable + [ "/var/lib/flatpak/exports/share" "${config.xdg.dataHome}/flatpak/exports/share" ]; + services.flatpak = lib.mkIf config.meta.home-manager.desktop.enable { + enableModule = true; + packages = [ + "sober:app/org.vinegarhq.Sober/x86_64/master" + ]; + remotes = { + sober = "https://sober.vinegarhq.org/sober.flatpakref"; + }; + }; +} diff --git a/home-manager/config/gpg.nix b/home-manager/config/gpg.nix index b965178..a9ca0b7 100755 --- a/home-manager/config/gpg.nix +++ b/home-manager/config/gpg.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, config, ... }: { programs.gpg = { enable = true; @@ -56,9 +56,9 @@ enable = true; enableSshSupport = true; enableZshIntegration = true; - pinentryPackage = pkgs.pinentry-qt; + pinentryPackage = if (config.meta.home-manager.desktop.enable) then pkgs.pinentry-qt else pkgs.pinentry-tty; sshKeys = [ "817A829FB1FB95441156F93C7F4FD04ACDDE5E48 0" ]; }; -} \ No newline at end of file +} diff --git a/home-manager/config/packages.nix b/home-manager/config/packages.nix index 9a1a0b4..aba8054 100755 --- a/home-manager/config/packages.nix +++ b/home-manager/config/packages.nix @@ -1,6 +1,6 @@ { pkgs, inputs, system, lib, config, ... }: { - home.packages = + home.packages = ## Packages that are always installed, no matter what (with pkgs; [ # :3 @@ -19,9 +19,12 @@ pciutils # `lspci` unzip # Extract zip files + # Editor + neovim # CLI-Based editor + # Process tools btop # Process monitor - nvtopPackages.full # GPU monitor + hyperfine # CLI Benchmarker ]) ## Packages that are only installed when a desktop environment is desired ++ (lib.optionals config.meta.home-manager.desktop.enable (with pkgs; [ @@ -47,6 +50,7 @@ # Programming jetbrains.idea-ultimate # Jetbrains IntelliJ Idea Ultimate IDE + jetbrains.rust-rover # Jetbrains Rust IDE nixd # LSP for .nix files gcc # GNU C++ Compiler (lib.meta.hiPrio clang) # LLVM C++ Compiler (better than g++) @@ -54,9 +58,23 @@ cling # C++ REPL deno # Typescript & Javascript runtime gnumake # Makefile support + httptoolkit # HTTP Interception + android-tools # ADB and the such + beekeeper-studio # SQL Database viewer + + # Games + (heroic.override { + extraPkgs = pkgs: [ + pkgs.gamemode + pkgs.gamescope + ]; + }) # GOG & Epic Games Launcher # UI Tools qalculate-qt # Calculator + + # Process tools cont. + nvtopPackages.full # GPU Monitor, only really necessary if we have a GPU to look at ])) ## Packages that are only installed if plasma is used as the desktop environment ++ (lib.optionals config.meta.home-manager.desktop.plasma.enable (with pkgs.kdePackages; [ diff --git a/home-manager/config/prismlauncher.nix b/home-manager/config/prismlauncher.nix new file mode 100644 index 0000000..ee769fe --- /dev/null +++ b/home-manager/config/prismlauncher.nix @@ -0,0 +1,6 @@ +{ config, lib, ... }: +{ + programs.custom.prism-launcher = lib.mkIf config.meta.home-manager.desktop.enable { + enable = true; + }; +} \ No newline at end of file diff --git a/home-manager/config/vscode.nix b/home-manager/config/vscode.nix index f8170cd..985781f 100644 --- a/home-manager/config/vscode.nix +++ b/home-manager/config/vscode.nix @@ -38,6 +38,7 @@ mkhl.direnv # nix-direnv autoloading cschlosser.doxdocgen # C++ Doxygen generator tomoki1207.pdf # PDF Viewing + exodiusstudios.comment-anchors # Comment anchors and highlighting ]) ++ (with vscode-marketplace; [ yy0931.save-as-root # Save as root over SSH diff --git a/home-manager/config/zed.nix b/home-manager/config/zed.nix new file mode 100644 index 0000000..46bee07 --- /dev/null +++ b/home-manager/config/zed.nix @@ -0,0 +1,79 @@ +{ lib, config, pkgs, ... }: +{ + programs.zed-editor = lib.mkIf config.meta.home-manager.vscode.enable { + enable = true; + + extensions = [ + # Language support + "nix" "toml" "deno" "kotlin" + # Themes + "catppuccin" + ]; + + userSettings = { + auto_update = false; + base_keymap = "VSCode"; + load_direnv = "shell_hook"; + show_whitespaces = "boundary"; + tab_size = 4; + theme = "Catppuccin Mocha"; + buffer_font_family = "FiraCode Nerd Font"; + format_on_save = "off"; + soft_wrap = "none"; + + terminal = { + dock = "bottom"; + font_family = "FiraCode Nerd Font"; + font_size = 14; + line_height = "standard"; # Comfortable breaks my powerline + working_directory = "current_project_directory"; + env.TERM = "xterm-256color"; + }; + + lsp = { + rust-analyzer = { + binary = { + path = lib.getExe pkgs.rust-analyzer; + }; + }; + + nix = { + binary = { + path = lib.getExe pkgs.nixd; + }; + }; + + vtsls = { + binary = { + path = lib.getExe pkgs.vtsls; + arguments = [ "--stdio" ]; + }; + }; + + kotlin-language-server = { + binary = { + path = lib.getExe' pkgs.kotlin-language-server "kotlin-language-server"; + }; + }; + }; + + languages = { + Nix = { + language_servers = [ "nixd" "!nil" ]; + }; + }; + + # Disable the bullshit + assistant = { + enabled = false; + button = false; + version = "1"; + }; + features.inline_completion_provider = "none"; + telemetry = { + diagnostics = false; + metrics = false; + }; + }; + }; +} diff --git a/home-manager/default.nix b/home-manager/default.nix index cb37770..52e48e8 100755 --- a/home-manager/default.nix +++ b/home-manager/default.nix @@ -9,6 +9,7 @@ home-manager.sharedModules = [ # Import plasma manager and all of my custom modules for use inputs.plasma-manager.homeManagerModules.plasma-manager + inputs.flatpaks.homeManagerModules.declarative-flatpak ./modules ]; # Inherit all of my nixos config custom arguments diff --git a/home-manager/modules/default.nix b/home-manager/modules/default.nix index 7e01992..adfa875 100644 --- a/home-manager/modules/default.nix +++ b/home-manager/modules/default.nix @@ -1,6 +1,7 @@ { ... }: { imports = [ + ./prismlauncher.nix ./rescrobbled.nix ]; } \ No newline at end of file diff --git a/home-manager/modules/prismlauncher.nix b/home-manager/modules/prismlauncher.nix new file mode 100644 index 0000000..4f1ec17 --- /dev/null +++ b/home-manager/modules/prismlauncher.nix @@ -0,0 +1,82 @@ +{ lib, pkgs, config, ... }: +{ + options = { + programs.custom.prism-launcher = { + enable = lib.mkEnableOption "prism launcher"; + + package = lib.mkPackageOption pkgs "Prism Launcher" { + default = "prismlauncher"; + }; + + javaPackages = lib.mkOption { + type = lib.types.listOf lib.types.package; + default = [ + # These three JREs cover most minecraft versions + pkgs.temurin-jre-bin-21 + pkgs.temurin-jre-bin-17 + pkgs.temurin-jre-bin-8 + ]; + defaultText = lib.literalExpression "with pkgs; [ temurin-jre-bin-21 temurin-jre-bin-17 temurin-jre-bin-8 ]"; + description = "The java packages to provide to Prism Launcher for running the game"; + }; + + additionalPrograms = lib.mkOption { + type = lib.types.listOf lib.types.package; + default = []; + defaultText = lib.literalExpression "[]"; + description = '' + Additional programs that will be added to Prism Launcher's PATH. + Use this for mods that require an extra binary to be present to function. + ''; + }; + + additionalLibs = lib.mkOption { + type = lib.types.listOf lib.types.package; + default = []; + defaultText = lib.literalExpression "[]"; + description = '' + Additional dynamic libraries that will be added to Prism Launcher's LD_LIBRARY_PATH. + Use this for mods that require an extra native library to be present to function. + ''; + }; + + controllerSupport = lib.mkOption { + type = lib.types.bool; + default = true; + defaultText = lib.literalExpression "true"; + description = "Whether to enable controller support for Prism Launcher"; + }; + gamemodeSupport = lib.mkOption { + type = lib.types.bool; + default = true; + defaultText = lib.literalExpression "true"; + description = "Whether to enable Feral GameMode support for Prism Launcher"; + }; + textToSpeechSupport = lib.mkOption { + type = lib.types.bool; + default = true; + defaultText = lib.literalExpression "true"; + description = "Whether to enable text-to-speech support for Prism Launcher"; + }; + + msaClientID = lib.mkOption { + type = lib.types.nullOr lib.types.str; + default = null; + defaultText = lib.literalExpression "null"; + description = '' + A custom MSA Client ID to use for authentication with microsoft servers. + Do not override this unless truly necessary. + ''; + }; + }; + }; + + config = let + cfg = config.programs.custom.prism-launcher; + in lib.mkIf cfg.enable { + home.packages = [ (cfg.package.override { + jdks = cfg.javaPackages; + inherit (cfg) additionalPrograms additionalLibs controllerSupport gamemodeSupport textToSpeechSupport msaClientID; + }) ]; + }; +} \ No newline at end of file diff --git a/hosts/laptop-server/config/default.nix b/hosts/laptop-server/config/default.nix index 0e65250..492dc5d 100644 --- a/hosts/laptop-server/config/default.nix +++ b/hosts/laptop-server/config/default.nix @@ -7,6 +7,7 @@ ./bootloader.nix ./display.nix ./locale.nix + ./mounts.nix ./networking.nix ./nixpkgs.nix ./programs.nix diff --git a/hosts/laptop-server/config/mounts.nix b/hosts/laptop-server/config/mounts.nix new file mode 100644 index 0000000..734d786 --- /dev/null +++ b/hosts/laptop-server/config/mounts.nix @@ -0,0 +1,15 @@ +{ ... }: +{ + fileSystems."/mnt/hdd" = { + device = "/dev/mapper/hdd"; + fsType = "btrfs"; + options = [ "compression=zstd:3" "autodefrag" "nofail" ]; + + encrypted = { + enable = true; + label = "hdd"; + blkDev = "/dev/disk/by-uuid/eab5e1d6-6956-46fd-b3ac-5fcf525e1df8"; + keyFile = "/mnt-root/root/hdd.key"; + }; + }; +} \ No newline at end of file diff --git a/hosts/laptop-server/config/networking.nix b/hosts/laptop-server/config/networking.nix index 21dc5d8..603465f 100644 --- a/hosts/laptop-server/config/networking.nix +++ b/hosts/laptop-server/config/networking.nix @@ -1,12 +1,12 @@ -{ ... }: +{ pkgs, ... }: { networking = { hostName = "ty-laptop-server"; - # Enable firewall + # TODO Firewall causes issues with containers, need to fix it firewall = { enable = true; - trustedInterfaces = [ "lo" "ve-jellyfin" ]; + package = pkgs.iptables; }; # Enable NetworkManager @@ -19,4 +19,5 @@ useRoutingFeatures = "both"; openFirewall = true; }; + networking.firewall.trustedInterfaces = [ "tailscale0" ]; } \ No newline at end of file diff --git a/hosts/laptop-server/config/services/default.nix b/hosts/laptop-server/config/services/default.nix index beda8a2..c3c9c87 100644 --- a/hosts/laptop-server/config/services/default.nix +++ b/hosts/laptop-server/config/services/default.nix @@ -7,9 +7,7 @@ networking = { nat = { enable = true; - internalInterfaces = ["ve-jellyfin"]; externalInterface = "wlp2s0"; }; - networkmanager.unmanaged = [ "interface-name:ve-jellyfin" ]; }; } \ No newline at end of file diff --git a/hosts/laptop-server/config/services/jellyfin.nix b/hosts/laptop-server/config/services/jellyfin.nix index 7b24fb0..eabd113 100644 --- a/hosts/laptop-server/config/services/jellyfin.nix +++ b/hosts/laptop-server/config/services/jellyfin.nix @@ -1,4 +1,4 @@ -{ config, ... }: +{ ... }: { containers.jellyfin = { config = { pkgs, ...}: { @@ -8,10 +8,19 @@ enable = true; package = pkgs.jellyfin; }; + + # Firewall on the host system is enough + this firewall seems to break networking + networking.firewall.enable = false; }; autoStart = true; privateNetwork = true; - hostAddress = "172.30.0.2"; # TODO define in config option + hostAddress = "172.30.1.2"; # TODO define in config option localAddress = "172.30.0.2"; }; + + networking = { + firewall.trustedInterfaces = [ "ve-jellyfin" ]; + nat.internalInterfaces = [ "ve-jellyfin" ]; + networkmanager.unmanaged = [ "interface-name:ve-jellyfin" ]; + }; } \ No newline at end of file diff --git a/hosts/laptop/config/fonts.nix b/hosts/laptop/config/fonts.nix index eec3df1..fc65876 100644 --- a/hosts/laptop/config/fonts.nix +++ b/hosts/laptop/config/fonts.nix @@ -1,6 +1,8 @@ { pkgs, ... }: { fonts = { + fontDir.enable = true; + packages = with pkgs; [ # Core fonts (Arial, Times new roman and the such) corefonts diff --git a/hosts/laptop/config/nvidia.nix b/hosts/laptop/config/nvidia.nix index 5fde625..589e2aa 100644 --- a/hosts/laptop/config/nvidia.nix +++ b/hosts/laptop/config/nvidia.nix @@ -12,7 +12,7 @@ # Experimentally turn off Nvidia GPU when not in use powerManagement.finegrained = false; - open = false; # Open source module is still very much beta + open = true; # Open source module is still very much beta nvidiaSettings = true; diff --git a/hosts/laptop/config/packages.nix b/hosts/laptop/config/packages.nix index 7cab9b4..e4a8389 100644 --- a/hosts/laptop/config/packages.nix +++ b/hosts/laptop/config/packages.nix @@ -10,6 +10,7 @@ # Nix utilities home-manager inputs.colmena.packages."${system}".colmena + nvd # VCS git jujutsu @@ -20,12 +21,21 @@ # Enable waydroid virtualisation.waydroid.enable = true; + # Enable flatpak + services.flatpak.enable = true; + # Enable steam programs.steam = { enable = true; extest.enable = true; + extraPackages = [ + pkgs.vimix-cursors # Necessary so cursor size and theme are correct while inside the steam window + ]; }; + programs.gamemode.enable = true; + programs.gamescope.enable = true; + # Install zsh programs.zsh.enable = true; diff --git a/hosts/laptop/default.nix b/hosts/laptop/default.nix index 72c1cd7..918739e 100644 --- a/hosts/laptop/default.nix +++ b/hosts/laptop/default.nix @@ -2,7 +2,7 @@ { imports = [ ## External modules - + # Better command-not-found inputs.nix-index-database.nixosModules.nix-index { programs.nix-index-database.comma.enable = true; } @@ -11,7 +11,7 @@ inputs.home-manager.nixosModules.home-manager ../../home-manager { meta.home-manager.preset = "plasma-desktop"; } - + ## Normal configuration ./hardware-configuration.nix ./config @@ -33,4 +33,4 @@ auto-optimise-store = true; }; nix.gc.automatic = true; -} \ No newline at end of file +} diff --git a/nix-on-droid/ty-pixel/default.nix b/nix-on-droid/ty-pixel/default.nix new file mode 100644 index 0000000..e35461e --- /dev/null +++ b/nix-on-droid/ty-pixel/default.nix @@ -0,0 +1,15 @@ +{ ... }: { + system.stateVersion = "24.05"; + + home-manager.config = { + imports = [ ../../home-manager ]; + + meta.home-manager.preset = "cli"; + }; + + environment.etcBackupExtension = ".bak"; + + nix.extraOptions = '' + experimental-features = nix-command flakes + ''; +}