feat: Added stuff from steamdeck

Signed-off-by: uttarayan21 <email@uttarayan.me>
This commit is contained in:
uttarayan21
2025-05-04 05:53:14 +05:30
parent a67d3353e2
commit 13dedfa654
3 changed files with 22 additions and 12 deletions

View File

@@ -22,5 +22,9 @@ home:
nixos:
sudo nixos-rebuild switch --flake .
deck:
nix run home-manager/master -- switch --flake .#deck
test_nixos:
sudo nixos-rebuild test --fast --flake .

View File

@@ -5,24 +5,24 @@
...
}:
with lib; let
cfg = config.services.aichat;
cfg = config.services.tailscale;
in {
options = {
services.aichat = {
enable = mkEnableOption "aichat";
package = mkPackageOption pkgs "aichat" {};
services.tailscale = {
enable = mkEnableOption "tailscale";
package = mkPackageOption pkgs "tailscale" {};
};
};
config = {
home.packages = mkIf cfg.enable [cfg.package];
home.activation.runTailscaleActivation = let
tailscaleLib = "${cfg.package}/lib";
# This doesn't work since we don't have root
home.activation.copyTailscaledService = mkIf cfg.enable (let
tailscaleService = "${cfg.package}/lib/systemd/system/tailscaled.service";
in
lib.hm.dag.entryAfter ["writeBoundary"] ''
cp -r ${tailscaleLib} /etc/
systemctl reload-daemon
systemctl enable --now tailscaled
'';
lib.hm.dag.entryAfter ["installPackages"] ''
verboseEcho Copying the tailscale systemd files to /etc
run cp ${tailscaleService} /etc/systemd/system/tailscaled.service
'');
};
}

View File

@@ -6,5 +6,11 @@
imports = [
../modules/home/tailscale.nix
];
services.tailscale.enable = true;
services.tailscale = {
enable = false;
};
home.packages = [
pkgs.tailscale
];
}