Skip to content

Commit ec68cc7

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

File tree

3 files changed

+59
-17
lines changed

3 files changed

+59
-17
lines changed

.github/workflows/update-screenshot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Get screenshot
2525
run: |
2626
nix build .\#screenshot-system \
27-
--print-build-logs -v \
27+
--print-build-logs \
2828
--extra-experimental-features 'nix-command flakes'
2929
3030
- name: Push in gist

flake.nix

Lines changed: 53 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,48 @@
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+
};
169+
170+
Bacon = mk-system {
171+
hostname = "Bacon";
172+
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+
};
155182

156-
Bacon = mk-system "Bacon" (with nhw-mod; [
157-
common-cpu-intel
158-
common-pc-ssd
159-
]);
183+
Gha = mk-system {
184+
hostname = "Gha";
185+
hasHostSpecific = false;
186+
base = {
187+
boot.loader.grub.devices = "nodev";
160188

161-
Toaster = mk-system "Toaster" [ ];
189+
services.xserver = {
190+
enable = true;
191+
windowManager.qtile.enable = true;
192+
};
193+
194+
users.users.${username} = {
195+
isNormalUser = true;
196+
shell = pkgs.zsh;
197+
};
198+
199+
programs.zsh.enable = true;
200+
201+
system.stateVersion = "25.05";
202+
};
203+
};
162204
};
163205
}
164206
);

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)