Merge pull request #2 from RTUnreal/patch-1

use flakes
This commit is contained in:
Jörg Thalheim 2023-08-16 14:34:26 +01:00 committed by GitHub
commit 3a7d24a726
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 83 additions and 72 deletions

View File

@ -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)

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
```

View File

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;
}
];
};
};
};