mirror of
https://github.com/kmein/niveum
synced 2026-03-18 19:11:08 +01:00
chore: move toml helpers into overlay
This commit is contained in:
@@ -95,6 +95,7 @@ in {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
nixpkgs = {
|
nixpkgs = {
|
||||||
|
overlays = [ (import <niveum/overlays/toml.nix>) ];
|
||||||
config = {
|
config = {
|
||||||
allowUnfree = true;
|
allowUnfree = true;
|
||||||
packageOverrides = pkgs: {
|
packageOverrides = pkgs: {
|
||||||
|
|||||||
@@ -29,9 +29,6 @@ let
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
myLib = import <niveum/lib> { inherit pkgs; };
|
|
||||||
inherit (myLib) writeTOML;
|
|
||||||
|
|
||||||
new-workspace = pkgs.unstable.writers.writeDash "new-workspace" ''
|
new-workspace = pkgs.unstable.writers.writeDash "new-workspace" ''
|
||||||
i3-msg workspace $(($(i3-msg -t get_workspaces | tr , '\n' | grep '"num":' | cut -d : -f 2 | sort -rn | head -1) + 1))
|
i3-msg workspace $(($(i3-msg -t get_workspaces | tr , '\n' | grep '"num":' | cut -d : -f 2 | sort -rn | head -1) + 1))
|
||||||
'';
|
'';
|
||||||
@@ -150,7 +147,7 @@ in with config.niveum; {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
statusCommand = "${pkgs.unstable.i3status-rust}/bin/i3status-rs ${
|
statusCommand = "${pkgs.unstable.i3status-rust}/bin/i3status-rs ${
|
||||||
writeTOML (import <niveum/dot/i3status-rust.nix> {
|
pkgs.writeTOML (import <niveum/dot/i3status-rust.nix> {
|
||||||
wifi-interface = networkInterfaces.wireless;
|
wifi-interface = networkInterfaces.wireless;
|
||||||
batteryBlock = batteryBlocks.default;
|
batteryBlock = batteryBlocks.default;
|
||||||
inherit (config.niveum) colours;
|
inherit (config.niveum) colours;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
{ pkgs, lib, ... }:
|
{ pkgs, lib, ... }:
|
||||||
let
|
let
|
||||||
inherit (import <niveum/lib> { inherit pkgs; }) toTOML;
|
|
||||||
inherit (lib.strings) fileContents;
|
inherit (lib.strings) fileContents;
|
||||||
in {
|
in {
|
||||||
environment.systemPackages = with pkgs; [ spotify spotify-tui playerctl ];
|
environment.systemPackages = with pkgs; [ spotify spotify-tui playerctl ];
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
{ pkgs, ... }: rec {
|
|
||||||
writeTOML = object:
|
|
||||||
pkgs.runCommand "generated.toml" { } ''
|
|
||||||
echo '${builtins.toJSON object}' | ${pkgs.remarshal}/bin/json2toml > $out
|
|
||||||
'';
|
|
||||||
toTOML = object: builtins.readFile (writeTOML object);
|
|
||||||
}
|
|
||||||
7
overlays/toml.nix
Normal file
7
overlays/toml.nix
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
(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