Compare commits

...

2 Commits

Author SHA1 Message Date
Noah Masur
78e9c817d0 move generators into hosts directory 2023-07-01 21:00:17 -06:00
Noah Masur
53a8cc83ea remove extraLib, replace mkScript with writeShellApplication 2023-07-01 20:40:48 -06:00
9 changed files with 12 additions and 29 deletions

View File

@ -121,7 +121,6 @@
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)
];
@ -165,9 +164,9 @@
packages = let
aws = system:
import ./generators/aws { inherit inputs globals overlays system; };
import ./hosts/aws { inherit inputs globals overlays system; };
staff = system:
import ./generators/staff { inherit inputs globals overlays system; };
import ./hosts/staff { inherit inputs globals overlays system; };
neovim = system:
let pkgs = import nixpkgs { inherit system overlays; };
in import ./modules/common/neovim/package {

View File

@ -2,6 +2,8 @@
| 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

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

View File

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

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.extraLib.mkScript {
(pkgs.writeShellApplication {
name = "switch-audio";
file = ./rofi/pulse-sink.sh;
env = [ pkgs.ponymix rofi ];
runtimeInputs = [ pkgs.ponymix rofi ];
text = builtins.readFile ./rofi/pulse-sink.sh;
})
}/bin/switch-audio";
};

View File

@ -1,16 +0,0 @@
_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} $@
'';
};
}