Initial commit; minimal emulationstation

This commit is contained in:
soyouzpanda 2023-12-30 17:18:55 +01:00
commit 1be5160b1a
Signed by: ecoppens
GPG key ID: 54882F92BB178D6A
9 changed files with 224 additions and 0 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
/nixos.qcow2
/result

6
.gitmodules vendored Normal file
View file

@ -0,0 +1,6 @@
[submodule "emulationstation/roms"]
path = emulationstation/roms
url = ssh://git@git.soyouzpanda.fr:2222/soyouzpanda/arcade-roms.git
[submodule "emulationstation/theme"]
path = emulationstation/theme
url = git@git.dgnum.eu:ecoppens/arcade-theme.git

16
Makefile Normal file
View file

@ -0,0 +1,16 @@
.PHNOY: run all build clean debug
all: clean build
run: all
./result/bin/run-nixos-vm
build:
nix build ".?submodules=1#nixosConfigurations.vm.config.system.build.vm" --no-eval-cache
debug:
nix build ".#nixosConfigurations.vm.config.system.build.vm" --no-eval-cache --show-trace
clean:
rm nixos.qcow2 -f
rm result -rf

37
configuration.nix Normal file
View file

@ -0,0 +1,37 @@
({ config, lib, pkgs, home-manager, username, userhome, ... }: {
system.stateVersion = "23.11";
environment.systemPackages = [
pkgs.xorg.xorgserver
pkgs.xorg.xinit
pkgs.xorg.xf86inputevdev
pkgs.xorg.xf86inputsynaptics
pkgs.xorg.xf86inputlibinput
pkgs.xorg.xf86videointel
pkgs.xorg.xf86videoati
pkgs.xorg.xf86videonouveau
pkgs.emulationstation
pkgs.home-manager
];
users.users."${username}" = {
isNormalUser = true;
home = userhome;
extraGroups = [ "wheel" ];
initialHashedPassword = "$y$j9T$mZVJ.MyA3PnxIzrUr4NbO.$wp6VqO0WphwynzPhw4Y3X57VcAaFla3sO9gTdV25xq8";
};
programs.bash.loginShellInit =
"startx ${pkgs.emulationstation}/bin/emulationstation";
hardware.opengl.enable = true;
hardware.opengl.driSupport = true;
services.xserver.enable = true;
services.xserver.displayManager.startx.enable = true;
services.xserver.libinput.enable = true;
services.getty.autologinUser = "arcade";
boot.loader.systemd-boot.enable = true;
console.keyMap = "fr";
services.openssh = lib.mkForce { enable = false; };
})

View file

@ -0,0 +1,77 @@
{ userhome, ... }:
let
romspath = "${userhome}/roms";
themes = [
{
name = "Arcade";
theme = "arcade";
}
{
name = "BeatThemAll";
theme = "btmups";
}
{
name = "BestJeuEver";
theme = "bestjeuever";
}
{
name = "Course";
theme = "racing";
}
{
name = "Kombat";
theme = "kombat";
}
{
name = "Plateforme";
theme = "plateforme";
}
{
name = "Shmup";
theme = "shmups";
}
{
name = "Sport";
theme = "sports";
}
{
name = "Versus";
theme = "versus";
}
];
system = { name, theme }: ''
<system>
<name>${name}</name>
<fullname>${name}</fullname>
<path>${romspath}/${name}</path>
<extension>.zip .nes .cue .rvz</extension>
<command>bash %ROM%</command>
<platform>snes</platform>
<theme>${theme}</theme>
</system>
'';
systems = themes:
let
list = builtins.foldl' (global: theme: global + (system theme)) "" themes;
in ''
<?xml version="1.0"?>
<systemList>
${list}
</systemList>
'';
in {
environment.etc = {
"emulationstation/themes/hackens" = {
source = ./theme;
mode = "0755";
};
"emulationstation/es_systems.cfg" = {
text = systems themes;
mode = "0644";
};
};
}

1
emulationstation/roms Submodule

@ -0,0 +1 @@
Subproject commit 746bb3903f149670e51d22b1c8006188f47051ae

@ -0,0 +1 @@
Subproject commit 77d82b8343e8b7b16cfd1c2ed014238b9189fc92

48
flake.lock Normal file
View file

@ -0,0 +1,48 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1703367386,
"narHash": "sha256-FMbm48UGrBfOWGt8+opuS+uLBLQlRfhiYXhHNcYMS5k=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "d5824a76bc6bb93d1dce9ebbbcb09a9b6abcc224",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-23.11",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1701282334,
"narHash": "sha256-MxCVrXY6v4QmfTwIysjjaX0XUhqBbxTWWB4HXtDYsdk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "057f9aecfb71c4437d2b27d3323df7f93c010b7e",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "23.11",
"type": "indirect"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

36
flake.nix Normal file
View file

@ -0,0 +1,36 @@
{
description = "Minimal NixOS installation media";
inputs = {
nixpkgs.url = "nixpkgs/23.11";
home-manager.url = "github:nix-community/home-manager/release-23.11";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, home-manager, ... }@inputs:
let
username = "arcade";
userhome = "/home/${username}";
in {
nixosConfigurations = {
vm = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs username userhome; };
modules = [
home-manager.nixosModules.home-manager
{
home-manager.users.arcade = { ... }: {
home.username = username;
home.homeDirectory = userhome;
home.stateVersion = "23.11";
home.file."roms".source = ./emulationstation/roms;
};
}
./configuration.nix
./emulationstation/configuration-files.nix
"${nixpkgs}/nixos/modules/profiles/qemu-guest.nix"
];
};
};
};
}