feat: move scripts to scripts folder

This commit is contained in:
Nydragon 2024-08-20 17:05:53 +02:00
parent ea894c3d04
commit 3630cc995e
Signed by: nydragon
SSH key fingerprint: SHA256:iQnIC12spf4QjWSbarmkD2No1cLMlu6TWoV7K6cYF5g
7 changed files with 29 additions and 18 deletions

View file

@ -32,5 +32,5 @@ repos:
entry: typos
language: system
files: .*
exclude: .*\.(png|jpg|jpeg)
exclude: .*\.(png|jpg|jpeg|age)
stages: [commit]

View file

@ -1,4 +1,15 @@
{ pkgs, ... }:
{ pkgs, lib, ... }:
let
nixos-rebuild =
name: word:
pkgs.writers.writeBashBin name ''
env --chdir $HOME/.nixconf sudo nixos-rebuild ${word} --flake .#$(hostname) \
&& ${lib.my.checkPath pkgs.libnotify "notify-send"} nixos-rebuild "Rebuild complete" \
-a nixos-rebuild \
-i ${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg
'';
in
{
screenshot =
with pkgs;
@ -42,5 +53,11 @@
getext = pkgs.writeScriptBin "ls | grep -E \"\.[a-zA-Z0-9]+$\" --only-matching | sort | uniq";
rpaste = pkgs.writers.writeBashBin "rpaste" ''curl -F "file=@$1" http://rusty.ccnlc.eu/'';
gentest = nixos-rebuild "gentest" "test";
genswitch = nixos-rebuild "genswitch" "switch";
fishl = pkgs.writers.writeFishBin "fishl" ./logo.fish;
}

View file

@ -1,8 +1 @@
{ pkgs, ... }:
with import ./. { inherit pkgs; };
[
screenshot
set-background
nixedit
fishl
]
{ pkgs, ... }: builtins.attrValues (import ./. { inherit pkgs; })

View file

@ -30,12 +30,6 @@
end
'';
fish_prompt = builtins.readFile ./fish_prompt.fish;
rebuild = ''
env --chdir $HOME/.nixconf sudo nixos-rebuild switch --flake .#$(hostname) \
&& ${lib.my.checkPath pkgs.libnotify "notify-send"} nixos-rebuild "Rebuild complete" \
-a nixos-rebuild \
-i ${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg
'';
revert = ''
env --chdir $HOME/.nixconf sudo nixos-rebuild switch --flake .#$(hostname) --rollback
'';

View file

@ -74,6 +74,10 @@
custom.scripts.nixedit
custom.scripts.set-background
custom.scripts.fishl
custom.scripts.rpaste
custom.scripts.genswitch
custom.scripts.gentest
];
};
};

View file

@ -74,6 +74,9 @@
custom.scripts.screenshot
custom.scripts.nixedit
custom.scripts.set-background
custom.scripts.rpaste
custom.scripts.genswitch
custom.scripts.gentest
];
};
};

View file

@ -1,10 +1,10 @@
{ inputs, ... }:
{ inputs, lib, ... }:
{
nixpkgs.config = {
allowUnfree = true;
packageOverrides = pkgs: {
custom = {
scripts = import ../../home/scripts { inherit pkgs; };
scripts = import ../../home/scripts { inherit pkgs lib; };
rofi-obsidian = inputs.rofi-obsidian.outputs.packages.${pkgs.system}.rofi-obsidian;
};
};