feat: move flake into template

This commit is contained in:
RTUnreal 2023-08-16 15:19:40 +02:00 committed by Jörg Thalheim
parent c20b0628b9
commit fc302ca3b5
8 changed files with 82 additions and 73 deletions

View File

@ -1,37 +1 @@
# disko + nixos-anywhere workshop
This is an example repo for nixos-anywhere and disko.
It's part of our CCC camp workshop.
To run the interactive vm test run:
```
nix run github:numtide/nixos-anywhere -- --flake '.#mysystem' --vm-test
```
You can also install the vm on some remote system when running
```
nix run github:numtide/nixos-anywhere -- --flake '.#mysystem' root@192.168.0.10
```
Improve this workshop README:
# disko + nixos-anywhere workshop
This is an example repo for nixos-anywhere and disko.
It's part of our CCC camp workshop.
To run the interactive vm test run:
```
nix run github:numtide/nixos-anywhere -- --flake '.#mysystem' --vm-test
```
You can also install the vm on some remote system when running
```
nix run github:numtide/nixos-anywhere -- --flake '.#mysystem' root@192.168.0.10
```
# nixos-anywhere-workshop template

View File

@ -1,40 +1,8 @@
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.disko.url = "github:nix-community/disko";
inputs.disko.inputs.nixpkgs.follows = "nixpkgs";
inputs.nixos-anywhere.url = "github:numtide/nixos-anywhere";
inputs.nixos-anywhere.inputs.nixpkgs.follows = "nixpkgs";
outputs = { self, nixpkgs, disko, nixos-anywhere, ... }@attrs: {
packages."x86_64-linux".makeDiskImageTest = disko.lib.lib.makeDiskImage {
nixosConfig = self.nixosConfigurations.mysystem;
};
packages."x86_64-linux".makeDiskScriptTest = disko.lib.lib.makeDiskImageScript {
nixosConfig = self.nixosConfigurations.mysystem;
};
nixosConfigurations.mysystem = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = attrs;
modules = [
(nixpkgs.outPath + "/nixos/modules/installer/scan/not-detected.nix")
disko.nixosModules.disko
./disk-configs/simple-efi.nix # choose your favorite disk layout here
#./disk-configs/zfs.nix # choose your favorite disk layout here
#./disk-configs/luks-lvm.nix # choose your favorite disk layout here
{
boot.loader.grub = {
efiSupport = true;
efiInstallAsRemovable = true;
};
boot.swraid.enable = true;
# Alternative to grub
#boot.loader.systemd-boot.enable = true;
# when installing toggle this
#boot.loader.efi.canTouchEfiVariables = false;
}
];
outputs = {...}: {
templates.default = {
description = "A nixos-anywhere example";
path = ./template;
};
};
}

37
template/README.md Normal file
View File

@ -0,0 +1,37 @@
# disko + nixos-anywhere workshop
This is an example repo for nixos-anywhere and disko.
It's part of our CCC camp workshop.
To run the interactive vm test run:
```
nix run github:numtide/nixos-anywhere -- --flake '.#mysystem' --vm-test
```
You can also install the vm on some remote system when running
```
nix run github:numtide/nixos-anywhere -- --flake '.#mysystem' root@192.168.0.10
```
Improve this workshop README:
# disko + nixos-anywhere workshop
This is an example repo for nixos-anywhere and disko.
It's part of our CCC camp workshop.
To run the interactive vm test run:
```
nix run github:numtide/nixos-anywhere -- --flake '.#mysystem' --vm-test
```
You can also install the vm on some remote system when running
```
nix run github:numtide/nixos-anywhere -- --flake '.#mysystem' root@192.168.0.10
```

40
template/flake.nix Normal file
View File

@ -0,0 +1,40 @@
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.disko.url = "github:nix-community/disko";
inputs.disko.inputs.nixpkgs.follows = "nixpkgs";
inputs.nixos-anywhere.url = "github:numtide/nixos-anywhere";
inputs.nixos-anywhere.inputs.nixpkgs.follows = "nixpkgs";
outputs = { self, nixpkgs, disko, nixos-anywhere, ... }@attrs: {
packages."x86_64-linux".makeDiskImageTest = disko.lib.lib.makeDiskImage {
nixosConfig = self.nixosConfigurations.mysystem;
};
packages."x86_64-linux".makeDiskScriptTest = disko.lib.lib.makeDiskImageScript {
nixosConfig = self.nixosConfigurations.mysystem;
};
nixosConfigurations.mysystem = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = attrs;
modules = [
(nixpkgs.outPath + "/nixos/modules/installer/scan/not-detected.nix")
disko.nixosModules.disko
./disk-configs/simple-efi.nix # choose your favorite disk layout here
#./disk-configs/zfs.nix # choose your favorite disk layout here
#./disk-configs/luks-lvm.nix # choose your favorite disk layout here
{
boot.loader.grub = {
efiSupport = true;
efiInstallAsRemovable = true;
};
boot.swraid.enable = true;
# Alternative to grub
#boot.loader.systemd-boot.enable = true;
# when installing toggle this
#boot.loader.efi.canTouchEfiVariables = false;
}
];
};
};
};