Compare commits

...

4 commits

Author SHA1 Message Date
Jay Looney
fa53235842 feat: Add stylix and expose mkSystem via 'lib' 2025-11-06 00:39:15 -06:00
Jay Looney
836a31c119 feat: Add CMake3 overlays to keep game emulation software working. 2025-11-06 00:37:26 -06:00
Jay Looney
5981f4a023 feat: add gitignore for result/ dirs 2025-11-02 10:10:28 -06:00
Jay Looney
d7202a1af1 feat: add calibre and game virtualization 2025-10-08 11:14:36 -05:00
7 changed files with 149 additions and 17 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
result
result-*

30
flake.lock generated
View file

@ -22,11 +22,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1757508292, "lastModified": 1758287904,
"narHash": "sha256-7lVWL5bC6xBIMWWDal41LlGAG+9u2zUorqo3QCUL4p4=", "narHash": "sha256-IGmaEf3Do8o5Cwp1kXBN1wQmZwQN3NLfq5t4nHtVtcU=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "146f45bee02b8bd88812cfce6ffc0f933788875a", "rev": "67ff9807dd148e704baadbd4fd783b54282ca627",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -101,11 +101,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1749499854, "lastModified": 1760130406,
"narHash": "sha256-V1BgwiX8NjbRreU6LC2EzmuqFSQAHhoSeNlYJyZ40NE=", "narHash": "sha256-GKMwBaFRw/C1p1VtjDz4DyhyzjKUWyi1K50bh8lgA2E=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "1df816c407d3a5090c8496c9b00170af7891f021", "rev": "d305eece827a3fe317a2d70138f53feccaf890a1",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -142,11 +142,11 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1749195551, "lastModified": 1760106635,
"narHash": "sha256-W5GKQHgunda/OP9sbKENBZhMBDNu2QahoIPwnsF6CeM=", "narHash": "sha256-2GoxVaKWTHBxRoeUYSjv0AfSOx4qw5CWSFz2b+VolKU=",
"owner": "nixos", "owner": "nixos",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "4602f7e1d3f197b3cb540d5accf5669121629628", "rev": "9ed85f8afebf2b7478f25db0a98d0e782c0ed903",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -157,11 +157,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1749285348, "lastModified": 1760038930,
"narHash": "sha256-frdhQvPbmDYaScPFiCnfdh3B/Vh81Uuoo0w5TkWmmjU=", "narHash": "sha256-Oncbh0UmHjSlxO7ErQDM3KM0A5/Znfofj2BSzlHLeVw=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3e3afe5174c561dee0df6f2c2b2236990146329f", "rev": "0b4defa2584313f3b781240b29d61f6f9f7e0df3",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -252,11 +252,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1747603214, "lastModified": 1759635238,
"narHash": "sha256-lAblXm0VwifYCJ/ILPXJwlz0qNY07DDYdLD+9H+Wc8o=", "narHash": "sha256-UvzKi02LMFP74csFfwLPAZ0mrE7k6EiYaKecplyX9Qk=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "8d215e1c981be3aa37e47aeabd4e61bb069548fd", "rev": "6e5a38e08a2c31ae687504196a230ae00ea95133",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -11,15 +11,20 @@
sops-nix.inputs.nixpkgs.follows = "nixpkgs"; sops-nix.inputs.nixpkgs.follows = "nixpkgs";
disko.url = "github:nix-community/disko"; disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs"; disko.inputs.nixpkgs.follows = "nixpkgs";
stylix.url = "github:nix-community/stylix";
stylix.inputs.nixpkgs.follows = "nixpkgs";
}; };
# https://nix.dev/tutorials/nix-language.html#named-attribute-set-argument # https://nix.dev/tutorials/nix-language.html#named-attribute-set-argument
outputs = inputs@{self, nixpkgs, nixos-hardware, home-manager, sops-nix, lanzaboote, disko, ...}: outputs = inputs@{self, nixpkgs, nixos-hardware, home-manager, sops-nix, lanzaboote, disko, stylix, ...}:
let let
mkSystem = (import ./lib { mkSystem = (import ./lib {
inherit nixpkgs home-manager inputs; inherit nixpkgs home-manager inputs;
}).mkSystem; }).mkSystem;
in in
{ {
lib = {
mkSystem = mkSystem;
};
# NOTE: Run `nix flake show` to see what this flake has to offer. # NOTE: Run `nix flake show` to see what this flake has to offer.
# TODO: Enable automated formatting with something like numtide/treefmt-nix # TODO: Enable automated formatting with something like numtide/treefmt-nix
nixosConfigurations = { nixosConfigurations = {
@ -40,7 +45,8 @@
users = [ users = [
"jml" "jml"
]; ];
extraModules = []; #extraModules = [ (import ./overlays) ];
extraModules = [ stylix.nixosModules.stylix ];
}; };
# `nix build .#nixosConfigurations.installIso.config.system.build.isoImage` # `nix build .#nixosConfigurations.installIso.config.system.build.isoImage`
# https://github.com/nix-community/nixos-generators # https://github.com/nix-community/nixos-generators

View file

@ -0,0 +1,57 @@
{ config, lib, pkgs, ... }:
let
retroarchWithCores = (
pkgs.retroarch.withCores (
cores: with cores; [
# Multi-Emulators
mame # Atari / Nintendo / Sega / etc.
# Sega
genesis-plus-gx # Sega Genesis
# Nintendo
mesen # NES
bsnes # Super Nintendo
mupen64plus # Nintendo 64 - Maybe simple64 some day.
dolphin # GameCube
mgba # GameBoy / Color / Advance
melonds # Nintendo DS
citra # Nintendo 3DS
# Sony
swanstation #duckstation # PlayStation
beetle-psx-hw
pcsx2 # PlayStation 2 -- Is actually "LRPS2"
#rpcs3 # PlayStation 3
ppsspp # PlayStation Portable
# Commodore
vice-x64 # C64
]
)
);
in
{
environment.systemPackages = [
retroarchWithCores
#pkgs.emulationstation-de
pkgs.gnome-bluetooth
];
hardware.xone.enable = true; # Xbox Controller Driver
hardware.enableAllFirmware = true;
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
settings = {
General = {
Experimental = true;
FastConnectable = true;
};
Policy = {
AutoEnable = true;
};
};
};
}

View file

@ -0,0 +1,27 @@
{ config, lib, pkgs, ... }:
{
imports = [];
options = {
zw-calibre = {
enable = lib.mkEnableOption "Enable Calibre";
};
};
config = {
config.allowUnfreePredigate = pkg: builtins.elem (lib.getName pkg) [
"calibre"
"unrar"
];
environment.systemPackages = with pkgs; [
(calibre.override {
unrarSupport = true;
})
unrar
];
services.udisks2.enable = true;
};
# NOTE: Consider adding https://github.com/nydragon/calibre-plugins
}

40
overlays/default.nix Normal file
View file

@ -0,0 +1,40 @@
{ nixpkgs }:
let
fixCmake = pkg: pkg.overrideAttrs (old: {
cmakeFlakes = (old.cmakeFlags or []) ++ [
(nixpkgs.lib.cmakeFeature "CMAKE_POLICY_VERSION_MINIMUM" "3.10")
];
});
cmake3Overlay = final: prev:
nixpkgs.lib.mapAttrs (
n: pkg:
pkg.overrideAttrs (old: {
cmakeFlags = old.cmakeFlags or [ ] ++ [ (nixpkgs.lib.cmakeFeature "CMAKE_POLICY_VERSION_MINIMUM" "3.10") ];
})
) {
inherit (prev) hpipm;
};
libretroCmake3Overlay = final: prev: {
libretro = prev.libretro // {
thepowdertoy = prev.libretro.thepowdertoy.overrideAttrs(old: {
cmakeFlags = old.cmakeFlags or [ ] ++ [ (nixpkgs.lib.cmakeFeature "CMAKE_POLICY_VERSION_MINIMUM" "3.10") ];
});
tic80 = prev.libretro.tic80.overrideAttrs(old: {
cmakeFlags = old.cmakeFlags or [ ] ++ [ (nixpkgs.lib.cmakeFeature "CMAKE_POLICY_VERSION_MINIMUM" "3.10") ];
});
citra = prev.libretro.citra.overrideAttrs(old: {
cmakeFlags = old.cmakeFlags or [ ] ++ [ (nixpkgs.lib.cmakeFeature "CMAKE_POLICY_VERSION_MINIMUM" "3.10") ];
});
dolphin = prev.libretro.dolphin.overrideAttrs(old: {
cmakeFlags = old.cmakeFlags or [ ] ++ [ (nixpkgs.lib.cmakeFeature "CMAKE_POLICY_VERSION_MINIMUM" "3.10") ];
});
};
};
in
[
cmake3Overlay
libretroCmake3Overlay
]