Fix utility scripts

This commit is contained in:
Riley Apeldoorn 2022-05-15 20:02:26 +02:00
parent 030e457600
commit 953383d576
6 changed files with 26 additions and 10 deletions

View file

@ -14,6 +14,8 @@
outputs = args: with args.nixpkgs; {
nixosConfigurations = {
# Desktop
"thor" = lib.nixosSystem {
system = "x86_64-linux";
modules = [
@ -22,6 +24,8 @@
];
specialArgs = args;
};
# Laptop
"loki" = lib.nixosSystem {
system = "x86_64-linux";
modules = [
@ -30,6 +34,10 @@
];
specialArgs = args;
};
# TODO: Pinebook Pro
# TODO: Raspberry Pi
};
};

View file

@ -34,7 +34,7 @@ let named = submodule {
hex = mkOption { type = themeType; };
};
};
scripts = (import ../scripts/clip.nix { inherit pkgs; });
in {
options.riley = with lib; {

View file

@ -1,10 +1,17 @@
{ config, lib, pkgs, scripts, ... }:
{ config, lib, pkgs, ... }:
(lib.mkIf (config.riley.gui) {
let scripts = (import ../../scripts/clip.nix {
inherit pkgs;
});
in (lib.mkIf (config.riley.gui) {
# Add some shell scripts that abstract away the
# horrible reality that the clipboard is managed by
# the display server.
users.users."riley".packages = with scripts; [ c p ];
users.users."riley".packages =
with scripts; [
c p
];
})

View file

@ -1,6 +1,6 @@
{ pkgs, config, lib, ... }:
let scripts = (import ./scripts.nix);
let scripts = (import ./scripts.nix { inherit pkgs; });
theme = config.riley.theme.hex;
modifier = "Mod4";
terminal = "${pkgs.alacritty}/bin/alacritty";

View file

@ -113,15 +113,15 @@ with lib; let mod = modifier;
utils = ({ lock ? null, sc ? null }:
(optionalAttrs (lock != null) {
"${mod}+Escape" = "exec ${lock}/bin/lock";
}) // (optionalAttrs (sc ? null) {
"${mod}+d" = "exec ${sc}/bin/sc";
}) // (optionalAttrs (sc != null) {
"${mod}+d --release" = "exec ${sc}/bin/sc";
})
);
in (mkMerge [
(media { inherit (pkgs) mpc_cli pulseaudio; })
(utils { inherit (scripts) lock sc; })
(utils scripts)
(genDirectional directional)
(genWorkspaces workspace)

View file

@ -12,8 +12,9 @@
name = "sc";
runtimeInputs = [ xclip scrot ];
text = ''
scrot -ozs /tmp/sc.png
xclip -t "image/png" -sel clip -i < /tmp/sc.png
env > /tmp/env_sc.txt
scrot -D :0 -ozs /tmp/sc.png 2>/tmp/aaa.txt
xclip -t "image/png" -sel clip -i < /tmp/sc.png 2>/tmp/bbb.txt
'';
});