-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
258 additions
and
247 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,12 @@ | ||
{...}: { | ||
perSystem = { | ||
config, | ||
pkgs, | ||
... | ||
}: { | ||
packages = { | ||
image-base = pkgs.callPackage ../images/base.nix {}; | ||
image-jupyter = pkgs.callPackage ../images/jupyter.nix { | ||
base = config.packages.image-base; | ||
}; | ||
image-poetry = pkgs.callPackage ../images/poetry.nix { | ||
base = config.packages.image-base; | ||
{ ... }: | ||
{ | ||
perSystem = | ||
{ config, pkgs, ... }: | ||
{ | ||
packages = { | ||
image-base = pkgs.callPackage ../images/base.nix { }; | ||
image-jupyter = pkgs.callPackage ../images/jupyter.nix { base = config.packages.image-base; }; | ||
image-poetry = pkgs.callPackage ../images/poetry.nix { base = config.packages.image-base; }; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,48 @@ | ||
{ lib, self, ... }: | ||
{ | ||
lib, | ||
self, | ||
... | ||
}: { | ||
perSystem = { | ||
pkgs, | ||
config, | ||
... | ||
}: let | ||
manager = lib.getExe' pkgs.system-manager "system-manager"; | ||
in { | ||
packages = { | ||
manager = pkgs.system-manager; | ||
install = pkgs.writeShellApplication { | ||
name = "system-manager-rebuild"; | ||
text = '' | ||
set -x #echo on | ||
exec ${manager} "''${1:-switch}" --flake ${self} "''${@:2}" | ||
''; | ||
}; | ||
uninstall = pkgs.writeShellApplication { | ||
name = "system-manager-uninstall"; | ||
text = '' | ||
set -x #echo on | ||
exec ${manager} deactivate "''$@" | ||
''; | ||
}; | ||
setup = pkgs.writeShellApplication { | ||
name = "system-manager-setup"; | ||
text = '' | ||
# only root possible | ||
if [ "$(id -u)" -ne 0 ]; then | ||
echo "This script must be run as root" >&2 | ||
exit 1 | ||
fi | ||
set -x #echo on | ||
# set up nix | ||
cp -f ${../etc/nix.conf} /etc/nix/nix.conf | ||
systemctl restart nix-daemon | ||
# set up cuda support for oci engines like podman | ||
nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml | ||
chmod -R 755 /etc/cdi | ||
# set compute mode to exclusive process (https://stackoverflow.com/a/50056586) | ||
nvidia-smi -c 3 | ||
# disable default motd | ||
chmod -x /etc/update-motd.d/* | ||
''; | ||
perSystem = | ||
{ pkgs, config, ... }: | ||
let | ||
manager = lib.getExe' pkgs.system-manager "system-manager"; | ||
in | ||
{ | ||
packages = { | ||
manager = pkgs.system-manager; | ||
install = pkgs.writeShellApplication { | ||
name = "system-manager-rebuild"; | ||
text = '' | ||
set -x #echo on | ||
exec ${manager} "''${1:-switch}" --flake ${self} "''${@:2}" | ||
''; | ||
}; | ||
uninstall = pkgs.writeShellApplication { | ||
name = "system-manager-uninstall"; | ||
text = '' | ||
set -x #echo on | ||
exec ${manager} deactivate "''$@" | ||
''; | ||
}; | ||
setup = pkgs.writeShellApplication { | ||
name = "system-manager-setup"; | ||
text = '' | ||
# only root possible | ||
if [ "$(id -u)" -ne 0 ]; then | ||
echo "This script must be run as root" >&2 | ||
exit 1 | ||
fi | ||
set -x #echo on | ||
# set up nix | ||
cp -f ${../etc/nix.conf} /etc/nix/nix.conf | ||
systemctl restart nix-daemon | ||
# set up cuda support for oci engines like podman | ||
nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml | ||
chmod -R 755 /etc/cdi | ||
# set compute mode to exclusive process (https://stackoverflow.com/a/50056586) | ||
nvidia-smi -c 3 | ||
# disable default motd | ||
chmod -x /etc/update-motd.d/* | ||
''; | ||
}; | ||
}; | ||
}; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.