treewide: reformat

This commit is contained in:
Nikodem Rabuliński 2024-03-07 23:10:03 +01:00
parent 8d975c07fa
commit 4eb71e5baf
8 changed files with 63 additions and 73 deletions

View file

@ -54,10 +54,9 @@ in
inherit (herculesCI) config; inherit (herculesCI) config;
inherit pkgs; inherit pkgs;
}; };
cachixCommands = cachixCommands = lib.concatMapStringsSep "\n" (
lib.concatMapStringsSep "\n" { name, drv }: "cachix pin nrabulinski ${lib.escapeShellArg name} ${lib.escapeShellArg drv}"
({ name, drv }: "cachix pin nrabulinski ${lib.escapeShellArg name} ${lib.escapeShellArg drv}") ) collected;
collected;
in in
hci-effects.runIf (herculesCI.config.repo.branch == "main") ( hci-effects.runIf (herculesCI.config.repo.branch == "main") (
hci-effects.mkEffect { hci-effects.mkEffect {
@ -93,13 +92,11 @@ in
let let
systems = lib.groupBy ({ drv, ... }: drv.system) legacyPackages.outputsList; systems = lib.groupBy ({ drv, ... }: drv.system) legacyPackages.outputsList;
in in
lib.concatMapStringsSep "\n" lib.concatMapStringsSep "\n" (
( { name, value }:
{ name, value }: ''
'' ${name}=${builtins.toJSON (map (d: d.name) value)}
${name}=${builtins.toJSON (map (d: d.name) value)} ''
'' ) (lib.attrsToList systems);
)
(lib.attrsToList systems);
}; };
} }

View file

@ -133,24 +133,25 @@
}; };
}; };
/* TODO: Uncomment once (if ever?) nixConfig makes sense in flakes /*
nixConfig = { TODO: Uncomment once (if ever?) nixConfig makes sense in flakes
extra-substituters = [ nixConfig = {
"https://hyprland.cachix.org" extra-substituters = [
"https://cache.garnix.io" "https://hyprland.cachix.org"
"https://nix-community.cachix.org" "https://cache.garnix.io"
"https://hercules-ci.cachix.org" "https://nix-community.cachix.org"
"https://nrabulinski.cachix.org" "https://hercules-ci.cachix.org"
"https://cache.nrab.lol" "https://nrabulinski.cachix.org"
]; "https://cache.nrab.lol"
extra-trusted-public-keys = [ ];
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" extra-trusted-public-keys = [
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
"hercules-ci.cachix.org-1:ZZeDl9Va+xe9j+KqdzoBZMFJHVQ42Uu/c/1/KMC5Lw0=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"nrabulinski.cachix.org-1:Q5FD7+1c68uH74CQK66UWNzxhanZW8xcg1LFXxGK8ic=" "hercules-ci.cachix.org-1:ZZeDl9Va+xe9j+KqdzoBZMFJHVQ42Uu/c/1/KMC5Lw0="
"cache.nrab.lol-1:CJl1TouOyuJ1Xh4tZSXLwm3Upt06HzUNZmeyuEB9EZg=" "nrabulinski.cachix.org-1:Q5FD7+1c68uH74CQK66UWNzxhanZW8xcg1LFXxGK8ic="
]; "cache.nrab.lol-1:CJl1TouOyuJ1Xh4tZSXLwm3Upt06HzUNZmeyuEB9EZg="
}; ];
};
*/ */
} }

View file

@ -5,16 +5,13 @@
skhdConfig = skhdConfig =
let let
spaceCount = 6; spaceCount = 6;
spaceBindings = spaceBindings = lib.genList (
lib.genList i:
( let
i: num = toString (i + 1);
let in
num = toString (i + 1); "cmd - ${num} : yabai -m space --focus ${num}"
in ) spaceCount;
"cmd - ${num} : yabai -m space --focus ${num}"
)
spaceCount;
in in
'' ''
cmd - return : wezterm cmd - return : wezterm

View file

@ -41,14 +41,11 @@
hardware.steam-hardware.enable = true; hardware.steam-hardware.enable = true;
services.logind = services.logind = lib.genAttrs [
lib.genAttrs "lidSwitch"
[ "lidSwitchDocked"
"lidSwitch" "lidSwitchExternalPower"
"lidSwitchDocked" ] (_: "ignore");
"lidSwitchExternalPower"
]
(_: "ignore");
services.pipewire = { services.pipewire = {
enable = true; enable = true;

View file

@ -1,7 +1,8 @@
args: args:
/* let /*
bootDevice = args.bootDevice or "/dev/nvme0n1"; let
in bootDevice = args.bootDevice or "/dev/nvme0n1";
in
*/ */
{ {
assertions = [ assertions = [

View file

@ -22,22 +22,20 @@ let
services.github-runners = lib.pipe cfg.runners [ services.github-runners = lib.pipe cfg.runners [
(lib.mapAttrsToList ( (lib.mapAttrsToList (
name: cfg: name: cfg:
lib.genList lib.genList (
( i:
i: lib.nameValuePair "${name}-${toString i}" {
lib.nameValuePair "${name}-${toString i}" { enable = true;
enable = true; tokenFile = config.age.secrets.github-token.path;
tokenFile = config.age.secrets.github-token.path; inherit (cfg) url;
inherit (cfg) url; name = "${cfg.name}-${toString i}";
name = "${cfg.name}-${toString i}"; user = github-runner-user;
user = github-runner-user; serviceOverrides = {
serviceOverrides = { DynamicUser = false;
DynamicUser = false; };
}; extraLabels = [ "nix" ];
extraLabels = [ "nix" ]; }
} ) cfg.instances
)
cfg.instances
)) ))
lib.flatten lib.flatten
lib.listToAttrs lib.listToAttrs

View file

@ -43,8 +43,7 @@ let
let let
configName' = configName' =
args.configurationName args.configurationName
or (throw "pass configurationName to module arguments or set users.users.${username}.openssh.authorizedKeys yourself" or (throw "pass configurationName to module arguments or set users.users.${username}.openssh.authorizedKeys yourself");
);
filteredKeys = lib.filterAttrs (name: _: name != configName') cfg.allSshKeys; filteredKeys = lib.filterAttrs (name: _: name != configName') cfg.allSshKeys;
in in
lib.mkDefault (lib.attrValues filteredKeys); lib.mkDefault (lib.attrValues filteredKeys);

View file

@ -12,9 +12,9 @@
prependFlags = prependFlags =
let let
# Can't rely on pathAdd because fish used as login shell will ignore the variables the wrapper sets up # Can't rely on pathAdd because fish used as login shell will ignore the variables the wrapper sets up
path-add-lines = path-add-lines = lib.concatMapStringsSep "\n" (
lib.concatMapStringsSep "\n" (pkg: "fish_add_path --path --prepend '${lib.getExe' pkg ""}'") pkg: "fish_add_path --path --prepend '${lib.getExe' pkg ""}'"
config.pathAdd; ) config.pathAdd;
config-fish = pkgs.writeText "config.fish" '' config-fish = pkgs.writeText "config.fish" ''
${path-add-lines} ${path-add-lines}