Compare commits

..

No commits in common. "78e9c817d03774cd60228561d372685e4fec2f81" and "1cf5f46adff5339429ef5d425c35935c7a047c32" have entirely different histories.

9 changed files with 29 additions and 12 deletions

View File

@ -121,6 +121,7 @@
inputs.nur.overlay
inputs.nix2vim.overlay
(import ./overlays/neovim-plugins.nix inputs)
(import ./overlays/lib.nix)
(import ./overlays/calibre-web.nix)
(import ./overlays/disko.nix inputs)
];
@ -164,9 +165,9 @@
packages = let
aws = system:
import ./hosts/aws { inherit inputs globals overlays system; };
import ./generators/aws { inherit inputs globals overlays system; };
staff = system:
import ./hosts/staff { inherit inputs globals overlays system; };
import ./generators/staff { inherit inputs globals overlays system; };
neovim = system:
let pkgs = import nixpkgs { inherit system overlays; };
in import ./modules/common/neovim/package {

View File

@ -1,10 +1,12 @@
{ inputs, system, globals, overlays, ... }:
inputs.nixos-generators.nixosGenerate {
with inputs;
nixos-generators.nixosGenerate {
inherit system;
format = "amazon";
modules = [
inputs.home-manager.nixosModules.home-manager
home-manager.nixosModules.home-manager
{
nixpkgs.overlays = overlays;
user = globals.user;

View File

@ -2,8 +2,6 @@
| Host | Purpose |
| --- | --- |
| [aws](./aws/default.nix) | AWS AMI |
| [staff](./staff/default.nix) | Live USB stick |
| [flame](./flame/default.nix) | Oracle cloud server |
| [hydra](./hydra/default.nix) | WSL config |
| [lookingglass](./lookingglass/default.nix) | Work MacBook |

View File

@ -19,10 +19,10 @@
consul
noti # Create notifications programmatically
ipcalc # Make IP network calculations
(writeShellApplication {
(pkgs.extraLib.mkScript {
name = "ocr";
runtimeInputs = [ tesseract ];
text = builtins.readFile ../../modules/common/shell/bash/scripts/ocr.sh;
file = ../../modules/common/shell/bash/scripts/ocr.sh;
env = [ tesseract ];
})
];

View File

@ -167,10 +167,10 @@ in {
altTabCommand = "${rofi}/bin/rofi -show window -modi window";
calculatorCommand = "${rofi}/bin/rofi -modes calc -show calc";
audioSwitchCommand = "${
(pkgs.writeShellApplication {
(pkgs.extraLib.mkScript {
name = "switch-audio";
runtimeInputs = [ pkgs.ponymix rofi ];
text = builtins.readFile ./rofi/pulse-sink.sh;
file = ./rofi/pulse-sink.sh;
env = [ pkgs.ponymix rofi ];
})
}/bin/switch-audio";
};

16
overlays/lib.nix Normal file
View File

@ -0,0 +1,16 @@
_final: prev: {
extraLib = prev.lib // {
# Quickly package shell scripts with their dependencies
# From https://discourse.nixos.org/t/how-to-create-a-script-with-dependencies/7970/6
mkScript = { name, file, env ? [ ] }:
prev.pkgs.writeScriptBin name ''
for i in ${prev.lib.concatStringsSep " " env}; do
export PATH="$i/bin:$PATH"
done
exec ${prev.pkgs.bash}/bin/bash ${file} $@
'';
};
}