Compare commits
No commits in common. "2d0fcbe30ad1ceb938225801517daafd20d01a0b" and "e2d8580c1b57960a79ca6a9e68b9b39107bf39f0" have entirely different histories.
2d0fcbe30a
...
e2d8580c1b
4 changed files with 57 additions and 16 deletions
|
@ -106,7 +106,7 @@
|
||||||
nix.settings.auto-optimise-store = true;
|
nix.settings.auto-optimise-store = true;
|
||||||
system.autoUpgrade.enable = false;
|
system.autoUpgrade.enable = false;
|
||||||
nix.gc = {
|
nix.gc = {
|
||||||
automatic = false;
|
automatic = true;
|
||||||
dates = "weekly";
|
dates = "weekly";
|
||||||
options = "--delete-older-than 10d";
|
options = "--delete-older-than 10d";
|
||||||
};
|
};
|
||||||
|
@ -226,12 +226,6 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.nh = {
|
|
||||||
enable = true;
|
|
||||||
clean.enable = true;
|
|
||||||
clean.extraArgs = "--keep-since 10d --keep 5";
|
|
||||||
flake = "/home/insert/Documents/nixos";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.rpcbind.enable = true; # needed for NFS
|
services.rpcbind.enable = true; # needed for NFS
|
||||||
systemd.mounts = [{
|
systemd.mounts = [{
|
||||||
|
|
6
home.nix
6
home.nix
|
@ -170,9 +170,9 @@
|
||||||
programs.zsh = {
|
programs.zsh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
update = "nh os switch -a /home/insert/Documents/nixos -- --impure --option commit-lockfile-summary 'Update flake.lock' --commit-lock-file";
|
update = "sudo nixos-rebuild switch --flake /home/insert/Documents/nixos# -v --impure --upgrade --option commit-lockfile-summary 'Update flake.lock' --commit-lock-file";
|
||||||
update-locked = "nh os switch -a /home/insert/Documents/nixos -- --impure";
|
update-locked = "sudo nixos-rebuild switch --flake /home/insert/Documents/nixos# -v --impure";
|
||||||
update-boot = "nh os boot -a /home/insert/Documents/nixos -- --impure";
|
update-boot = "sudo nixos-rebuild boot --flake /home/insert/Documents/nixos# -v --impure";
|
||||||
garbage = "nix-collect-garbage";
|
garbage = "nix-collect-garbage";
|
||||||
};
|
};
|
||||||
initExtra = ''
|
initExtra = ''
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{ inputs, config, lib, pkgs, ... }:
|
{ inputs, config, lib, pkgs, ... }:
|
||||||
{
|
{
|
||||||
environment.etc.nixpkgs.source = inputs.nixpkgs;
|
environment.etc.nixpkgs.source = inputs.nixpkgs;
|
||||||
|
imports = [ ./sunshine.nix ];
|
||||||
networking.hostName = "insertpclinux";
|
networking.hostName = "insertpclinux";
|
||||||
services.xserver.videoDrivers = ["nvidia"];
|
services.xserver.videoDrivers = ["nvidia"];
|
||||||
#nixpkgs.overlays = [ (self: super: (let
|
#nixpkgs.overlays = [ (self: super: (let
|
||||||
|
@ -13,12 +14,6 @@
|
||||||
# })) ];
|
# })) ];
|
||||||
#boot.kernelPackages = pkgs.linuxPackages;
|
#boot.kernelPackages = pkgs.linuxPackages;
|
||||||
|
|
||||||
services.sunshine = {
|
|
||||||
enable = true;
|
|
||||||
autoStart = true;
|
|
||||||
capSysAdmin = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
hardware.nvidia = {
|
hardware.nvidia = {
|
||||||
|
|
||||||
# Modesetting is needed most of the time
|
# Modesetting is needed most of the time
|
||||||
|
@ -46,6 +41,7 @@
|
||||||
};
|
};
|
||||||
virtualisation.libvirtd.enable = true;
|
virtualisation.libvirtd.enable = true;
|
||||||
programs.virt-manager.enable = true;
|
programs.virt-manager.enable = true;
|
||||||
|
services.sunshine.enable = true;
|
||||||
security.pki.certificateFiles = [
|
security.pki.certificateFiles = [
|
||||||
/home/insert/Documents/nextcloud/nextcloudinternal.pem
|
/home/insert/Documents/nextcloud/nextcloudinternal.pem
|
||||||
/home/insert/Documents/personal-vaultwarden/cert.pem
|
/home/insert/Documents/personal-vaultwarden/cert.pem
|
||||||
|
|
51
special/sunshine.nix
Normal file
51
special/sunshine.nix
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
#source: https://github.com/RandomNinjaAtk/nixos/blob/d2480c148e882f49e5caa6267060fd2d9e10af9b/services.sunshine.nix
|
||||||
|
#https://discourse.nixos.org/t/sunshine-self-hosted-game-stream/25608/16
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
cfg = config.services.sunshine;
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
options = {
|
||||||
|
|
||||||
|
services.sunshine = {
|
||||||
|
enable = mkEnableOption (mdDoc "Sunshine");
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf config.services.sunshine.enable {
|
||||||
|
|
||||||
|
environment.systemPackages = [
|
||||||
|
pkgs.sunshine
|
||||||
|
];
|
||||||
|
|
||||||
|
security.wrappers.sunshine = {
|
||||||
|
owner = "root";
|
||||||
|
group = "root";
|
||||||
|
capabilities = "cap_sys_admin+p";
|
||||||
|
source = "${pkgs.sunshine}/bin/sunshine";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Requires to simulate input
|
||||||
|
boot.kernelModules = [ "uinput" ];
|
||||||
|
services.udev.extraRules = ''
|
||||||
|
KERNEL=="uinput", SUBSYSTEM=="misc", OPTIONS+="static_node=uinput", TAG+="uaccess"
|
||||||
|
'';
|
||||||
|
|
||||||
|
systemd.user.services.sunshine =
|
||||||
|
{
|
||||||
|
description = "sunshine";
|
||||||
|
wantedBy = [ "graphical-session.target" ];
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = "${config.security.wrapperDir}/sunshine";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue