Added steam and flatpak modules. Fixed steam with impermanence
This commit is contained in:
parent
37f843170a
commit
47412f3ecf
7 changed files with 171 additions and 83 deletions
17
flake.lock
generated
17
flake.lock
generated
|
|
@ -768,6 +768,22 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nix-flatpak": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1734128415,
|
||||||
|
"narHash": "sha256-HLwdVNxpuTsLlM3tCkpbQU6yCehdgf3kOS1G2SDlkzY=",
|
||||||
|
"owner": "gmodena",
|
||||||
|
"repo": "nix-flatpak",
|
||||||
|
"rev": "8bdc2540da516006d07b04019eb57ae0781a04b3",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "gmodena",
|
||||||
|
"ref": "latest",
|
||||||
|
"repo": "nix-flatpak",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nix-formatter-pack": {
|
"nix-formatter-pack": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
|
@ -3213,6 +3229,7 @@
|
||||||
"impermanence": "impermanence",
|
"impermanence": "impermanence",
|
||||||
"neovim": "neovim",
|
"neovim": "neovim",
|
||||||
"nix-darwin": "nix-darwin",
|
"nix-darwin": "nix-darwin",
|
||||||
|
"nix-flatpak": "nix-flatpak",
|
||||||
"nix-gaming": "nix-gaming",
|
"nix-gaming": "nix-gaming",
|
||||||
"nix-on-droid": "nix-on-droid",
|
"nix-on-droid": "nix-on-droid",
|
||||||
"nixos-facter-modules": "nixos-facter-modules",
|
"nixos-facter-modules": "nixos-facter-modules",
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
};
|
};
|
||||||
hyprland.url = "github:hyprwm/Hyprland";
|
hyprland.url = "github:hyprwm/Hyprland";
|
||||||
stylix.url = "github:danth/stylix";
|
stylix.url = "github:danth/stylix";
|
||||||
#nix-flatpak.url = "github:GermanBread/declarative-flatpak/stable-v3";
|
nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=latest";
|
||||||
apple-silicon-support.url = "github:tpwrules/nixos-apple-silicon";
|
apple-silicon-support.url = "github:tpwrules/nixos-apple-silicon";
|
||||||
|
|
||||||
#nur.url = "github:nix-community/NUR";
|
#nur.url = "github:nix-community/NUR";
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,8 @@
|
||||||
inputs.disko.nixosModules.default
|
inputs.disko.nixosModules.default
|
||||||
|
|
||||||
./modules/firefox
|
./modules/firefox
|
||||||
|
./modules/flatpak
|
||||||
|
./modules/steam
|
||||||
./modules/services/autoupgrade
|
./modules/services/autoupgrade
|
||||||
./modules/sops
|
./modules/sops
|
||||||
./hosts/${hwconfig.hostname}
|
./hosts/${hwconfig.hostname}
|
||||||
|
|
@ -73,6 +75,13 @@
|
||||||
# networking.proxy.default = "http://user:password@proxy:port/";
|
# networking.proxy.default = "http://user:password@proxy:port/";
|
||||||
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
||||||
|
|
||||||
|
#flatpak
|
||||||
|
kk.services.flatpak.enable = true;
|
||||||
|
services.flatpak.packages = [
|
||||||
|
"com.super_productivity.SuperProductivity"
|
||||||
|
"net.cozic.joplin_desktop"
|
||||||
|
];
|
||||||
|
|
||||||
# Enable networking
|
# Enable networking
|
||||||
networking.networkmanager.enable = true;
|
networking.networkmanager.enable = true;
|
||||||
|
|
||||||
|
|
@ -247,13 +256,6 @@
|
||||||
|
|
||||||
security.polkit.enable = true;
|
security.polkit.enable = true;
|
||||||
|
|
||||||
programs.steam = {
|
|
||||||
enable = hwconfig.system == "x86_64-linux";
|
|
||||||
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
|
|
||||||
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
|
|
||||||
localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
|
|
||||||
};
|
|
||||||
|
|
||||||
#programs.thunar = {
|
#programs.thunar = {
|
||||||
# enable = true;
|
# enable = true;
|
||||||
# plugins = with pkgs.xfce; [
|
# plugins = with pkgs.xfce; [
|
||||||
|
|
@ -338,6 +340,8 @@
|
||||||
# enableSSHSupport = true;
|
# enableSSHSupport = true;
|
||||||
# };
|
# };
|
||||||
|
|
||||||
|
kk.steam.enable = hwconfig.system == "x86_64-linux";
|
||||||
|
|
||||||
# List services that you want to enable:
|
# List services that you want to enable:
|
||||||
|
|
||||||
# Enable the OpenSSH daemon.
|
# Enable the OpenSSH daemon.
|
||||||
|
|
|
||||||
19
nixos/modules/flatpak/default.nix
Normal file
19
nixos/modules/flatpak/default.nix
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
inputs,
|
||||||
|
config,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
cfg = config.kk.services.flatpak;
|
||||||
|
in {
|
||||||
|
imports = [
|
||||||
|
inputs.nix-flatpak.nixosModules.nix-flatpak
|
||||||
|
];
|
||||||
|
options.kk.services.flatpak = {
|
||||||
|
enable = lib.mkEnableOption "enable flatpaks";
|
||||||
|
};
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
services.flatpak.enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -1,8 +1,11 @@
|
||||||
{ config, lib, inputs, ... }:
|
|
||||||
let
|
|
||||||
isBtrfs = config.fileSystems."/".fsType == "btrfs";
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
inputs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
isBtrfs = config.fileSystems."/".fsType == "btrfs";
|
||||||
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
inputs.impermanence.nixosModules.impermanence
|
inputs.impermanence.nixosModules.impermanence
|
||||||
];
|
];
|
||||||
|
|
@ -14,13 +17,22 @@ in
|
||||||
"/var/log"
|
"/var/log"
|
||||||
"/var/lib/bluetooth"
|
"/var/lib/bluetooth"
|
||||||
"/var/lib/nixos"
|
"/var/lib/nixos"
|
||||||
|
"/var/lib/flatpak"
|
||||||
"/var/lib/systemd/coredump"
|
"/var/lib/systemd/coredump"
|
||||||
"/etc/NetworkManager/system-connections"
|
"/etc/NetworkManager/system-connections"
|
||||||
{ directory = "/var/lib/colord"; user = "colord"; group = "colord"; mode = "u=rwx,g=rx,o="; }
|
{
|
||||||
|
directory = "/var/lib/colord";
|
||||||
|
user = "colord";
|
||||||
|
group = "colord";
|
||||||
|
mode = "u=rwx,g=rx,o=";
|
||||||
|
}
|
||||||
];
|
];
|
||||||
files = [
|
files = [
|
||||||
"/etc/machine-id"
|
"/etc/machine-id"
|
||||||
{ file = "/var/keys/secret_file"; parentDirectory = { mode = "u=rwx,g=,o="; }; }
|
{
|
||||||
|
file = "/var/keys/secret_file";
|
||||||
|
parentDirectory = {mode = "u=rwx,g=,o=";};
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
systemd.tmpfiles.rules = [
|
systemd.tmpfiles.rules = [
|
||||||
|
|
@ -30,7 +42,9 @@ in
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.fuse.userAllowOther = true;
|
programs.fuse.userAllowOther = true;
|
||||||
boot.initrd.postDeviceCommands = lib.mkAfter (if isBtrfs then ''
|
boot.initrd.postDeviceCommands = lib.mkAfter (
|
||||||
|
if isBtrfs
|
||||||
|
then ''
|
||||||
mkdir /btrfs_tmp
|
mkdir /btrfs_tmp
|
||||||
mount /dev/root_vg/root /btrfs_tmp
|
mount /dev/root_vg/root /btrfs_tmp
|
||||||
if [[ -e /btrfs_tmp/root ]]; then
|
if [[ -e /btrfs_tmp/root ]]; then
|
||||||
|
|
@ -53,5 +67,7 @@ in
|
||||||
|
|
||||||
btrfs subvolume create /btrfs_tmp/root
|
btrfs subvolume create /btrfs_tmp/root
|
||||||
umount /btrfs_tmp
|
umount /btrfs_tmp
|
||||||
'' else '''');
|
''
|
||||||
|
else ''''
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
{ username, inputs, ... }:
|
|
||||||
{
|
{
|
||||||
|
username,
|
||||||
|
inputs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
inputs.impermanence.nixosModules.home-manager.impermanence
|
inputs.impermanence.nixosModules.home-manager.impermanence
|
||||||
];
|
];
|
||||||
|
|
@ -19,11 +22,11 @@
|
||||||
".nixops"
|
".nixops"
|
||||||
".local/share/keyrings"
|
".local/share/keyrings"
|
||||||
".local/share/direnv"
|
".local/share/direnv"
|
||||||
{
|
#{
|
||||||
directory = ".local/share/Steam";
|
# directory = ".local/share/Steam";
|
||||||
# method = "symlink";
|
# method = "symlink";
|
||||||
}
|
#}
|
||||||
".steam"
|
#".steam"
|
||||||
".mozilla"
|
".mozilla"
|
||||||
".local/share/TelegramDesktop"
|
".local/share/TelegramDesktop"
|
||||||
".config/solaar"
|
".config/solaar"
|
||||||
|
|
|
||||||
29
nixos/modules/steam/default.nix
Normal file
29
nixos/modules/steam/default.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
config,
|
||||||
|
hwconfig,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
cfg = config.kk.steam;
|
||||||
|
in {
|
||||||
|
options.kk.steam = {
|
||||||
|
enable = lib.mkEnableOption "Enable steam";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable (
|
||||||
|
if hwconfig.useImpermanence
|
||||||
|
then {
|
||||||
|
kk.services.flatpak.enable = lib.mkForce true;
|
||||||
|
services.flatpak.packages = ["com.valvesoftware.Steam"];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
programs.steam = {
|
||||||
|
enable = !hwconfig.useImpermanence;
|
||||||
|
remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play
|
||||||
|
dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server
|
||||||
|
localNetworkGameTransfers.openFirewall = true; # Open ports in the firewall for Steam Local Network Game Transfers
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue