mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
chore: move toml helpers into overlay
This commit is contained in:
@@ -95,6 +95,7 @@ in {
|
||||
}
|
||||
{
|
||||
nixpkgs = {
|
||||
overlays = [ (import <niveum/overlays/toml.nix>) ];
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
packageOverrides = pkgs: {
|
||||
|
||||
@@ -29,9 +29,6 @@ let
|
||||
};
|
||||
};
|
||||
|
||||
myLib = import <niveum/lib> { inherit pkgs; };
|
||||
inherit (myLib) writeTOML;
|
||||
|
||||
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))
|
||||
'';
|
||||
@@ -150,7 +147,7 @@ in with config.niveum; {
|
||||
};
|
||||
};
|
||||
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;
|
||||
batteryBlock = batteryBlocks.default;
|
||||
inherit (config.niveum) colours;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{ pkgs, lib, ... }:
|
||||
let
|
||||
inherit (import <niveum/lib> { inherit pkgs; }) toTOML;
|
||||
inherit (lib.strings) fileContents;
|
||||
in {
|
||||
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