diff --git a/README.md b/README.md index 88a0ffd..44e0da5 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,20 @@ # Nix +- [x] Own nixos ISO +- [x] Inputs in Nix +- [x] NixOS builders and writers +- [x] Nix Shell +- [x] Nix writers +- [ ] Ovverrides and overlays +- [ ] NixOS helper +- [ ] [Nixhub](https://www.nixhub.io/) - [ ] Nix scripts - [ ] Nix home-manager, standalone vs sysconfig module - [ ] Plasma manager - [ ] Stylix - [ ] NixOS Everywhere, NixOS Anywhere -- [x] Inputs in Nix - [ ] Nix language (if else statements, pipes, and other interesting things) - [ ] Nix Modules - [ ] Vlastní options - [ ] Nix fetching - [ ] Impermanence -- [x] Own nixos ISO -- [ ] NixOS helper -- [x] NixOS builders and writers -- [ ] Ovverrides and overlays -- [ ] Nix Shell -- [x] Nix writers -- [ ] [Nixhub](https://www.nixhub.io/) diff --git a/prezentace.md b/prezentace.md index c849217..a716da3 100644 --- a/prezentace.md +++ b/prezentace.md @@ -180,6 +180,12 @@ nix flake show github:kamadorueda/alejandra --- +# Nová flake + +* `nix flake init --template templates#full` + +--- + # Inputs * `nix flake metadata --json | jq` - zobrazí vstupy @@ -228,11 +234,68 @@ nix build /etc/nixos#nixosConfigurations.nixos.config.system.build.toplevel # Virtual machine * `nix run github:nix-community/nixos-generators -- -c ./flake.nix --flake '#default' -f vm --disk-size 20480` +* `nixos-rebuild build-vm --flake ~/my-system-flake#default` * možnost generovat pro různé platformy (Amazon E2C, Docker, ISO, Proxmox, VMware, vagrant, qcow, ...) * [https://github.com/nix-community/nixos-generators](https://github.com/nix-community/nixos-generators) --- +# Nix Shell + +- `nix-shell ./` + +```nix +# shell.nix +{pkgs ? import {}}: +pkgs.mkShell { + packages = [ + (pkgs.python311.withPackages(pypkgs: with pypkgs; [ + requests + numpy + pygobject3 + ])) + ] +} +``` + +--- + +```nix +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + outputs = { + self, + nixpkgs, + flake-utils, + }: + flake-utils.lib.eachDefaultSystem + ( + system: let + pkgs = import nixpkgs { + inherit system; + }; + in + with pkgs; { + devShells.default = mkShell { + packages = [ + (pkgs.python311.withPackages (pypkgs: + with pypkgs; [ + requests + numpy + pygobject3 + ])) + ]; + }; + } + ); +} +``` + +--- + # Nix language * `nix-repl` nebo `nix-instantiate --eval foo.nix`