forked from Projects/qotd
Compare commits
8 Commits
remove-git
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| a86f361bb8 | |||
|
cf6bbc8299
|
|||
|
f836d24ba7
|
|||
|
3b93261ada
|
|||
| c7011c8c8e | |||
| e2aa19919b | |||
| 1e60c9b581 | |||
| dd2a353811 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
|||||||
*.uasm
|
*.uasm
|
||||||
result
|
result
|
||||||
|
*.qcow2
|
||||||
|
|||||||
21
README.md
21
README.md
@@ -1,6 +1,23 @@
|
|||||||
this is wip
|
# QOTD daemon
|
||||||
|
|
||||||
the idea was to create a uiua program that serves the [qotd port
|
> [!CAUTION]
|
||||||
|
> This is WIP
|
||||||
|
|
||||||
|
The idea was to create a uiua program that serves the [qotd port
|
||||||
17](https://en.wikipedia.org/wiki/QOTD) then host it on one of pvv's machines.
|
17](https://en.wikipedia.org/wiki/QOTD) then host it on one of pvv's machines.
|
||||||
this to learn about socket programming in uiua, and to show some love to the
|
this to learn about socket programming in uiua, and to show some love to the
|
||||||
oft-forgotten port 17.
|
oft-forgotten port 17.
|
||||||
|
|
||||||
|
## Building and running
|
||||||
|
|
||||||
|
**Build:**
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ nix build
|
||||||
|
```
|
||||||
|
|
||||||
|
**Run in VM:**
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ nix run .#vm
|
||||||
|
```
|
||||||
|
|||||||
74
flake.nix
74
flake.nix
@@ -16,6 +16,19 @@
|
|||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
in f system pkgs);
|
in f system pkgs);
|
||||||
in {
|
in {
|
||||||
|
apps = forAllSystems (
|
||||||
|
system: pkgs: {
|
||||||
|
default = {
|
||||||
|
type = "app";
|
||||||
|
program = "${lib.getExe self.packages.${system}.default}";
|
||||||
|
};
|
||||||
|
vm = {
|
||||||
|
type = "app";
|
||||||
|
program = "${self.nixosConfigurations.vm.config.system.build.vm}/bin/run-nixos-vm";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
devShells = forAllSystems (system: pkgs: {
|
devShells = forAllSystems (system: pkgs: {
|
||||||
default = pkgs.mkShell {
|
default = pkgs.mkShell {
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
@@ -29,9 +42,68 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
overlays.default = final: prev: {
|
overlays.default = final: prev: {
|
||||||
qotd = self.packages.${prev.system}.default;
|
qotd = self.packages.${prev.stdenv.hostPlatform.system}.default;
|
||||||
};
|
};
|
||||||
|
|
||||||
nixosModules.default = ./nix/module.nix;
|
nixosModules.default = ./nix/module.nix;
|
||||||
|
|
||||||
|
nixosConfigurations.vm = nixpkgs.lib.nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
pkgs = import nixpkgs {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
overlays = [
|
||||||
|
self.overlays.default
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
modules = [
|
||||||
|
"${nixpkgs}/nixos/modules/virtualisation/qemu-vm.nix"
|
||||||
|
self.nixosModules.default
|
||||||
|
({ config, pkgs, ... }: {
|
||||||
|
system.stateVersion = config.system.nixos.release;
|
||||||
|
virtualisation.graphics = false;
|
||||||
|
users.extraUsers.root.password = "root";
|
||||||
|
services.getty.autologinUser = "root";
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
netcat
|
||||||
|
];
|
||||||
|
|
||||||
|
users.motd = ''
|
||||||
|
=======================
|
||||||
|
|
||||||
|
Welcome to the qotd vm!
|
||||||
|
|
||||||
|
Try running:
|
||||||
|
|
||||||
|
nc localhost 17
|
||||||
|
|
||||||
|
=======================
|
||||||
|
'';
|
||||||
|
|
||||||
|
services.qotd = {
|
||||||
|
enable = true;
|
||||||
|
quotes = [
|
||||||
|
''
|
||||||
|
"rm -rf /"
|
||||||
|
|
||||||
|
- felixalb on bekkalokk, 2026 (probably)
|
||||||
|
''
|
||||||
|
''
|
||||||
|
( U I U A )
|
||||||
|
汎用配列指向プログラミング言語
|
||||||
|
|
||||||
|
- frero, 2025
|
||||||
|
''
|
||||||
|
''
|
||||||
|
bwaaa :3
|
||||||
|
|
||||||
|
- oysteikt on gitea, 2024
|
||||||
|
''
|
||||||
|
];
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,5 +82,9 @@ in
|
|||||||
Accept = "yes";
|
Accept = "yes";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
networking.firewall.allowedTCPPorts = [
|
||||||
|
17
|
||||||
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,4 +51,6 @@ stdenvNoCC.mkDerivation {
|
|||||||
install -Dm555 "$wrapperPath" "$out"/bin/qotd
|
install -Dm555 "$wrapperPath" "$out"/bin/qotd
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
meta.mainProgram = "qotd";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user