feat: move scripts to scripts folder
This commit is contained in:
parent
ea894c3d04
commit
3630cc995e
7 changed files with 29 additions and 18 deletions
|
@ -32,5 +32,5 @@ repos:
|
||||||
entry: typos
|
entry: typos
|
||||||
language: system
|
language: system
|
||||||
files: .*
|
files: .*
|
||||||
exclude: .*\.(png|jpg|jpeg)
|
exclude: .*\.(png|jpg|jpeg|age)
|
||||||
stages: [commit]
|
stages: [commit]
|
||||||
|
|
|
@ -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 =
|
screenshot =
|
||||||
with pkgs;
|
with pkgs;
|
||||||
|
@ -42,5 +53,11 @@
|
||||||
|
|
||||||
getext = pkgs.writeScriptBin "ls | grep -E \"\.[a-zA-Z0-9]+$\" --only-matching | sort | uniq";
|
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;
|
fishl = pkgs.writers.writeFishBin "fishl" ./logo.fish;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }: builtins.attrValues (import ./. { inherit pkgs; })
|
||||||
with import ./. { inherit pkgs; };
|
|
||||||
[
|
|
||||||
screenshot
|
|
||||||
set-background
|
|
||||||
nixedit
|
|
||||||
fishl
|
|
||||||
]
|
|
||||||
|
|
|
@ -30,12 +30,6 @@
|
||||||
end
|
end
|
||||||
'';
|
'';
|
||||||
fish_prompt = builtins.readFile ./fish_prompt.fish;
|
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 = ''
|
revert = ''
|
||||||
env --chdir $HOME/.nixconf sudo nixos-rebuild switch --flake .#$(hostname) --rollback
|
env --chdir $HOME/.nixconf sudo nixos-rebuild switch --flake .#$(hostname) --rollback
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -74,6 +74,10 @@
|
||||||
custom.scripts.nixedit
|
custom.scripts.nixedit
|
||||||
custom.scripts.set-background
|
custom.scripts.set-background
|
||||||
custom.scripts.fishl
|
custom.scripts.fishl
|
||||||
|
custom.scripts.rpaste
|
||||||
|
custom.scripts.genswitch
|
||||||
|
custom.scripts.gentest
|
||||||
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -74,6 +74,9 @@
|
||||||
custom.scripts.screenshot
|
custom.scripts.screenshot
|
||||||
custom.scripts.nixedit
|
custom.scripts.nixedit
|
||||||
custom.scripts.set-background
|
custom.scripts.set-background
|
||||||
|
custom.scripts.rpaste
|
||||||
|
custom.scripts.genswitch
|
||||||
|
custom.scripts.gentest
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
{ inputs, ... }:
|
{ inputs, lib, ... }:
|
||||||
{
|
{
|
||||||
nixpkgs.config = {
|
nixpkgs.config = {
|
||||||
allowUnfree = true;
|
allowUnfree = true;
|
||||||
packageOverrides = pkgs: {
|
packageOverrides = pkgs: {
|
||||||
custom = {
|
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;
|
rofi-obsidian = inputs.rofi-obsidian.outputs.packages.${pkgs.system}.rofi-obsidian;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue