Skip to content

Commit 8b2a33d

Browse files
feat: adding vm
1 parent 7501a45 commit 8b2a33d

File tree

4 files changed

+75
-23
lines changed

4 files changed

+75
-23
lines changed

flake.nix

Lines changed: 70 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
pubspecLock = lib.importJSON ./pubspec.lock.json;
7373

7474
gitHashes = {
75-
expidus = "sha256-EaOzIJvuZ5Bs75zslMCTb9ChkOX7lNUEUvsbDItyqG0=";
75+
expidus = "sha256-ptTj+si4jUr9Eg5x6Rd2iUtACAVEpWG4p/1FqZnFSvM=";
7676
miso = "sha256-EznEUokD0nSON/4XRHe/HT+ybPAdNtoUwXCPEla6i1Y=";
7777
};
7878

@@ -112,24 +112,76 @@
112112
];
113113
};
114114
in
115-
{
116-
packages =
117-
{
118-
default = pkgs.genesis-shell;
119-
}
120-
// lib.optionalAttrs (pkgs.pkgsAsahi != null) {
121-
asahi = pkgs.pkgsAsahi.genesis-shell;
122-
};
115+
(
116+
{
117+
packages =
118+
{
119+
default = pkgs.genesis-shell;
120+
}
121+
// lib.optionalAttrs (pkgs.pkgsAsahi != null) {
122+
asahi = pkgs.pkgsAsahi.genesis-shell;
123+
};
123124

124-
devShells =
125-
{
126-
default = mkDevShell pkgs;
127-
}
128-
// lib.optionalAttrs (pkgs.pkgsAsahi != null) {
129-
asahi = mkDevShell pkgs.pkgsAsahi;
130-
};
125+
devShells =
126+
{
127+
default = mkDevShell pkgs;
128+
}
129+
// lib.optionalAttrs (pkgs.pkgsAsahi != null) {
130+
asahi = mkDevShell pkgs.pkgsAsahi;
131+
};
132+
133+
legacyPackages = pkgs;
134+
}
135+
// lib.optionalAttrs pkgs.hostPlatform.isLinux {
136+
nixosConfigurations = lib.nixosSystem {
137+
inherit system pkgs;
138+
modules = [
139+
"${nixpkgs}/nixos/modules/virtualisation/qemu-vm.nix"
140+
(
141+
{ config, lib, pkgs, ... }:
142+
{
143+
config = lib.mkMerge [
144+
(import "${nixpkgs}/nixos/modules/programs/wayland/wayland-session.nix" {
145+
inherit lib pkgs;
146+
})
147+
{
148+
hardware.graphics.enable = true;
131149

132-
legacyPackages = pkgs;
133-
}
150+
services.greetd = {
151+
enable = true;
152+
settings.default_session = {
153+
command = "${pkgs.greetd.greetd}/bin/agreety --cmd \"${pkgs.shoyu}/bin/shoyu-compositor-runner ${pkgs.genesis-shell}/bin/genesis_shell\"";
154+
};
155+
};
156+
157+
security.sudo = {
158+
enable = true;
159+
wheelNeedsPassword = false;
160+
};
161+
162+
virtualisation.qemu.options = [
163+
"-vga none"
164+
"-device virtio-gpu-gl-pci"
165+
"-display default,gl=on"
166+
];
167+
168+
users.users.demo = {
169+
isNormalUser = true;
170+
password = "demo";
171+
createHome = true;
172+
group = "wheel";
173+
extraGroups = [
174+
"users"
175+
"video"
176+
];
177+
};
178+
}
179+
];
180+
}
181+
)
182+
];
183+
};
184+
}
185+
)
134186
);
135187
}

pubspec.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ packages:
117117
dependency: "direct main"
118118
description:
119119
path: "."
120-
ref: df9b48ac5e9168f148ed1cfe2e4df0d3bd0664f1
121-
resolved-ref: df9b48ac5e9168f148ed1cfe2e4df0d3bd0664f1
120+
ref: e36194128376e093652178cc8fb83430adf124ac
121+
resolved-ref: e36194128376e093652178cc8fb83430adf124ac
122122
url: "https://github.com/ExpidusOS/libexpidus.git"
123123
source: git
124124
version: "0.0.1"

pubspec.lock.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@
144144
"dependency": "direct main",
145145
"description": {
146146
"path": ".",
147-
"ref": "df9b48ac5e9168f148ed1cfe2e4df0d3bd0664f1",
148-
"resolved-ref": "df9b48ac5e9168f148ed1cfe2e4df0d3bd0664f1",
147+
"ref": "e36194128376e093652178cc8fb83430adf124ac",
148+
"resolved-ref": "e36194128376e093652178cc8fb83430adf124ac",
149149
"url": "https://github.com/ExpidusOS/libexpidus.git"
150150
},
151151
"source": "git",

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dependencies:
1212
expidus:
1313
git:
1414
url: https://github.com/ExpidusOS/libexpidus.git
15-
ref: df9b48ac5e9168f148ed1cfe2e4df0d3bd0664f1
15+
ref: e36194128376e093652178cc8fb83430adf124ac
1616
miso:
1717
git:
1818
url: https://github.com/ExpidusOS/miso.git

0 commit comments

Comments
 (0)