Fix aliases, nh, etc
This commit is contained in:
parent
471dfd605e
commit
660149f46b
16 changed files with 81 additions and 60 deletions
21
flake.lock
generated
21
flake.lock
generated
|
@ -563,6 +563,26 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nh": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1747943020,
|
||||||
|
"narHash": "sha256-LlMUdltEdGxVLDZRSDQn3/i/WWn7Jakdz4wQxLxzfZ8=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nh",
|
||||||
|
"rev": "24c12228e1f1e4fc953e37283fe442ca169951ed",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nh",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nix-filter": {
|
"nix-filter": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1731533336,
|
"lastModified": 1731533336,
|
||||||
|
@ -768,6 +788,7 @@
|
||||||
"firefox-gnome-theme": "firefox-gnome-theme",
|
"firefox-gnome-theme": "firefox-gnome-theme",
|
||||||
"grapevine": "grapevine",
|
"grapevine": "grapevine",
|
||||||
"home-manager": "home-manager_2",
|
"home-manager": "home-manager_2",
|
||||||
|
"nh": "nh",
|
||||||
"nixpkgs": "nixpkgs_4",
|
"nixpkgs": "nixpkgs_4",
|
||||||
"programsdb": "programsdb",
|
"programsdb": "programsdb",
|
||||||
"stylix": "stylix",
|
"stylix": "stylix",
|
||||||
|
|
|
@ -24,6 +24,10 @@
|
||||||
url = "github:viperML/wrapper-manager";
|
url = "github:viperML/wrapper-manager";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
nh = {
|
||||||
|
url = "github:nix-community/nh";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs: let
|
outputs = inputs: let
|
||||||
|
|
5
modules/common/bat.nix
Normal file
5
modules/common/bat.nix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {environment.shellAliases.cat = "${lib.getExe pkgs.bat} --theme Nord";}
|
|
@ -1 +1 @@
|
||||||
{nix.settings.experimental-features = ["nix-command" "flakes"];}
|
{nix.settings.experimental-features = ["nix-command" "flakes" "repl-flake"];}
|
||||||
|
|
5
modules/common/eza.nix
Normal file
5
modules/common/eza.nix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {environment.shellAliases.ls = "${lib.getExe pkgs.eza} --all --icons --hyperlink --group-directories-first --color=always";}
|
|
@ -7,30 +7,6 @@
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
environment = {
|
environment.shells = [pkgs.fish];
|
||||||
shells = [pkgs.fish];
|
|
||||||
shellAliases = {
|
|
||||||
# Utility
|
|
||||||
ls = "eza";
|
|
||||||
cat = "bat";
|
|
||||||
rm = "gio trash";
|
|
||||||
free = "free -h";
|
|
||||||
neofetch = "neowofetch";
|
|
||||||
shutdown = "shutdown now";
|
|
||||||
|
|
||||||
# Git
|
|
||||||
clone = "gh repo clone";
|
|
||||||
create = "gh repo create";
|
|
||||||
|
|
||||||
push = "git push";
|
|
||||||
commit = "git commit -am";
|
|
||||||
|
|
||||||
# NixOS
|
|
||||||
clean = "nh clean all";
|
|
||||||
rebuild = "nh os switch";
|
|
||||||
rebuildServer = "nixos-rebuild switch --flake ~/.config/nixos#quadraticserver --target-host quadradical@192.168.0.132 --use-remote-sudo";
|
|
||||||
update = "pushd ~/.config/nixos && nix flake update && popd && rebuild";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
users.defaultUserShell = pkgs.fish;
|
users.defaultUserShell = pkgs.fish;
|
||||||
}
|
}
|
||||||
|
|
1
modules/common/free.nix
Normal file
1
modules/common/free.nix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{pkgs, ...}: {environment.shellAliases.free = "${pkgs.procps}/bin/free -h";}
|
|
@ -1,4 +1,8 @@
|
||||||
{pkgs, ...}: {
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
programs.git = {
|
programs.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
config = {
|
config = {
|
||||||
|
@ -17,5 +21,17 @@
|
||||||
gpg.format = "ssh";
|
gpg.format = "ssh";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
environment.systemPackages = [pkgs.gh];
|
environment = {
|
||||||
|
systemPackages = [pkgs.gh];
|
||||||
|
shellAliases = let
|
||||||
|
gitExe = lib.meta.getExe pkgs.git;
|
||||||
|
ghExe = lib.meta.getExe pkgs.gh;
|
||||||
|
in {
|
||||||
|
clone = "${ghExe} repo clone";
|
||||||
|
create = "${ghExe} repo create";
|
||||||
|
|
||||||
|
push = "${gitExe} push";
|
||||||
|
commit = "${gitExe} commit -am";
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
3
modules/common/neowofetch/default.nix
Normal file
3
modules/common/neowofetch/default.nix
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{pkgs, ...}: {
|
||||||
|
environment.shellAliases.neofetch = "${pkgs.hyfetch}/bin/neowofetch --config ${./neofetch.conf}";
|
||||||
|
}
|
|
@ -1,7 +1,23 @@
|
||||||
{
|
{
|
||||||
|
inputs,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
pkg = inputs.nh.packages.${pkgs.system}.default;
|
||||||
|
exe = lib.getExe pkg;
|
||||||
|
in {
|
||||||
programs.nh = {
|
programs.nh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
package = pkg;
|
||||||
clean.enable = true;
|
clean.enable = true;
|
||||||
flake = "/home/quadradical/.config/nixos";
|
flake = "/home/quadradical/.config/nixos";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
environment.shellAliases = {
|
||||||
|
clean = "${exe} clean all";
|
||||||
|
update = "pushd ~/.config/nixos && nix flake update && popd && rebuild";
|
||||||
|
rebuild = "${exe} os switch";
|
||||||
|
rebuildServer = "${exe} os switch --hostname quadraticserver --target-host 192.168.0.132";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{pkgs, ...}: {
|
{pkgs, ...}: {
|
||||||
environment.systemPackages = [(pkgs.writeShellScriptBin "sudo" "run0 $@")];
|
# environment.systemPackages = [(pkgs.writeShellScriptBin "sudo" "run0 $@")];
|
||||||
security = {
|
# security = {
|
||||||
sudo.enable = false;
|
# sudo.enable = false;
|
||||||
pam.services.systemd-run0 = {};
|
# pam.services.systemd-run0 = {};
|
||||||
};
|
# };
|
||||||
}
|
}
|
||||||
|
|
1
modules/common/trash.nix
Normal file
1
modules/common/trash.nix
Normal file
|
@ -0,0 +1 @@
|
||||||
|
{pkgs, ...}: {environment.shellAliases.rm = "${pkgs.glib}/bin/gio trash";}
|
|
@ -1,6 +0,0 @@
|
||||||
{pkgs, ...}: {
|
|
||||||
wrappers.bat = {
|
|
||||||
basePackage = pkgs.bat;
|
|
||||||
flags = ["--theme" "Nord"];
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,12 +0,0 @@
|
||||||
{pkgs, ...}: {
|
|
||||||
wrappers.eza = {
|
|
||||||
basePackage = pkgs.eza;
|
|
||||||
flags = [
|
|
||||||
"--all"
|
|
||||||
"--icons"
|
|
||||||
"--hyperlink"
|
|
||||||
"--color=always"
|
|
||||||
"--group-directories-first"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
{pkgs, ...}: {
|
|
||||||
wrappers.neofetch = {
|
|
||||||
basePackage = pkgs.hyfetch; # Neowofetch
|
|
||||||
flags = [
|
|
||||||
"--config"
|
|
||||||
./neofetch.conf
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue