mirror of
https://codeberg.org/privacy1st/nixos-anywhere-example
synced 2024-11-23 22:19:33 +01:00
commit
3a7d24a726
38
README.md
38
README.md
@ -1,37 +1,3 @@
|
||||
# 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
|
||||
|
||||
[docs](./template/README.md)
|
40
flake.nix
40
flake.nix
@ -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
37
template/README.md
Normal 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
40
template/flake.nix
Normal 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;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
Loading…
Reference in New Issue
Block a user