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.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)
]; ];
@ -165,9 +164,9 @@
packages = let packages = let
aws = system: aws = system:
import ./generators/aws { inherit inputs globals overlays system; }; import ./hosts/aws { inherit inputs globals overlays system; };
staff = system: staff = system:
import ./generators/staff { inherit inputs globals overlays system; }; import ./hosts/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

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

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

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
(pkgs.extraLib.mkScript { (writeShellApplication {
name = "ocr"; name = "ocr";
file = ../../modules/common/shell/bash/scripts/ocr.sh; runtimeInputs = [ tesseract ];
env = [ 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"; 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.extraLib.mkScript { (pkgs.writeShellApplication {
name = "switch-audio"; name = "switch-audio";
file = ./rofi/pulse-sink.sh; runtimeInputs = [ pkgs.ponymix rofi ];
env = [ pkgs.ponymix rofi ]; text = builtins.readFile ./rofi/pulse-sink.sh;
}) })
}/bin/switch-audio"; }/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} $@
'';
};
}