Last active
May 24, 2020 14:46
-
-
Save jakobrs/56d929e751fec1e6e472fea055753f98 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with import <nixpkgs> {}; | |
let | |
original = with import <nixpkgs/nixos> { configuration = import ./file.nix; }; config.system.build.isoImage; | |
rot13 = callPackage ./rot13.nix {}; | |
first-layer = rot13 { | |
name = "first-layer"; | |
from = original; | |
}; | |
second-layer = rot13 { | |
name = "second-layer"; | |
from = first-layer; | |
}; | |
in second-layer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ lib, ... }: | |
{ | |
imports = [ | |
<nixos/nixos/modules/installer/cd-dvd/installation-cd-graphical-plasma5-new-kernel.nix> | |
]; | |
fileSystems."/" = lib.mkForce { | |
device = "/dev/disk/by-label/btrfs-files"; | |
fsType = "btrfs"; | |
options = [ "subvol=root" ]; | |
}; | |
fileSystems."/nix/var" = { | |
device = "tmpfs"; | |
fsType = "tmpfs"; | |
neededForBoot = true; | |
}; | |
/* Alternatively | |
fileSystems."/nix/.rw-store" = lib.mkForce { | |
device = "/dev/disk/by-label/btrfs-files"; | |
fsType = "btrfs"; | |
neededForBoot = true; | |
}; | |
*/ | |
virtualisation.virtualbox.host.enable = true; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ stdenv, writeScript, bsdgames }: | |
{ from, name ? "${from.name}-rot13" }: | |
stdenv.mkDerivation { | |
inherit name from; | |
buildInputs = [ bsdgames ]; | |
builder = writeScript "builder.sh" '' | |
source $stdenv/setup | |
mkdir $out | |
cd $from | |
for file in $(find *); do | |
echo "Processing: $file" | |
if [ -d "$file" ]; then | |
mkdir "$out/$file"; | |
else | |
rot13 <$file >$out/$file | |
fi | |
done | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment