mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 14:49:14 +00:00
tree-wide: format with nixfmt
Another saturday another useless formatter change. It's my dotfiles, after all alejandra doesn't handle c-style inline comments well.
This commit is contained in:
parent
ec704b5272
commit
ebf8468807
116 changed files with 1895 additions and 1689 deletions
|
|
@ -1 +1 @@
|
|||
{programs.command-not-found.enable = false;}
|
||||
{ programs.command-not-found.enable = false; }
|
||||
|
|
|
|||
|
|
@ -5,15 +5,18 @@
|
|||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
fishNixOSEnabled = config.programs.fish.enable;
|
||||
fishHMEnabled =
|
||||
if config ? home-manager
|
||||
then lib.any (userConfig: userConfig.programs.fish.enable) (lib.attrValues config.home-manager.users)
|
||||
else false;
|
||||
if config ? home-manager then
|
||||
lib.any (userConfig: userConfig.programs.fish.enable) (lib.attrValues config.home-manager.users)
|
||||
else
|
||||
false;
|
||||
|
||||
fishEnabled = fishNixOSEnabled || fishHMEnabled;
|
||||
in {
|
||||
in
|
||||
{
|
||||
environment.pathsToLink = lib.mkIf fishEnabled [
|
||||
"/share/fish/vendor_conf.d"
|
||||
"/share/fish/vendor_completions.d"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{hostname, ...}: {
|
||||
{ hostname, ... }:
|
||||
{
|
||||
networking.hostName = hostname;
|
||||
|
||||
services.openssh = {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{pkgs, ...}: {
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
security.sudo.enable = false;
|
||||
|
||||
environment.systemPackages = [
|
||||
|
|
@ -18,8 +19,8 @@
|
|||
# doas's docs says it searches in a "limited subset of PATH" if it's relative.
|
||||
# I suspect that it doesn't search the PATH added ad-hoc by the nix-shell, also not a good solution.
|
||||
# Also, for some reason, the rule won't match.
|
||||
users = [":wheel"];
|
||||
setEnv = ["PATH"];
|
||||
users = [ ":wheel" ];
|
||||
setEnv = [ "PATH" ];
|
||||
}
|
||||
];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
}:
|
||||
{
|
||||
nix = {
|
||||
package = lib.mkDefault pkgs.nix;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,14 +5,16 @@
|
|||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
cfg = config.services.xscreensaver;
|
||||
in {
|
||||
in
|
||||
{
|
||||
options = {
|
||||
services.xscreensaver.hooks = lib.mkOption {
|
||||
type = with lib.types; attrsOf str;
|
||||
description = "An attrset of events mapped a block of shell command to be run";
|
||||
default = {};
|
||||
default = { };
|
||||
};
|
||||
};
|
||||
|
||||
|
|
@ -20,26 +22,29 @@ in {
|
|||
systemd.user.services = {
|
||||
"xscreensaver-hooks" = {
|
||||
description = "Run commands on xscreensaver events";
|
||||
after = ["graphical-session.target" "xscreensaver.service"];
|
||||
partOf = ["graphical-session.target"];
|
||||
wantedBy = ["graphical-session.target"];
|
||||
script = let
|
||||
handlers =
|
||||
lib.concatMapAttrsStringSep "\n" (event: action: ''
|
||||
after = [
|
||||
"graphical-session.target"
|
||||
"xscreensaver.service"
|
||||
];
|
||||
partOf = [ "graphical-session.target" ];
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
script =
|
||||
let
|
||||
handlers = lib.concatMapAttrsStringSep "\n" (event: action: ''
|
||||
"${event}")
|
||||
( ${action}
|
||||
)
|
||||
;;
|
||||
'')
|
||||
cfg.hooks;
|
||||
in ''
|
||||
xscreensaver-command -watch | while read event rest; do
|
||||
echo "The handler script got \"$event\""
|
||||
case $event in
|
||||
${handlers}
|
||||
esac
|
||||
done
|
||||
'';
|
||||
'') cfg.hooks;
|
||||
in
|
||||
''
|
||||
xscreensaver-command -watch | while read event rest; do
|
||||
echo "The handler script got \"$event\""
|
||||
case $event in
|
||||
${handlers}
|
||||
esac
|
||||
done
|
||||
'';
|
||||
path = [
|
||||
cfg.package # contains xscreensaver-command
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue