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

View File

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

View File

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

View File

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

View File

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