This repository has been archived by the owner on Jan 23, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.nix
69 lines (63 loc) · 1.58 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
{ sources ? import ./npins
, nixpkgs ? sources."nixos-23.11"
, ...
}:
let
nixpkgs-path = nixpkgs;
nixos-path = nixpkgs-path + "/nixos";
in
{
inherit nixpkgs;
mkRebuildScript =
{ nixos-config
, nixpkgs ? nixpkgs-path
, pkgs ? import nixpkgs { }
}:
pkgs.writeShellScriptBin "nixos-rebuild" ''
exec /run/current-system/sw/bin/nixos-rebuild \
-I nixpkgs=${nixpkgs} \
-I nixos-config=${nixos-config} \
"$@"
'';
inherit (import nixos-path {
configuration = { modulesPath, ... }: {
imports = [
(modulesPath + "/virtualisation/qemu-vm.nix")
./module
./examples/minimal.nix
];
virtualisation = {
memorySize = 1024 * 4;
diskSize = 1024 * 2;
cores = 2;
# NOTE: Blindly copied from
# https://discourse.nixos.org/t/problem-with-sway-in-nixos-rebuild-build-vm-how-to-configure-vm/20263/3
qemu.options = [
"-vga none"
"-device virtio-vga-gl"
"-display gtk,gl=on"
];
};
};
}) vm;
pre-commit-check = (import sources."pre-commit-hooks.nix").run {
# Might want to see about using oxalica/nil (an interesting nix language server) for linting.
src = ./.;
hooks = {
statix.enable = true;
deadnix = {
enable = true;
excludes = [ "^npnis\\/.*$" ];
};
nixpkgs-fmt = {
enable = true;
excludes = [ "^npnis\\/.*$" ];
};
markdownlint.enable = true;
typos.enable = true;
};
settings = {
statix.ignore = [ "npins/**" ];
};
};
}