Skip to content

Commit 1ca75c8

Browse files
Use GHA for screenshot (lighter)
1 parent e845c72 commit 1ca75c8

File tree

2 files changed

+50
-16
lines changed

2 files changed

+50
-16
lines changed

flake.nix

Lines changed: 45 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,10 @@
107107

108108
packages = {
109109
screenshot-system = import ./screenshot.nix {
110-
inherit (self.nixosConfigurations) Sigmachine;
111110
inherit pkgs username;
111+
112+
# lets use the lightest one
113+
nixos-system = self.nixosConfigurations.Gha;
112114
};
113115

114116
qwerty-fr = pkgs.callPackage ./system/qwerty-fr.nix { };
@@ -127,14 +129,22 @@
127129
./hardware/${key}.hardware-configuration.nix
128130
];
129131

130-
mk-system = hostname: specific-modules:
132+
mk-system =
133+
{ hostname
134+
, hasHostSpecific ? true
135+
, specific-modules ? [ ]
136+
, base ? ./system
137+
,
138+
}:
131139
let
132140
conf = {
133141
specialArgs = {
134142
inherit catppuccin username;
135143
};
136144

137-
modules = [ ./system ] ++ (mk-base-paths hostname) ++ [
145+
modules = [ base ]
146+
++ (lib.optionals hasHostSpecific (mk-base-paths hostname))
147+
++ [
138148
{ networking.hostName = hostname; }
139149
{ nixpkgs.hostPlatform = system; }
140150
{ nixpkgs.pkgs = pkgs; }
@@ -149,16 +159,40 @@
149159
in
150160
{
151161
nixosConfigurations = {
152-
Sigmachine = mk-system "Sigmachine" (with nhw-mod; [
153-
lenovo-thinkpad-p16s-intel-gen2
154-
]);
162+
Sigmachine = mk-system {
163+
hostname = "Sigmachine";
164+
165+
specific-modules = (with nhw-mod; [
166+
lenovo-thinkpad-p16s-intel-gen2
167+
]);
168+
};
155169

156-
Bacon = mk-system "Bacon" (with nhw-mod; [
157-
common-cpu-intel
158-
common-pc-ssd
159-
]);
170+
Bacon = mk-system {
171+
hostname = "Bacon";
160172

161-
Toaster = mk-system "Toaster" [ ];
173+
specific-modules = (with nhw-mod; [
174+
common-cpu-intel
175+
common-pc-ssd
176+
]);
177+
};
178+
179+
Toaster = mk-system {
180+
hostname = "Toaster";
181+
};
182+
183+
Gha = mk-system {
184+
hostname = "Gha";
185+
hasHostSpecific = false;
186+
base = {
187+
services.xserver.windowManager.qtile.enable = true;
188+
users.users.${username} = {
189+
isNormalUser = true;
190+
shell = pkgs.zsh;
191+
};
192+
193+
programs.zsh.enable = true;
194+
};
195+
};
162196
};
163197
}
164198
);

screenshot.nix

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ pkgs, Sigmachine, username }:
1+
{ pkgs, nixos-system, username }:
22
let
33
vm-config = { config, lib, ... }:
44
{
@@ -65,21 +65,21 @@ pkgs.testers.runNixOSTest {
6565
node = {
6666
inherit pkgs;
6767

68-
specialArgs = Sigmachine.conf.specialArgs;
68+
specialArgs = nixos-system.conf.specialArgs;
6969
pkgsReadOnly = false;
7070
};
7171

7272
nodes = {
7373
machine.imports =
74-
Sigmachine.conf.modules
74+
nixos-system.conf.modules
7575
++ [ vm-config ];
7676
};
7777

7878
testScript = ''
7979
with subtest("ensure x starts"):
8080
machine.wait_for_x()
81-
machine.wait_for_file("/home/sigmanificient/.Xauthority")
82-
machine.succeed("xauth merge ~sigmanificient/.Xauthority")
81+
machine.wait_for_file("/home/${username}/.Xauthority")
82+
machine.succeed("xauth merge ~${username}/.Xauthority")
8383
8484
with subtest("ensure we can open a new terminal"):
8585
machine.sleep(2)

0 commit comments

Comments
 (0)