statix hints
This commit is contained in:
parent
57123b08e1
commit
ce0dc51535
|
@ -32,10 +32,10 @@ let
|
||||||
"zdf.de"
|
"zdf.de"
|
||||||
];
|
];
|
||||||
|
|
||||||
makeConfig = hostName: imports: {...}: {
|
makeConfig = hostName: imports: _: {
|
||||||
imports = imports ++ [./roles/default.nix];
|
imports = imports ++ [./roles/default.nix];
|
||||||
m-0.hostName = hostName;
|
m-0.hostName = hostName;
|
||||||
nixpkgs.overlays = [(_: _: (import ../channels.nix).${hostName})];
|
nixpkgs.overlays = [(_: _: (import ../channels.nix)."${hostName}")];
|
||||||
};
|
};
|
||||||
makeAutostart = name: {config, ...}: {
|
makeAutostart = name: {config, ...}: {
|
||||||
config.xdg.configFile."autostart/${name}.desktop".source = "${config.home.path}/share/applications/${name}.desktop";
|
config.xdg.configFile."autostart/${name}.desktop".source = "${config.home.path}/share/applications/${name}.desktop";
|
||||||
|
|
|
@ -205,7 +205,7 @@
|
||||||
|
|
||||||
systemd.user = {
|
systemd.user = {
|
||||||
startServices = true;
|
startServices = true;
|
||||||
sessionVariables = config.home.sessionVariables;
|
inherit (config.home) sessionVariables;
|
||||||
};
|
};
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
|
|
|
@ -5,13 +5,13 @@
|
||||||
}: let
|
}: let
|
||||||
simpleDesktopItem = name: command:
|
simpleDesktopItem = name: command:
|
||||||
pkgs.makeDesktopItem {
|
pkgs.makeDesktopItem {
|
||||||
name = name;
|
inherit name;
|
||||||
desktopName = name;
|
desktopName = name;
|
||||||
exec = command;
|
exec = command;
|
||||||
};
|
};
|
||||||
namedTerminalDesktopItem = name: command:
|
namedTerminalDesktopItem = name: command:
|
||||||
pkgs.makeDesktopItem {
|
pkgs.makeDesktopItem {
|
||||||
name = name;
|
inherit name;
|
||||||
desktopName = name;
|
desktopName = name;
|
||||||
exec = command;
|
exec = command;
|
||||||
terminal = "true";
|
terminal = "true";
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
{...}: {
|
_: {
|
||||||
programs.git.signing.key = "6C3D12CD88CDF46C5EAF4D12226A2D41EF5378C9";
|
programs.git.signing.key = "6C3D12CD88CDF46C5EAF4D12226A2D41EF5378C9";
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
...
|
...
|
||||||
} @ args: let
|
} @ args: let
|
||||||
hotkeys = import ./hotkeys.nix args;
|
hotkeys = import ./hotkeys.nix args;
|
||||||
mkTuple = lib.hm.gvariant.mkTuple;
|
inherit (lib.hm.gvariant) mkTuple;
|
||||||
statusScript = pkgs.writeHaskellScript
|
statusScript = pkgs.writeHaskellScript
|
||||||
{
|
{
|
||||||
name = "status-script";
|
name = "status-script";
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{...}: {
|
_: {
|
||||||
services = {
|
services = {
|
||||||
mpd = {
|
mpd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (config.m-0) hostName;
|
inherit (config.m-0) hostName;
|
||||||
modes = pkgs.lib.attrNames (import ../machines.nix).${hostName};
|
modes = pkgs.lib.attrNames (import ../machines.nix)."${hostName}";
|
||||||
modeFile = "${config.home.homeDirectory}/.mode";
|
modeFile = "${config.home.homeDirectory}/.mode";
|
||||||
modeDir = "${config.home.homeDirectory}/.volatile/modes";
|
modeDir = "${config.home.homeDirectory}/.volatile/modes";
|
||||||
configPath = "${config.home.homeDirectory}/git/config";
|
configPath = "${config.home.homeDirectory}/git/config";
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
with lib; let
|
with lib; let
|
||||||
dag = config.lib.dag;
|
inherit (config.lib) dag;
|
||||||
in {
|
in {
|
||||||
home.activation.report-changes = dag.entryAnywhere ''
|
home.activation.report-changes = dag.entryAnywhere ''
|
||||||
if [[ -n "$oldGenPath" && "$oldGenPath" != "$newGenPath" ]]; then
|
if [[ -n "$oldGenPath" && "$oldGenPath" != "$newGenPath" ]]; then
|
||||||
|
|
|
@ -29,58 +29,4 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
programs.kitty = {
|
|
||||||
enable = true;
|
|
||||||
keybindings = {
|
|
||||||
"ctrl+plus" = "change_font_size all +1.0";
|
|
||||||
"ctrl+minus" = "change_font_size all -1.0";
|
|
||||||
};
|
|
||||||
settings = {
|
|
||||||
linux_display_server = "wayland"; # Causes ugly decorations
|
|
||||||
hide_window_decorations = true;
|
|
||||||
window_margin_width = 2;
|
|
||||||
strip_trailing_spaces = "always";
|
|
||||||
|
|
||||||
font_size = "10.5";
|
|
||||||
|
|
||||||
foreground = theme.primary.foreground;
|
|
||||||
background = theme.primary.background;
|
|
||||||
|
|
||||||
selection_foreground = theme.primary.background;
|
|
||||||
selection_background = theme.primary.foreground;
|
|
||||||
background_opacity = "0.9";
|
|
||||||
background_tint = "0.9";
|
|
||||||
|
|
||||||
# black
|
|
||||||
color0 = theme.normal.white;
|
|
||||||
color8 = theme.bright.white;
|
|
||||||
|
|
||||||
# red
|
|
||||||
color1 = theme.normal.red;
|
|
||||||
color9 = theme.bright.red;
|
|
||||||
|
|
||||||
# green
|
|
||||||
color2 = theme.normal.green;
|
|
||||||
color10 = theme.bright.green;
|
|
||||||
|
|
||||||
# yellow
|
|
||||||
color3 = theme.normal.yellow;
|
|
||||||
color11 = theme.bright.yellow;
|
|
||||||
|
|
||||||
# blue
|
|
||||||
color4 = theme.normal.blue;
|
|
||||||
color12 = theme.bright.blue;
|
|
||||||
|
|
||||||
# magenta
|
|
||||||
color5 = theme.normal.magenta;
|
|
||||||
color13 = theme.bright.magenta;
|
|
||||||
|
|
||||||
# cyan
|
|
||||||
color6 = theme.normal.cyan;
|
|
||||||
color14 = theme.bright.cyan;
|
|
||||||
|
|
||||||
color7 = theme.normal.black;
|
|
||||||
color15 = theme.bright.black;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{...}: {
|
_: {
|
||||||
dconf.settings = {
|
dconf.settings = {
|
||||||
"org/gnome/desktop/screensaver" = {
|
"org/gnome/desktop/screensaver" = {
|
||||||
lock-enabled = false;
|
lock-enabled = false;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{...}: {
|
_: {
|
||||||
dconf.settings = {
|
dconf.settings = {
|
||||||
"org/gnome/desktop/screensaver" = {
|
"org/gnome/desktop/screensaver" = {
|
||||||
lock-enabled = true;
|
lock-enabled = true;
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
(pkgs.formats.ini {}).generate "vdirsyncer-config" (
|
(pkgs.formats.ini {}).generate "vdirsyncer-config" (
|
||||||
lib.mapAttrs
|
lib.mapAttrs
|
||||||
(
|
(
|
||||||
name: section: (lib.mapAttrs (name: option: builtins.toJSON option) section)
|
_: lib.mapAttrs (_: builtins.toJSON)
|
||||||
)
|
)
|
||||||
config
|
config
|
||||||
);
|
);
|
||||||
|
|
|
@ -9,8 +9,8 @@ with lib; let
|
||||||
configure = {availablePlugins, ...}: {
|
configure = {availablePlugins, ...}: {
|
||||||
plugins = builtins.attrValues (availablePlugins
|
plugins = builtins.attrValues (availablePlugins
|
||||||
// {
|
// {
|
||||||
python = (availablePlugins.python.withPackages
|
python = availablePlugins.python.withPackages
|
||||||
(ps: [pkgs.weechatScripts.weechat-matrix]));
|
(ps: [pkgs.weechatScripts.weechat-matrix]);
|
||||||
});
|
});
|
||||||
scripts = [pkgs.weechatScripts.weechat-matrix];
|
scripts = [pkgs.weechatScripts.weechat-matrix];
|
||||||
};
|
};
|
||||||
|
|
|
@ -13,6 +13,6 @@ in {
|
||||||
notes = [
|
notes = [
|
||||||
"${config.home.homeDirectory}/git/notes" # add as many layers as you like
|
"${config.home.homeDirectory}/git/notes" # add as many layers as you like
|
||||||
];
|
];
|
||||||
package = emanote.defaultPackage.${builtins.currentSystem};
|
package = emanote.defaultPackage."${builtins.currentSystem}";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,9 +2,9 @@ let
|
||||||
sources = import ../nix/sources.nix;
|
sources = import ../nix/sources.nix;
|
||||||
inherit (import sources.nixos-unstable {}) lib pkgs;
|
inherit (import sources.nixos-unstable {}) lib pkgs;
|
||||||
modes = import ./machines.nix;
|
modes = import ./machines.nix;
|
||||||
home-manager = channel: import "${sources.${channel}}/home-manager/home-manager.nix";
|
home-manager = channel: import "${sources."${channel}"}/home-manager/home-manager.nix";
|
||||||
buildHomeManager = host: mode:
|
buildHomeManager = host: mode:
|
||||||
(home-manager (import ../channels.nix).${host}.home-manager-channel {
|
(home-manager (import ../channels.nix)."${host}".home-manager-channel {
|
||||||
confPath = ../home.nix;
|
confPath = ../home.nix;
|
||||||
confAttr = "${host}-${mode}";
|
confAttr = "${host}-${mode}";
|
||||||
})
|
})
|
||||||
|
|
5
home.nix
5
home.nix
|
@ -3,11 +3,12 @@ let
|
||||||
modes = import home-manager/machines.nix;
|
modes = import home-manager/machines.nix;
|
||||||
in
|
in
|
||||||
lib.listToAttrs (lib.flatten (lib.mapAttrsToList
|
lib.listToAttrs (lib.flatten (lib.mapAttrsToList
|
||||||
(host: configs:
|
(
|
||||||
|
host:
|
||||||
lib.mapAttrsToList
|
lib.mapAttrsToList
|
||||||
(mode: config: {
|
(mode: config: {
|
||||||
name = "${host}-${mode}";
|
name = "${host}-${mode}";
|
||||||
value = config;
|
value = config;
|
||||||
})
|
})
|
||||||
configs)
|
)
|
||||||
modes))
|
modes))
|
||||||
|
|
|
@ -117,7 +117,7 @@ let
|
||||||
# the path directly as opposed to the fetched source.
|
# the path directly as opposed to the fetched source.
|
||||||
replace = name: drv: let
|
replace = name: drv: let
|
||||||
saneName = stringAsChars (c:
|
saneName = stringAsChars (c:
|
||||||
if isNull (builtins.match "[a-zA-Z0-9]" c)
|
if ((builtins.match "[a-zA-Z0-9]" c) == null)
|
||||||
then "_"
|
then "_"
|
||||||
else c)
|
else c)
|
||||||
name;
|
name;
|
||||||
|
@ -142,7 +142,7 @@ let
|
||||||
with builtins;
|
with builtins;
|
||||||
listToAttrs (map (attr: {
|
listToAttrs (map (attr: {
|
||||||
name = attr;
|
name = attr;
|
||||||
value = f attr set.${attr};
|
value = f attr set."${attr}";
|
||||||
}) (attrNames set))
|
}) (attrNames set))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -175,7 +175,7 @@ let
|
||||||
inherit (builtins) lessThan nixVersion fetchTarball;
|
inherit (builtins) lessThan nixVersion fetchTarball;
|
||||||
in
|
in
|
||||||
if lessThan nixVersion "1.12"
|
if lessThan nixVersion "1.12"
|
||||||
then fetchTarball ({inherit url;} // (optionalAttrs (!isNull name) {inherit name;}))
|
then fetchTarball ({inherit url;} // (optionalAttrs (!(name == null)) {inherit name;}))
|
||||||
else fetchTarball attrs;
|
else fetchTarball attrs;
|
||||||
|
|
||||||
# fetchurl version that is compatible between all the versions of Nix
|
# fetchurl version that is compatible between all the versions of Nix
|
||||||
|
@ -187,7 +187,7 @@ let
|
||||||
inherit (builtins) lessThan nixVersion fetchurl;
|
inherit (builtins) lessThan nixVersion fetchurl;
|
||||||
in
|
in
|
||||||
if lessThan nixVersion "1.12"
|
if lessThan nixVersion "1.12"
|
||||||
then fetchurl ({inherit url;} // (optionalAttrs (!isNull name) {inherit name;}))
|
then fetchurl ({inherit url;} // (optionalAttrs (!(name == null)) {inherit name;}))
|
||||||
else fetchurl attrs;
|
else fetchurl attrs;
|
||||||
|
|
||||||
# Create the final "sources" from the config
|
# Create the final "sources" from the config
|
||||||
|
@ -210,7 +210,7 @@ let
|
||||||
then ./sources.json
|
then ./sources.json
|
||||||
else null,
|
else null,
|
||||||
sources ?
|
sources ?
|
||||||
if isNull sourcesFile
|
if (sourcesFile == null)
|
||||||
then {}
|
then {}
|
||||||
else builtins.fromJSON (builtins.readFile sourcesFile),
|
else builtins.fromJSON (builtins.readFile sourcesFile),
|
||||||
system ? builtins.currentSystem,
|
system ? builtins.currentSystem,
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
}: let
|
}: let
|
||||||
wireguard = import ../../../common/wireguard.nix;
|
wireguard = import ../../../common/wireguard.nix;
|
||||||
inherit (config.m-0) hosts prefix;
|
inherit (config.m-0) hosts prefix;
|
||||||
nixos-hardware = (import ../../../nix/sources.nix).nixos-hardware;
|
inherit ((import ../../../nix/sources.nix)) nixos-hardware;
|
||||||
inherit (import ../../../common/common.nix {inherit pkgs;}) syncthing;
|
inherit (import ../../../common/common.nix {inherit pkgs;}) syncthing;
|
||||||
vpn = (import ../../../private.nix).privateValue (_: _: {}) "vpn";
|
vpn = (import ../../../private.nix).privateValue (_: _: {}) "vpn";
|
||||||
in {
|
in {
|
||||||
|
|
|
@ -89,7 +89,7 @@ in {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
// lib.listToAttrs (map (name: {
|
// lib.listToAttrs (map (name: {
|
||||||
name = name;
|
inherit name;
|
||||||
value = {serviceConfig.Type = "oneshot";};
|
value = {serviceConfig.Type = "oneshot";};
|
||||||
})
|
})
|
||||||
backupJobNames);
|
backupJobNames);
|
||||||
|
|
|
@ -6,8 +6,7 @@
|
||||||
}: let
|
}: let
|
||||||
wireguard = import ../../../common/wireguard.nix;
|
wireguard = import ../../../common/wireguard.nix;
|
||||||
inherit (config.m-0) hosts prefix;
|
inherit (config.m-0) hosts prefix;
|
||||||
nixos-hardware = (import ../../../nix/sources.nix).nixos-hardware;
|
inherit (import ../../../nix/sources.nix) nixos-hardware nixos-unstable;
|
||||||
nixos-unstable = (import ../../../nix/sources.nix).nixos-unstable;
|
|
||||||
inherit (import ../../../common/common.nix {inherit pkgs;}) syncthing;
|
inherit (import ../../../common/common.nix {inherit pkgs;}) syncthing;
|
||||||
vpn = (import ../../../private.nix).privateValue (_: _: {}) "vpn";
|
vpn = (import ../../../private.nix).privateValue (_: _: {}) "vpn";
|
||||||
in {
|
in {
|
||||||
|
|
|
@ -26,7 +26,7 @@ in {
|
||||||
allowedTCPPorts = ports;
|
allowedTCPPorts = ports;
|
||||||
allowedUDPPorts = ports;
|
allowedUDPPorts = ports;
|
||||||
};
|
};
|
||||||
security.acme.certs.${fqdn} = {
|
security.acme.certs."${fqdn}" = {
|
||||||
postRun = "systemctl restart coturn.service";
|
postRun = "systemctl restart coturn.service";
|
||||||
};
|
};
|
||||||
services = {
|
services = {
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
# For nixos-rebuild
|
# For nixos-rebuild
|
||||||
nixpkgs.overlays =
|
nixpkgs.overlays =
|
||||||
[(_: _: (import ../../channels.nix).${config.networking.hostName})]
|
[(_: _: (import ../../channels.nix)."${config.networking.hostName}")]
|
||||||
++ import ../../overlays {inherit lib;};
|
++ import ../../overlays {inherit lib;};
|
||||||
|
|
||||||
time.timeZone = "Europe/Berlin";
|
time.timeZone = "Europe/Berlin";
|
||||||
|
@ -44,10 +44,10 @@
|
||||||
(name: value: lib.nameValuePair "nix-path/${name}" {source = value;})
|
(name: value: lib.nameValuePair "nix-path/${name}" {source = value;})
|
||||||
(lib.filterAttrs (name: value: name != "__functor") pkgs.sources)
|
(lib.filterAttrs (name: value: name != "__functor") pkgs.sources)
|
||||||
// {
|
// {
|
||||||
"nix-path/nixos".source = pkgs.sources.${pkgs.nixpkgs-channel};
|
"nix-path/nixos".source = pkgs.sources."${pkgs.nixpkgs-channel}";
|
||||||
"nix-path/nixpkgs".source = pkgs.sources.${pkgs.nixpkgs-channel};
|
"nix-path/nixpkgs".source = pkgs.sources."${pkgs.nixpkgs-channel}";
|
||||||
"nix-path/home-manager".source =
|
"nix-path/home-manager".source =
|
||||||
pkgs.sources.${pkgs.home-manager-channel};
|
pkgs.sources."${pkgs.home-manager-channel}";
|
||||||
};
|
};
|
||||||
variables =
|
variables =
|
||||||
lib.genAttrs ["CURL_CA_BUNDLE" "GIT_SSL_CAINFO" "SSL_CERT_FILE"]
|
lib.genAttrs ["CURL_CA_BUNDLE" "GIT_SSL_CAINFO" "SSL_CERT_FILE"]
|
||||||
|
@ -112,7 +112,7 @@
|
||||||
disabledCollectors = ["timex"];
|
disabledCollectors = ["timex"];
|
||||||
};
|
};
|
||||||
nginx = {
|
nginx = {
|
||||||
enable = config.services.nginx.enable;
|
inherit (config.services.nginx) enable;
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{...}: {
|
_: {
|
||||||
services.earlyoom = {
|
services.earlyoom = {
|
||||||
enableNotifications = true;
|
enableNotifications = true;
|
||||||
freeSwapThreshold = 100;
|
freeSwapThreshold = 100;
|
||||||
|
|
|
@ -178,12 +178,12 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
users.users.${user} = {
|
users.users."${user}" = {
|
||||||
inherit group;
|
inherit group;
|
||||||
isSystemUser = true;
|
isSystemUser = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
users.groups.${group} = {};
|
users.groups."${group}" = {};
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
firefox.syncserver = {
|
firefox.syncserver = {
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
builtins.listToAttrs (lib.imap0
|
builtins.listToAttrs (lib.imap0
|
||||||
(n: v:
|
(n: v:
|
||||||
lib.nameValuePair "src-cache/fonts/${toString n}" {
|
lib.nameValuePair "src-cache/fonts/${toString n}" {
|
||||||
source = builtins.toPath v;
|
source = /. + v;
|
||||||
})
|
})
|
||||||
font_sources);
|
font_sources);
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
declarativeConfigFile = builtins.toFile "foundry-options.json" (builtins.toJSON config);
|
declarativeConfigFile = builtins.toFile "foundry-options.json" (builtins.toJSON config);
|
||||||
in {
|
in {
|
||||||
config = {
|
config = {
|
||||||
systemd.services.${name} = {
|
systemd.services."${name}" = {
|
||||||
wantedBy = ["multi-user.target"];
|
wantedBy = ["multi-user.target"];
|
||||||
description = "Foundryvtt server";
|
description = "Foundryvtt server";
|
||||||
preStart = ''
|
preStart = ''
|
||||||
|
@ -49,7 +49,7 @@ in {
|
||||||
services = {
|
services = {
|
||||||
nginx = {
|
nginx = {
|
||||||
virtualHosts = {
|
virtualHosts = {
|
||||||
${config.hostname} = {
|
"${config.hostname}" = {
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
client_max_body_size 300M;
|
client_max_body_size 300M;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
|
|
|
@ -101,7 +101,7 @@ in {
|
||||||
];
|
];
|
||||||
users.users.cgit = {
|
users.users.cgit = {
|
||||||
isSystemUser = true;
|
isSystemUser = true;
|
||||||
group = gitoliteCfg.group;
|
inherit (gitoliteCfg) group;
|
||||||
};
|
};
|
||||||
systemd.services.gitolite-init.postStart = lib.mkIf pkgs.withSecrets ''
|
systemd.services.gitolite-init.postStart = lib.mkIf pkgs.withSecrets ''
|
||||||
export GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no"
|
export GIT_SSH_COMMAND="ssh -o StrictHostKeyChecking=no"
|
||||||
|
@ -133,7 +133,7 @@ in {
|
||||||
fcgiwrap = {
|
fcgiwrap = {
|
||||||
enable = true;
|
enable = true;
|
||||||
user = "cgit";
|
user = "cgit";
|
||||||
group = gitoliteCfg.group;
|
inherit (gitoliteCfg) group;
|
||||||
};
|
};
|
||||||
|
|
||||||
nginx.virtualHosts."git.maralorn.de" = {
|
nginx.virtualHosts."git.maralorn.de" = {
|
||||||
|
|
|
@ -5,7 +5,7 @@ lib: rec {
|
||||||
${default}
|
${default}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
'';
|
'';
|
||||||
if' = condition: ifTrue: ifFalse: case ifFalse {${condition} = ifTrue;};
|
if' = condition: ifTrue: ifFalse: case ifFalse {"${condition}" = ifTrue;};
|
||||||
or = lhs: rhs: "(${lhs} or ${rhs})";
|
or = lhs: rhs: "(${lhs} or ${rhs})";
|
||||||
and = lhs: rhs: "(${lhs} and ${rhs})";
|
and = lhs: rhs: "(${lhs} and ${rhs})";
|
||||||
isState = entity: state: "is_state('${entity}','${state}')";
|
isState = entity: state: "is_state('${entity}','${state}')";
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
lib: let
|
lib:
|
||||||
# name refers to an internal name
|
# name refers to an internal name
|
||||||
# title refers to a human readable name
|
# title refers to a human readable name
|
||||||
# mode = { name, title, options = { <option_name> : { title , icon } } }
|
# mode = { name, title, options = { <option_name> : { title , icon } } }
|
||||||
in rec {
|
rec {
|
||||||
jinja = import ./jinja.nix lib;
|
jinja = import ./jinja.nix lib;
|
||||||
tap_actions = let
|
tap_actions = let
|
||||||
fromServiceAction = action: {
|
fromServiceAction = action: {
|
||||||
|
@ -60,11 +60,11 @@ in rec {
|
||||||
mkHAConfig = attrs: {
|
mkHAConfig = attrs: {
|
||||||
services.home-assistant.config = attrs;
|
services.home-assistant.config = attrs;
|
||||||
};
|
};
|
||||||
mkModeSwitcher = mode: attrs: {...}: let
|
mkModeSwitcher = mode: attrs: _: let
|
||||||
options = builtins.attrNames mode.options;
|
options = builtins.attrNames mode.options;
|
||||||
in
|
in
|
||||||
mkHAConfig {
|
mkHAConfig {
|
||||||
input_select.${util.modeSelectName mode} =
|
input_select."${util.modeSelectName mode}" =
|
||||||
{
|
{
|
||||||
inherit options;
|
inherit options;
|
||||||
name = mode.title;
|
name = mode.title;
|
||||||
|
|
|
@ -54,8 +54,7 @@
|
||||||
'';
|
'';
|
||||||
systems = builtins.attrNames (builtins.readDir ../../machines);
|
systems = builtins.attrNames (builtins.readDir ../../machines);
|
||||||
homes = lib.attrNames (import ../../../home-manager/machines.nix);
|
homes = lib.attrNames (import ../../../home-manager/machines.nix);
|
||||||
mkHomeJob = (
|
mkHomeJob = host: {
|
||||||
host: {
|
|
||||||
name = "home-config-${host}.run";
|
name = "home-config-${host}.run";
|
||||||
value = pkgs.writeShellScript "test-${host}-home-config.run" ''
|
value = pkgs.writeShellScript "test-${host}-home-config.run" ''
|
||||||
${common}
|
${common}
|
||||||
|
@ -64,10 +63,8 @@
|
||||||
git -C $REPODIR submodule update --init
|
git -C $REPODIR submodule update --init
|
||||||
${test-home-config}/bin/test-home-config $REPODIR ${host} ""
|
${test-home-config}/bin/test-home-config $REPODIR ${host} ""
|
||||||
'';
|
'';
|
||||||
}
|
};
|
||||||
);
|
mkSystemJob = host: {
|
||||||
mkSystemJob = (
|
|
||||||
host: {
|
|
||||||
name = "system-config-${host}.run";
|
name = "system-config-${host}.run";
|
||||||
value = pkgs.writeShellScript "test-${host}-system-config.run" ''
|
value = pkgs.writeShellScript "test-${host}-system-config.run" ''
|
||||||
${common}
|
${common}
|
||||||
|
@ -76,8 +73,7 @@
|
||||||
git -C $REPODIR submodule update --init
|
git -C $REPODIR submodule update --init
|
||||||
${test-system-config}/bin/test-system-config $REPODIR ${host} ""
|
${test-system-config}/bin/test-system-config $REPODIR ${host} ""
|
||||||
'';
|
'';
|
||||||
}
|
};
|
||||||
);
|
|
||||||
deployCommand = "${
|
deployCommand = "${
|
||||||
pkgs.writeShellScript "deploy-system-config"
|
pkgs.writeShellScript "deploy-system-config"
|
||||||
"${pkgs.systemd}/bin/systemctl start --no-block update-config"
|
"${pkgs.systemd}/bin/systemctl start --no-block update-config"
|
||||||
|
|
|
@ -14,7 +14,7 @@ in {
|
||||||
(
|
(
|
||||||
x: ''
|
x: ''
|
||||||
${cfg.package}/bin/mailman syncmembers -W -G - "${x}" << EOF
|
${cfg.package}/bin/mailman syncmembers -W -G - "${x}" << EOF
|
||||||
${lib.concatStringsSep "\n" lists.${x}}
|
${lib.concatStringsSep "\n" lists."${x}"}
|
||||||
EOF
|
EOF
|
||||||
''
|
''
|
||||||
)
|
)
|
||||||
|
@ -68,7 +68,7 @@ in {
|
||||||
local_recipient_maps = lmtp;
|
local_recipient_maps = lmtp;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
nginx.virtualHosts.${hostname} = {
|
nginx.virtualHosts."${hostname}" = {
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
};
|
};
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
inherit
|
inherit
|
||||||
(import ../../../lib/update-system.nix {
|
(import ../../../lib/update-system.nix {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
nixos-rebuild = config.system.build.nixos-rebuild;
|
inherit (config.system.build) nixos-rebuild;
|
||||||
})
|
})
|
||||||
update-system
|
update-system
|
||||||
;
|
;
|
||||||
|
|
|
@ -6,9 +6,7 @@ in {
|
||||||
nix = self.nix_2_4;
|
nix = self.nix_2_4;
|
||||||
unstableHaskellPackages = unstable.haskellPackages;
|
unstableHaskellPackages = unstable.haskellPackages;
|
||||||
unstableGhc = unstable.ghc;
|
unstableGhc = unstable.ghc;
|
||||||
home-assistant = unstable.home-assistant;
|
inherit (unstable) home-assistant vscode-extensions vscode;
|
||||||
vscode-extensions = unstable.vscode-extensions;
|
|
||||||
vscode = unstable.vscode;
|
|
||||||
nix-output-monitor = unstable.nix-output-monitor.overrideAttrs (old: {
|
nix-output-monitor = unstable.nix-output-monitor.overrideAttrs (old: {
|
||||||
src = super.sources.nix-output-monitor;
|
src = super.sources.nix-output-monitor;
|
||||||
buildInputs = old.buildInputs ++ (with unstable.haskellPackages; [streamly optics generic-optics extra safe MemoTrie]);
|
buildInputs = old.buildInputs ++ (with unstable.haskellPackages; [streamly optics generic-optics extra safe MemoTrie]);
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
let
|
|
||||||
pkgs = import (import ../../nix/sources.nix).nixos-unstable {};
|
|
||||||
inherit (pkgs) lib;
|
|
||||||
myPkgs = (import ./packages.nix).makeHaskellPackages (pkgs.haskellPackages);
|
|
||||||
in
|
|
||||||
lib.attrNames (lib.filterAttrs (_: pkg: [] == pkg.meta.maintainers or []) myPkgs)
|
|
|
@ -7,7 +7,7 @@ final: prev: let
|
||||||
["mkdir -p ${path}"]
|
["mkdir -p ${path}"]
|
||||||
++ lib.concatLists (
|
++ lib.concatLists (
|
||||||
lib.mapAttrsToList
|
lib.mapAttrsToList
|
||||||
(dirName: content: linkToPath "${path}/${dirName}" content)
|
(dirName: linkToPath "${path}/${dirName}")
|
||||||
fileOrDir
|
fileOrDir
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
|
@ -35,9 +35,9 @@
|
||||||
// overrides
|
// overrides
|
||||||
// {
|
// {
|
||||||
pname = overrides.type;
|
pname = overrides.type;
|
||||||
version = source.version;
|
inherit (source) version;
|
||||||
|
|
||||||
patches = (source.patches or []);
|
patches = source.patches or [];
|
||||||
nativeBuildInputs =
|
nativeBuildInputs =
|
||||||
[pkg-config python3 cmake]
|
[pkg-config python3 cmake]
|
||||||
++ (overrides.nativeBuildInputs or []);
|
++ (overrides.nativeBuildInputs or []);
|
||||||
|
@ -115,8 +115,7 @@
|
||||||
}
|
}
|
||||||
source;
|
source;
|
||||||
|
|
||||||
server = source:
|
server = generic
|
||||||
generic
|
|
||||||
{
|
{
|
||||||
type = "murmur";
|
type = "murmur";
|
||||||
|
|
||||||
|
@ -132,8 +131,7 @@
|
||||||
# bin stuff
|
# bin stuff
|
||||||
install -Dm755 release/murmurd $out/bin/murmurd
|
install -Dm755 release/murmurd $out/bin/murmurd
|
||||||
'';
|
'';
|
||||||
}
|
};
|
||||||
source;
|
|
||||||
|
|
||||||
source = rec {
|
source = rec {
|
||||||
version = "1.4.0-development-snapshot-005";
|
version = "1.4.0-development-snapshot-005";
|
||||||
|
|
|
@ -151,13 +151,8 @@ self: super: {
|
||||||
nodejs
|
nodejs
|
||||||
tasksh
|
tasksh
|
||||||
magic-wormhole
|
magic-wormhole
|
||||||
nixfmt
|
|
||||||
nixpkgs-fmt
|
|
||||||
rnix-lsp
|
rnix-lsp
|
||||||
tmate
|
|
||||||
rustup
|
rustup
|
||||||
foot
|
|
||||||
kitty
|
|
||||||
nix-top
|
nix-top
|
||||||
ghcWithPackages
|
ghcWithPackages
|
||||||
ghcid
|
ghcid
|
||||||
|
@ -169,7 +164,7 @@ self: super: {
|
||||||
obelisk = (import self.sources.obelisk {}).command;
|
obelisk = (import self.sources.obelisk {}).command;
|
||||||
};
|
};
|
||||||
accounting-pkgs = {
|
accounting-pkgs = {
|
||||||
inherit (self.haskellPackages) hledger hledger-ui hledger-web hledger-iadd;
|
inherit (self.haskellPackages) hledger hledger-ui hledger-web;
|
||||||
inherit (self) ledger jali aqbanking;
|
inherit (self) ledger jali aqbanking;
|
||||||
};
|
};
|
||||||
system-pkgs =
|
system-pkgs =
|
||||||
|
@ -177,7 +172,7 @@ self: super: {
|
||||||
// self.extra-system-pkgs
|
// self.extra-system-pkgs
|
||||||
// {
|
// {
|
||||||
home-manager =
|
home-manager =
|
||||||
self.callPackage "${self.sources.${self.home-manager-channel}}/home-manager" {};
|
self.callPackage "${self.sources."${self.home-manager-channel}"}/home-manager" {};
|
||||||
};
|
};
|
||||||
foreign-home-pkgs = self.extra-system-pkgs;
|
foreign-home-pkgs = self.extra-system-pkgs;
|
||||||
}
|
}
|
||||||
|
|
2
private
2
private
|
@ -1 +1 @@
|
||||||
Subproject commit 9782c148aedcc49620480983197fa54a16c29244
|
Subproject commit 80bc1996ca8e0d4b75183f6b76748806511fe6ec
|
4
test.nix
4
test.nix
|
@ -6,8 +6,8 @@ in {
|
||||||
hooks = {
|
hooks = {
|
||||||
hlint.enable = true;
|
hlint.enable = true;
|
||||||
alejandra.enable = true;
|
alejandra.enable = true;
|
||||||
#nix-linter.enable = true;
|
nix-linter.enable = true;
|
||||||
#statix.enable = true;
|
statix.enable = true;
|
||||||
fourmolu.enable = true;
|
fourmolu.enable = true;
|
||||||
cabal-fmt.enable = true;
|
cabal-fmt.enable = true;
|
||||||
shellcheck.enable = true;
|
shellcheck.enable = true;
|
||||||
|
|
Loading…
Reference in a new issue