mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-11-05 01:53:15 -06:00
try out styx as a main repo
This commit is contained in:
parent
d8972aae6c
commit
67995c0c8f
4 changed files with 14 additions and 11 deletions
|
@ -23,8 +23,11 @@
|
|||
...
|
||||
}: let
|
||||
lib = import ./lib {inherit inputs nixpkgs;};
|
||||
inherit (lib) findModules nixpkgsFor mapHosts;
|
||||
inherit (builtins) listToAttrs readFile;
|
||||
in {
|
||||
nixosModules = builtins.listToAttrs (lib.findModules ./modules);
|
||||
nixosConfigurations = lib.mapHosts ./hosts;
|
||||
nixosModules = listToAttrs (findModules ./modules);
|
||||
nixosConfigurations = mapHosts ./hosts;
|
||||
packages.x86_64-linux.styx = (nixpkgsFor "x86_64-linux").writeScriptBin "styx" (readFile ./styx);
|
||||
};
|
||||
}
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
inherit (nixpkgs.lib) hasSuffix nixosSystem;
|
||||
inherit (nixpkgs.lib.filesystem) listFilesRecursive;
|
||||
in rec {
|
||||
nixpkgsFor = system: import nixpkgs {inherit system;};
|
||||
|
||||
isNixFile = path: hasSuffix ".nix" path;
|
||||
|
||||
mkSystem = hostname:
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
{pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
(writeScriptBin "styx" (builtins.readFile ./styx))
|
||||
];
|
||||
}
|
|
@ -5,7 +5,7 @@ set -e
|
|||
# rewrite as python script?
|
||||
|
||||
HOSTNAME=${HOSTNAME:-$(hostname)}
|
||||
FLAKE_PATH=${FLAKE_PATH-:$HOME/nixcfg}
|
||||
FLAKE_PATH=${FLAKE_PATH:-$HOME/nixcfg}
|
||||
|
||||
DIM="$(tput dim)"
|
||||
BOLD="$(tput bold)"
|
||||
|
@ -30,7 +30,6 @@ styx <cmd> [-h]
|
|||
${DIM}sister moon to nix on pluto
|
||||
sister software to nix in this repo${RESET}
|
||||
|
||||
pass additional args with -- --key value
|
||||
${BOLD}commands${RESET}:
|
||||
EOF
|
||||
printf "${GREEN}%8s${RESET} | ${YELLOW}%s${RESET}\n" \
|
||||
|
@ -38,7 +37,8 @@ EOF
|
|||
build "build and monitor with nom" \
|
||||
boot "evaluate flake for next boot" \
|
||||
switch "perform nixos rebuild" \
|
||||
store "run some store cleanup"
|
||||
store "run some store cleanup" \
|
||||
cache "nix build and push to daylin.cachix.org"
|
||||
exit
|
||||
}
|
||||
|
||||
|
@ -99,6 +99,10 @@ while [[ $# -gt 0 ]]; do
|
|||
;;
|
||||
--help)
|
||||
help
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
break
|
||||
;;
|
||||
-*,--*)
|
||||
error "unknown flag: ${BOLD}$1${RESET}"
|
||||
|
@ -116,5 +120,4 @@ if [[ $# -gt 0 ]]; then
|
|||
fi
|
||||
|
||||
|
||||
|
||||
$cmd "$@"
|
Loading…
Reference in a new issue