remote building and vm

This commit is contained in:
foglar 2025-03-14 09:31:44 +01:00
parent e6e4ccc0bb
commit 8277a2ca7b
2 changed files with 31 additions and 14 deletions

View File

@ -4,8 +4,8 @@
- [ ] Nix home-manager
- [ ] Stylix
- [ ] NixOS Everywhere, NixOS Anywhere
- [ ] Inputs in Nix
- [ ] Nix language
- [x] Inputs in Nix
- [ ] Nix language (if else statements, pipes, and other interesting things)
- [ ] Nix Modules
- [ ] Vlastní options
- [ ] Nix fetching

View File

@ -173,12 +173,31 @@ nix build /etc/nixos#nixosConfigurations.nixos.config.system.build.toplevel \
---
# Remote building
- `nixos-rebuild --target-host nixFreak@192.168.8.32 switch --flake .#default`
- `--use-remote-sudo`
- `--build-host` - konfigurace tady
- `--target-host` - konfigurace tam
---
# Virtual machine
`nix run github:nix-community/nixos-generators -- -c ./flake.nix --flake '#default' -f vm --disk-size 20480`
---
# Nix writers
* Jednoduchý způsob přidávání skriptů v různých programovacích jazycích do systému ve flake konfiguraci
* Rozdíl oproti klasickému `pkgs.writeShellScriptBin`
* [nixpkgs](https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/writers/scripts.nix) - pro všechny možnosti konfigurace skriptů
* [https://nixos.wiki/wiki/Nix-writers](https://nixos.wiki/wiki/Nix-writers) - osekaná wiki
- Jednoduchý způsob přidávání skriptů v různých programovacích jazycích do
systému ve flake konfiguraci
- Rozdíl oproti klasickému `pkgs.writeShellScriptBin`
- [nixpkgs](https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/writers/scripts.nix) -
pro všechny možnosti konfigurace skriptů
- [https://nixos.wiki/wiki/Nix-writers](https://nixos.wiki/wiki/Nix-writers) -
osekaná wiki
---
@ -204,7 +223,6 @@ fn main() {
---
```nix
pkgs.writers.writePython3 "hello-world-python"
{
libraries = [ pkgs.python3Packages.requests ];
@ -217,5 +235,4 @@ pkgs.writers.writePython3 "hello-world-python"
''
print("Hello world!")
''
```