nintendo switch flake

This commit is contained in:
Danilo Reyes 2025-02-09 02:57:19 -06:00
parent 42db1e1ab5
commit cac6af6c06
4 changed files with 81 additions and 2 deletions

59
flake.lock generated
View File

@ -244,6 +244,23 @@
}
},
"flake-parts_2": {
"inputs": {
"nixpkgs-lib": "nixpkgs-lib_2"
},
"locked": {
"lastModified": 1712014858,
"narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "9126214d0a59633752a136528f5f3b9aa8565b7d",
"type": "github"
},
"original": {
"id": "flake-parts",
"type": "indirect"
}
},
"flake-parts_3": {
"inputs": {
"nixpkgs-lib": [
"nur",
@ -757,6 +774,24 @@
"url": "https://github.com/NixOS/nixpkgs/archive/072a6db25e947df2f31aab9eccd0ab75d5b2da11.tar.gz"
}
},
"nixpkgs-lib_2": {
"locked": {
"dir": "lib",
"lastModified": 1711703276,
"narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d8fe5e6c92d0d190646fb9f1056741a229980089",
"type": "github"
},
"original": {
"dir": "lib",
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs11": {
"locked": {
"lastModified": 1738843498,
@ -789,9 +824,30 @@
"type": "github"
}
},
"nur": {
"nixtendo-switch": {
"inputs": {
"flake-parts": "flake-parts_2",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1721329381,
"narHash": "sha256-oj95wOUYXXlpx87Fjmf+Nu+wz1qrFtCf7AKDnxEB8oQ=",
"owner": "nyawox",
"repo": "nixtendo-switch",
"rev": "ba69506f44d4e154cdf11b5ba3d23534f9fb3238",
"type": "github"
},
"original": {
"owner": "nyawox",
"repo": "nixtendo-switch",
"type": "github"
}
},
"nur": {
"inputs": {
"flake-parts": "flake-parts_3",
"nixpkgs": [
"nixpkgs"
],
@ -843,6 +899,7 @@
"nix-gaming": "nix-gaming",
"nixpkgs": "nixpkgs_2",
"nixpkgs11": "nixpkgs11",
"nixtendo-switch": "nixtendo-switch",
"nur": "nur",
"sops-nix": "sops-nix",
"stylix": "stylix",

View File

@ -33,6 +33,10 @@
url = "github:danth/stylix";
inputs.nixpkgs.follows = "nixpkgs";
};
nixtendo-switch = {
url = "github:nyawox/nixtendo-switch";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
@ -65,6 +69,7 @@
inputs.nur.modules.nixos.default
inputs.sops-nix.nixosModules.sops
inputs.stylix.nixosModules.stylix
inputs.nixtendo-switch.nixosModules.nixtendo-switch
];
};
in

View File

@ -6,6 +6,7 @@
dictionaries.enable = true;
fonts.enable = true;
gaming.enable = true;
switch.enable = true;
internet.enable = true;
multimedia.enable = true;
office.enable = true;

View File

@ -7,8 +7,17 @@
}:
{
imports = [ inputs.nix-gaming.nixosModules.platformOptimizations ];
options.my.apps.gaming.enable = lib.mkEnableOption "enable";
options.my.apps = {
gaming.enable = lib.mkEnableOption "enable";
switch.enable = lib.mkEnableOption "enable";
};
config = lib.mkIf config.my.apps.gaming.enable {
sops.secrets.switch-presence = {
sopsFile = ../../secrets/env.yaml;
format = "dotenv";
owner = config.users.users.jawz.name;
inherit (config.users.users.jawz) group;
};
programs = {
gamemode.enable = true;
steam = {
@ -19,6 +28,13 @@
platformOptimizations.enable = true;
};
};
services = lib.mkIf config.my.apps.switch.enable {
switch-boot.enable = true;
switch-presence = {
enable = true;
environmentFile = config.sops.secrets.switch-presence.path;
};
};
users.users.jawz.packages = builtins.attrValues {
inherit (pkgs)
shipwright # zelda OoT port