feat: added octoprint
This commit is contained in:
parent
9bbbba6049
commit
d339ee4c07
4 changed files with 130 additions and 25 deletions
41
flake.lock
generated
41
flake.lock
generated
|
|
@ -131,17 +131,16 @@
|
||||||
"mobile-nixos": {
|
"mobile-nixos": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1656299939,
|
"lastModified": 1659299256,
|
||||||
"narHash": "sha256-gODt71CCv0gnMNeU4GYdSBJkxsfmBy0uNv8owQC1oPs=",
|
"narHash": "sha256-MzeeBiULuqsj8TpaWWxI44ciYjrR6H3CwljJDwkT6TU=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "mobile-nixos",
|
"repo": "mobile-nixos",
|
||||||
"rev": "de9a88a70f0ae5fc0839ff94bf29e8a30af399f8",
|
"rev": "87e579471c42def38f719028ad6c5d746f26027b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "mobile-nixos",
|
"repo": "mobile-nixos",
|
||||||
"rev": "de9a88a70f0ae5fc0839ff94bf29e8a30af399f8",
|
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -244,6 +243,38 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"octoprint-spoolmanager": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1647619589,
|
||||||
|
"narHash": "sha256-JKPegbnv7nxyhAi8AqF/TDQVaj67JTlcWYHhetX5AGQ=",
|
||||||
|
"owner": "OllisGit",
|
||||||
|
"repo": "OctoPrint-SpoolManager",
|
||||||
|
"rev": "dea8d64c1849c970f3616e158260c4c6fef5a4b7",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "OllisGit",
|
||||||
|
"repo": "OctoPrint-SpoolManager",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"octoprint-telegram": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1646577349,
|
||||||
|
"narHash": "sha256-z/Nhixz83pikM616OEn+bK1889DTdC8F1E7WiBy8gsY=",
|
||||||
|
"owner": "fabianonline",
|
||||||
|
"repo": "OctoPrint-Telegram",
|
||||||
|
"rev": "d8fa9ac4a65600a25deacad9bc0d3e9cc0167751",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "fabianonline",
|
||||||
|
"repo": "OctoPrint-Telegram",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"pandoc-latex-template": {
|
"pandoc-latex-template": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
|
|
@ -295,6 +326,8 @@
|
||||||
"nixpkgs": "nixpkgs_2",
|
"nixpkgs": "nixpkgs_2",
|
||||||
"nixpkgs-master": "nixpkgs-master",
|
"nixpkgs-master": "nixpkgs-master",
|
||||||
"nnn-vim": "nnn-vim",
|
"nnn-vim": "nnn-vim",
|
||||||
|
"octoprint-spoolmanager": "octoprint-spoolmanager",
|
||||||
|
"octoprint-telegram": "octoprint-telegram",
|
||||||
"pandoc-latex-template": "pandoc-latex-template",
|
"pandoc-latex-template": "pandoc-latex-template",
|
||||||
"rnix-lsp": "rnix-lsp",
|
"rnix-lsp": "rnix-lsp",
|
||||||
"utils": "utils_3",
|
"utils": "utils_3",
|
||||||
|
|
|
||||||
38
flake.nix
38
flake.nix
|
|
@ -17,8 +17,12 @@
|
||||||
utils.url = "github:numtide/flake-utils";
|
utils.url = "github:numtide/flake-utils";
|
||||||
|
|
||||||
#pinephone
|
#pinephone
|
||||||
mobile-nixos.url = "github:NixOS/mobile-nixos?rev=de9a88a70f0ae5fc0839ff94bf29e8a30af399f8";
|
mobile-nixos.url = "github:NixOS/mobile-nixos";
|
||||||
mobile-nixos.flake = false; # whyever this isn't a flake
|
mobile-nixos.flake = false; # whyever this isn't a flake
|
||||||
|
octoprint-telegram.url = "github:fabianonline/OctoPrint-Telegram";
|
||||||
|
octoprint-telegram.flake = false;
|
||||||
|
octoprint-spoolmanager.url = "github:OllisGit/OctoPrint-SpoolManager";
|
||||||
|
octoprint-spoolmanager.flake = false;
|
||||||
|
|
||||||
## emacs
|
## emacs
|
||||||
emacs-overlay.url = "github:nix-community/emacs-overlay";
|
emacs-overlay.url = "github:nix-community/emacs-overlay";
|
||||||
|
|
@ -71,10 +75,10 @@
|
||||||
inherit system;
|
inherit system;
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
};
|
};
|
||||||
overlays = [
|
overlays = [
|
||||||
self.overlays.default
|
self.overlays.default
|
||||||
emacs-overlay.overlay
|
emacs-overlay.overlay
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
hmConfig = { hm, pkgs, inputs, config, ... }: {
|
hmConfig = { hm, pkgs, inputs, config, ... }: {
|
||||||
|
|
@ -125,19 +129,17 @@
|
||||||
specialArgs = { inherit lib; };
|
specialArgs = { inherit lib; };
|
||||||
modules = [
|
modules = [
|
||||||
home-manager.darwinModules.home-manager
|
home-manager.darwinModules.home-manager
|
||||||
({ config, inputs, self, ... }: {
|
{
|
||||||
config = {
|
#system.darwinLabel = "${config.system.darwinLabel}@${rev}";
|
||||||
#system.darwinLabel = "${config.system.darwinLabel}@${rev}";
|
_module.args = { inherit lib inputs self darwin; };
|
||||||
_module.args = { inherit lib inputs self darwin; };
|
nixpkgs.pkgs = pkgs;
|
||||||
nixpkgs.pkgs = pkgs;
|
nixpkgs.overlays = overlays;
|
||||||
nixpkgs.overlays = overlays;
|
networking.hostName = hostName;
|
||||||
networking.hostName = hostName;
|
home-manager.useGlobalPkgs = true;
|
||||||
home-manager.useGlobalPkgs = true;
|
home-manager.useUserPackages = true;
|
||||||
home-manager.useUserPackages = true;
|
home-manager.extraSpecialArgs = { inherit inputs; };
|
||||||
home-manager.extraSpecialArgs = { inherit inputs; };
|
home-manager.users.ragon = hmConfig;
|
||||||
home-manager.users.ragon = hmConfig;
|
}
|
||||||
};
|
|
||||||
})
|
|
||||||
./darwin-common.nix
|
./darwin-common.nix
|
||||||
] ++ (lib.my.mapModulesRec' (toString ./darwin-modules) import) ++ extraModules;
|
] ++ (lib.my.mapModulesRec' (toString ./darwin-modules) import) ++ extraModules;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,10 @@
|
||||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||||
|
|
||||||
{ config, inputs, pkgs, lib, ... }:
|
{ config, inputs, pkgs, lib, ... }:
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
compressLargeArtifacts = false;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
[
|
[
|
||||||
|
|
@ -10,9 +14,76 @@
|
||||||
|
|
||||||
services.octoprint = {
|
services.octoprint = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
plugins = plugins: with plugins; [ telegram ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
mobile.generatedFilesystems.rootfs = {
|
||||||
|
type = "ext4";
|
||||||
|
label = "NIXOS_SYSTEM";
|
||||||
|
id = "44444444-4444-4444-8888-888888888888";
|
||||||
|
populateCommands =
|
||||||
|
let
|
||||||
|
closureInfo = pkgs.buildPackages.closureInfo { rootPaths = config.system.build.toplevel; };
|
||||||
|
in
|
||||||
|
''
|
||||||
|
mkdir -p ./nix/store
|
||||||
|
echo "Copying system closure..."
|
||||||
|
while IFS= read -r path; do
|
||||||
|
echo " Copying $path"
|
||||||
|
cp -prf "$path" ./nix/store
|
||||||
|
done < "${closureInfo}/store-paths"
|
||||||
|
echo "Done copying system closure..."
|
||||||
|
cp -v ${closureInfo}/registration ./nix-path-registration
|
||||||
|
'';
|
||||||
|
|
||||||
|
# Give some headroom for initial mounting.
|
||||||
|
extraPadding = pkgs.imageBuilder.size.MiB 600; # without this much of a padding inodes are too small for some reason
|
||||||
|
|
||||||
|
# FIXME: See #117, move compression into the image builder.
|
||||||
|
# Zstd can take a long time to complete successfully at high compression
|
||||||
|
# levels. Increasing the compression level could lead to timeouts.
|
||||||
|
postProcess = optionalString compressLargeArtifacts ''
|
||||||
|
(PS4=" $ "; set -x
|
||||||
|
PATH="$PATH:${buildPackages.zstd}/bin"
|
||||||
|
cd $out
|
||||||
|
ls -lh
|
||||||
|
time zstd -10 --rm "$filename"
|
||||||
|
ls -lh
|
||||||
|
)
|
||||||
|
'' + ''
|
||||||
|
(PS4=" $ "; set -x
|
||||||
|
mkdir $out/nix-support
|
||||||
|
cat <<EOF > $out/nix-support/hydra-build-products
|
||||||
|
file rootfs${optionalString compressLargeArtifacts "-zstd"} $out/$filename${optionalString compressLargeArtifacts ".zst"}
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
'';
|
||||||
|
|
||||||
|
zstd = compressLargeArtifacts;
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.useDHCP = true;
|
||||||
services.mjpg-streamer.enable = true;
|
services.mjpg-streamer.enable = true;
|
||||||
|
services.mjpg-streamer.inputPlugin = "input_uvc.so -d /dev/video1 -r 640x480 -f 15 -u";
|
||||||
|
hardware.opengl.enable = true;
|
||||||
|
services.getty.autologinUser = "ragon";
|
||||||
|
home-manager.users.ragon = ({ config, pkgs, ... }: {
|
||||||
|
programs.zsh.loginExtra = ''
|
||||||
|
[ "$(tty)" = "/dev/tty1" ] && exec sway
|
||||||
|
'';
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
security.sudo.wheelNeedsPassword = false;
|
||||||
|
programs.sway = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
networking.firewall.allowedTCPPorts = [ 5000 5050 ];
|
||||||
|
environment.etc."sway/config".text = ''
|
||||||
|
output DSI-1 transform 90 anticlockwise # widescreen
|
||||||
|
exec swayidle timeout 1805 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"'
|
||||||
|
exec ${pkgs.chromium}/bin/chromium http://localhost:5000 --start-fullscreen --kiosk
|
||||||
|
'';
|
||||||
|
|
||||||
ragon = {
|
ragon = {
|
||||||
cli.enable = true;
|
cli.enable = true;
|
||||||
|
|
@ -20,7 +91,6 @@
|
||||||
system.security.enable = false;
|
system.security.enable = false;
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
docker.enable = true;
|
|
||||||
ssh.enable = true;
|
ssh.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -49,13 +49,13 @@ in
|
||||||
registry = registryInputs // { conf.flake = inputs.self; };
|
registry = registryInputs // { conf.flake = inputs.self; };
|
||||||
};
|
};
|
||||||
system.configurationRevision = with inputs; mkIf (self ? rev) self.rev;
|
system.configurationRevision = with inputs; mkIf (self ? rev) self.rev;
|
||||||
system.stateVersion = "21.05";
|
system.stateVersion = "22.05";
|
||||||
|
|
||||||
|
|
||||||
## Some reasonable, global defaults
|
## Some reasonable, global defaults
|
||||||
# This is here to appease 'nix flake check' for generic hosts with no
|
# This is here to appease 'nix flake check' for generic hosts with no
|
||||||
# hardware-configuration.nix or fileSystem config.
|
# hardware-configuration.nix or fileSystem config.
|
||||||
fileSystems."/".device = mkDefault "/dev/disk/by-label/nixos";
|
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
loader = {
|
loader = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue