mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
feat: use pkgs.formats for everything
This commit is contained in:
@@ -1,46 +1,45 @@
|
|||||||
{ pkgs, lib, config, ... }:
|
{ pkgs, lib, config, ... }:
|
||||||
let
|
{
|
||||||
inherit (import <niveum/lib>) colours;
|
|
||||||
colourNames =
|
|
||||||
[ "black" "red" "green" "yellow" "blue" "magenta" "cyan" "white" ];
|
|
||||||
colourPairs = lib.getAttrs colourNames colours;
|
|
||||||
alacrittyConfig = {
|
|
||||||
background_opacity = 0.9;
|
|
||||||
colors = {
|
|
||||||
primary = { inherit (colours) background foreground; };
|
|
||||||
normal = lib.mapAttrs (_: colour: colour.dark) colourPairs;
|
|
||||||
bright = lib.mapAttrs (_: colour: colour.bright) colourPairs;
|
|
||||||
};
|
|
||||||
font = {
|
|
||||||
normal.family = "Monospace";
|
|
||||||
size = 6;
|
|
||||||
};
|
|
||||||
key_bindings = [
|
|
||||||
{
|
|
||||||
key = "Add";
|
|
||||||
mods = "Control";
|
|
||||||
action = "IncreaseFontSize";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
key = "Minus";
|
|
||||||
mods = "Control";
|
|
||||||
action = "DecreaseFontSize";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
key = "Key0";
|
|
||||||
mods = "Control";
|
|
||||||
action = "ResetFontSize";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
environment.variables.TERMINAL = "alacritty";
|
environment.variables.TERMINAL = "alacritty";
|
||||||
|
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
pkgs.alacritty
|
pkgs.alacritty
|
||||||
];
|
];
|
||||||
|
|
||||||
home-manager.users.me.xdg.configFile = {
|
home-manager.users.me.xdg.configFile =
|
||||||
"alacritty/alacritty.yml".text = builtins.toJSON alacrittyConfig;
|
let
|
||||||
|
inherit (import <niveum/lib>) colours;
|
||||||
|
colourNames = [ "black" "red" "green" "yellow" "blue" "magenta" "cyan" "white" ];
|
||||||
|
colourPairs = lib.getAttrs colourNames colours;
|
||||||
|
in {
|
||||||
|
"alacritty/alacritty.yml".source = (pkgs.formats.yaml {}).generate "alacritty.yml" {
|
||||||
|
background_opacity = 0.9;
|
||||||
|
colors = {
|
||||||
|
primary = { inherit (colours) background foreground; };
|
||||||
|
normal = lib.mapAttrs (_: colour: colour.dark) colourPairs;
|
||||||
|
bright = lib.mapAttrs (_: colour: colour.bright) colourPairs;
|
||||||
|
};
|
||||||
|
font = {
|
||||||
|
normal.family = "Monospace";
|
||||||
|
size = 6;
|
||||||
|
};
|
||||||
|
key_bindings = [
|
||||||
|
{
|
||||||
|
key = "Add";
|
||||||
|
mods = "Control";
|
||||||
|
action = "IncreaseFontSize";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "Minus";
|
||||||
|
mods = "Control";
|
||||||
|
action = "DecreaseFontSize";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "Key0";
|
||||||
|
mods = "Control";
|
||||||
|
action = "ResetFontSize";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ in {
|
|||||||
(self: super: {
|
(self: super: {
|
||||||
scripts = import <niveum/packages/scripts> { pkgs = super; lib = super.lib; };
|
scripts = import <niveum/packages/scripts> { pkgs = super; lib = super.lib; };
|
||||||
})
|
})
|
||||||
(import <niveum/overlays/toml.nix>)
|
|
||||||
(import <stockholm/krebs/5pkgs/haskell>)
|
(import <stockholm/krebs/5pkgs/haskell>)
|
||||||
(import <stockholm/submodules/nix-writers/pkgs>)
|
(import <stockholm/submodules/nix-writers/pkgs>)
|
||||||
(import <stockholm/krebs/5pkgs/override>)
|
(import <stockholm/krebs/5pkgs/override>)
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ${
|
statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ${
|
||||||
pkgs.writeTOML (import <niveum/lib/i3status-rust.nix> {
|
(pkgs.formats.toml {}).generate "i3status-rust.toml" (import <niveum/lib/i3status-rust.nix> {
|
||||||
inherit (config.niveum) batteryName wirelessInterface;
|
inherit (config.niveum) batteryName wirelessInterface;
|
||||||
inherit colours;
|
inherit colours;
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
|
|||||||
@@ -1,47 +1,6 @@
|
|||||||
{ pkgs, lib, ... }:
|
{ pkgs, lib, ... }:
|
||||||
let
|
|
||||||
bridgeBotToken = lib.strings.fileContents <system-secrets/telegram/kmein.token>;
|
|
||||||
config = {
|
|
||||||
general = {
|
|
||||||
RemoteNickFormat = "[{NICK}] ";
|
|
||||||
Charset = "utf-8";
|
|
||||||
};
|
|
||||||
telegram.kmein.Token = bridgeBotToken;
|
|
||||||
irc.freenode = {
|
|
||||||
Server = "irc.freenode.net:6667";
|
|
||||||
Nick = "ponte";
|
|
||||||
StripMarkdown = true;
|
|
||||||
};
|
|
||||||
mumble.lassulus = {
|
|
||||||
Server = "lassul.us:64738";
|
|
||||||
Nick = "krebs_bridge";
|
|
||||||
SkipTLSVerify = true;
|
|
||||||
};
|
|
||||||
gateway = [
|
|
||||||
{
|
|
||||||
name = "krebs-bridge";
|
|
||||||
enable = true;
|
|
||||||
inout = [
|
|
||||||
{
|
|
||||||
account = "irc.freenode";
|
|
||||||
channel = "#krebs";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
account = "telegram.kmein";
|
|
||||||
channel = "-330372458";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
account = "mumble.lassulus";
|
|
||||||
channel = 6; # "nixos"
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
(import <niveum/overlays/toml.nix>)
|
|
||||||
(self: super: {
|
(self: super: {
|
||||||
matterbridge = (import (super.fetchFromGitHub {
|
matterbridge = (import (super.fetchFromGitHub {
|
||||||
owner = "NixOS";
|
owner = "NixOS";
|
||||||
@@ -54,6 +13,44 @@ in
|
|||||||
|
|
||||||
services.matterbridge = {
|
services.matterbridge = {
|
||||||
enable = true;
|
enable = true;
|
||||||
configPath = toString (pkgs.writeTOML config);
|
configPath =
|
||||||
|
let bridgeBotToken = lib.strings.fileContents <system-secrets/telegram/kmein.token>;
|
||||||
|
in toString ((pkgs.formats.toml {}).generate "config.toml" {
|
||||||
|
general = {
|
||||||
|
RemoteNickFormat = "[{NICK}] ";
|
||||||
|
Charset = "utf-8";
|
||||||
|
};
|
||||||
|
telegram.kmein.Token = bridgeBotToken;
|
||||||
|
irc.freenode = {
|
||||||
|
Server = "irc.freenode.net:6667";
|
||||||
|
Nick = "ponte";
|
||||||
|
StripMarkdown = true;
|
||||||
|
};
|
||||||
|
mumble.lassulus = {
|
||||||
|
Server = "lassul.us:64738";
|
||||||
|
Nick = "krebs_bridge";
|
||||||
|
SkipTLSVerify = true;
|
||||||
|
};
|
||||||
|
gateway = [
|
||||||
|
{
|
||||||
|
name = "krebs-bridge";
|
||||||
|
enable = true;
|
||||||
|
inout = [
|
||||||
|
{
|
||||||
|
account = "irc.freenode";
|
||||||
|
channel = "#krebs";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
account = "telegram.kmein";
|
||||||
|
channel = "-330372458";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
account = "mumble.lassulus";
|
||||||
|
channel = 6; # "nixos"
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ in
|
|||||||
systemd.services.mpd-fm-stations =
|
systemd.services.mpd-fm-stations =
|
||||||
let
|
let
|
||||||
stations = lib.lists.imap0 (id: {desc ? "", logo ? "https://picsum.photos/seed/${builtins.hashString "md5" stream}/300", stream, station}: { inherit id desc logo stream station; }) streams;
|
stations = lib.lists.imap0 (id: {desc ? "", logo ? "https://picsum.photos/seed/${builtins.hashString "md5" stream}/300", stream, station}: { inherit id desc logo stream station; }) streams;
|
||||||
stationsJson = pkgs.writeText "stations.json" (builtins.toJSON stations);
|
stationsJson = (pkgs.formats.json {}).generate "stations.json" stations;
|
||||||
in {
|
in {
|
||||||
wantedBy = [ "mpd-fm.service" ];
|
wantedBy = [ "mpd-fm.service" ];
|
||||||
startAt = "hourly";
|
startAt = "hourly";
|
||||||
|
|||||||
@@ -10,8 +10,9 @@
|
|||||||
'';
|
'';
|
||||||
# :def unpl \x -> return $ ":!${pkgs.haskellPackages.pointful}/bin/pointful \"" ++ x ++ "\""
|
# :def unpl \x -> return $ ":!${pkgs.haskellPackages.pointful}/bin/pointful \"" ++ x ++ "\""
|
||||||
# :def pl \x -> return $ ":!${pkgs.haskellPackages.pointfree}/bin/pointfree -v \"" ++ x ++ "\""
|
# :def pl \x -> return $ ":!${pkgs.haskellPackages.pointfree}/bin/pointfree -v \"" ++ x ++ "\""
|
||||||
".stack/config.yaml".text = let inherit (import <niveum/lib>) kieran;
|
".stack/config.yaml".source =
|
||||||
in builtins.toJSON {
|
let inherit (import <niveum/lib>) kieran;
|
||||||
|
in (pkgs.formats.yaml {}).generate "config.yaml" {
|
||||||
templates.params = {
|
templates.params = {
|
||||||
author-name = kieran.name;
|
author-name = kieran.name;
|
||||||
author-email = kieran.email;
|
author-email = kieran.email;
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ let
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
configFile = pkgs.writeText "urlwatch.yaml" (builtins.toJSON {
|
configFile = (pkgs.formats.yaml {}).generate "urlwatch.yaml" {
|
||||||
display = {
|
display = {
|
||||||
error = true;
|
error = true;
|
||||||
new = true;
|
new = true;
|
||||||
@@ -100,7 +100,7 @@ let
|
|||||||
# chat_id = [ "18980945" ];
|
# chat_id = [ "18980945" ];
|
||||||
# };
|
# };
|
||||||
};
|
};
|
||||||
});
|
};
|
||||||
urlwatch = pkgs.urlwatch.overrideAttrs (attrs: {
|
urlwatch = pkgs.urlwatch.overrideAttrs (attrs: {
|
||||||
patches = [ <niveum/packages/urlwatch-insecure.patch> ];
|
patches = [ <niveum/packages/urlwatch-insecure.patch> ];
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ in {
|
|||||||
|
|
||||||
stationsFile = mkOption {
|
stationsFile = mkOption {
|
||||||
type = types.path;
|
type = types.path;
|
||||||
default = pkgs.writeText "stations.json" (builtins.toJSON cfg.stations);
|
default = (pkgs.formats.json {}).generate "stations.json" cfg.stations;
|
||||||
};
|
};
|
||||||
|
|
||||||
package = mkOption {
|
package = mkOption {
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
(self: super: {
|
|
||||||
writeTOML = object: super.runCommand "writeTOML" {} ''
|
|
||||||
echo '${builtins.toJSON object}' | ${super.remarshal}/bin/json2toml > $out
|
|
||||||
'';
|
|
||||||
toTOML = object: builtins.readFile (self.writeTOML object);
|
|
||||||
writeJSON = path: object: super.writeText path (builtins.toJSON object);
|
|
||||||
})
|
|
||||||
Reference in New Issue
Block a user