Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .requirements/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{ pkgs ? import <nixpkgs> {}, ... }:

let
helloWorld = pkgs.writeScriptBin "helloWorld" ''
#!{pkgs.stdenv.shell}
echo Hello World
'';

nixPackages = with pkgs; [
bashInteractive
bash-completion
coreutils-full
dash
i3lock
zsh
];

in
pkgs.stdenv.mkDerivation {
name = "default";
buildInputs = nixPackages;
src = /tmp/nix;
system = builtins.currentSystem;
outputs = [
"out"
];
}
4 changes: 2 additions & 2 deletions .requirements/install.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ backup: ## Backup common configuration files

.PHONY: install
install: ## Stow/symlinked packages into your ${HOME} directory
@for package in $(PACKAGES); do \
for package in $(PACKAGES); do \
filename=$$(echo $$package | sed 's/\/$$//; s/^.*\///'); \
$(STOW) --restow $$filename || exit 1; \
done
Expand All @@ -26,7 +26,7 @@ install.update-requirements: # Update the list of stowed packages to match dire
uninstall: ## Remove symlinked packages from your ${HOME} and ${DFC} directories
@for package in $(PACKAGES); do \
filename=$$(echo $$package | sed 's/\/$$//; s/^.*\///'); \
$(STOW) --delete $$filename; \
$(STOW) --delete $$filename 2>/dev/null; \
done

.PHONY: update
Expand Down
64 changes: 64 additions & 0 deletions .requirements/preseed/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
ISO_INPUT=$(HOME)/.local/share/downloads/xubuntu-20.04.2.0-desktop-amd64.iso
MOUNT_POINT_RO=mnt/ro
MOUNT_POINT_TARGET=$(MOUNT_POINT_RO)/ubuntu
MOUNT_POINT_RW=mnt/rw
MOUNT_POINT_RW_TARGET=$(MOUNT_POINT_RW)/ubuntu
ISO_OUTPUT=dist/disc.iso
SEED_OUTPUT=$(MOUNT_POINT_RW)/preseed/unattended.seed
TXT_CFG_OUTPUT=$(MOUNT_POINT_RW)/isolinux/txt.cfg
GRUB_CFG_OUTPUT=$(MOUNT_POINT_RW)/boot/grub/grub.cfg
ISOLINUX_CFG_OUTPUT=$(MOUNT_POINT_RW)/isolinux/isolinux.cfg

$(ISO_OUTPUT): $(SEED_OUTPUT) $(ISOLINUX_CFG_OUTPUT)
@mkisofs \
-r \
-V "Custom Xubuntu Install CD" \
-cache-inodes \
-quiet \
-J \
-l \
-b isolinux/isolinux.bin \
-c isolinux/boot.cat \
-no-emul-boot \
-boot-load-size 4 \
-boot-info-table \
-o "$(@)" \
"$(MOUNT_POINT_RW)" \
;
@printf '\n\n'
@printf 'Username: %s\n' "$(USERNAME)"
@printf 'Password: %s\n' "$(PASSWORD)"

USERNAME:=dude
PASSWORD:=$(shell apg | head -1)
PASSWORD_ENC:=$(shell printf "$(PASSWORD)" | mkpasswd -m sha-512 --stdin)

$(SEED_OUTPUT): src/preseed.cfg $(MOUNT_POINT_RW_TARGET)
sed 's/{{user}}/$(USERNAME)/g; s@{{password}}@$(PASSWORD_ENC)@g' src/preseed.cfg > $(@)

$(ISOLINUX_CFG_OUTPUT): src/isolinux.cfg $(MOUNT_POINT_RW_TARGET)
cp src/isolinux.cfg $(@)

$(TXT_CFG_OUTPUT): src/txt.cfg $(MOUNT_POINT_RW_TARGET)
cp src/txt.cfg $(@)

$(GRUB_CFG_OUTPUT): src/grub.cfg $(MOUNT_POINT_RW_TARGET)
cp src/grub.cfg $(@)

$(MOUNT_POINT_TARGET):
test -d "$(MOUNT_POINT_RO)" || mkdir -p "$(MOUNT_POINT_RO)"
test -d "$(@)" || sudo mount -o loop "$(ISO_INPUT)" $(MOUNT_POINT_RO)

$(MOUNT_POINT_RW_TARGET): $(MOUNT_POINT_TARGET)
test -d "$(MOUNT_POINT_RW)" || mkdir -p "$(MOUNT_POINT_RW)"
cd "$(MOUNT_POINT_RO)" && \
tar cf - . | \
(cd "../rw"; tar xfp -)
sudo chown -R "$(USER)" "$(MOUNT_POINT_RW)"
chmod -R u+w "$(MOUNT_POINT_RW)"

.PHONY: clean
clean:
test -d "$(MOUNT_POINT_TARGET)" && sudo umount "$(MOUNT_POINT_RO)" || true
test -d "$(MOUNT_POINT_TARGET)" && rm -rf "$(MOUNT_POINT_RW)" || true
test -e "$(ISO_OUTPUT)" && rm "$(ISO_OUTPUT)" || true
47 changes: 47 additions & 0 deletions .requirements/preseed/src/grub.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@

if loadfont /boot/grub/font.pf2 ; then
set gfxmode=auto
insmod efi_gop
insmod efi_uga
insmod gfxterm
terminal_output gfxterm
fi

set menu_color_normal=white/black
set menu_color_highlight=black/light-gray

set timeout=5
menuentry "Try Xubuntu without installing" {
set gfxpayload=keep
linux /casper/vmlinuz file=/cdrom/preseed/xubuntu.seed quiet splash ---
initrd /casper/initrd
}
menuentry "Try Xubuntu without installing (safe graphics)" {
set gfxpayload=keep
linux /casper/vmlinuz file=/cdrom/preseed/xubuntu.seed quiet splash nomodeset ---
initrd /casper/initrd
}
menuentry "Install Xubuntu" {
set gfxpayload=keep
linux /casper/vmlinuz file=/cdrom/preseed/xubuntu.seed only-ubiquity quiet auto=true ---
initrd /casper/initrd
}
menuentry "Install Xubuntu (safe graphics)" {
set gfxpayload=keep
linux /casper/vmlinuz file=/cdrom/preseed/xubuntu.seed only-ubiquity quiet auto nomodeset ---
initrd /casper/initrd
}
menuentry "OEM install (for manufacturers)" {
set gfxpayload=keep
linux /casper/vmlinuz file=/cdrom/preseed/xubuntu.seed only-ubiquity quiet splash oem-config/enable=true ---
initrd /casper/initrd
}
grub_platform
if [ "$grub_platform" = "efi" ]; then
menuentry 'Boot from next volume' {
exit 1
}
menuentry 'UEFI Firmware Settings' {
fwsetup
}
fi
7 changes: 7 additions & 0 deletions .requirements/preseed/src/isolinux.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
default unattended
prompt 0
timeout 0
label unattended
menu label ^Install Xubuntu Unattended
kernel /casper/vmlinuz
append file=/cdrom/preeed/unattended.seed auto=true priority=critical debian-installer/locale=en_US keyboard-configuration/layoutcode=us ubiquity/reboot=true languagechooser/language-name=English countrychooser/shortlist=US localechooser/supportedlocales=en_US.UTF8 boot=casper automatic-ubiquity initrd=/casper/initrd quiet splash noprompt noshell
19 changes: 19 additions & 0 deletions .requirements/preseed/src/partman.recipe
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
256 32000 512 ext4
$primary{ } $bootable{ }
method{ format } format{ }
use_filesystem{ } filesystem{ ext4 }
mountpoint{ /boot }

16384 16386 -1 ext4
method{ format } format{ }
use_filesystem{ } filesystem{ ext4 }
mountpoint{ / }

8192 8241 16384 ext4
method{ format } format{ }
use_filesystem{ } filesystem{ ext4 }
mountpoint{ /home }

8192 8241 300% linux-swap
$primary{ }
method{ swap } format{ }
50 changes: 50 additions & 0 deletions .requirements/preseed/src/preseed.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Enable extras.ubuntu.com.
d-i apt-setup/extras boolean true
# Install the Xubuntu desktop.
tasksel tasksel/first multiselect xubuntu-desktop
# No XFCE translation packages yet.
d-i pkgsel/language-pack-patterns string
d-i base-installer/kernel/altmeta string hwe-20.04

d-i partman-auto/method string lvm
d-i partman/early_command string debconf-set partman-auto/disk "$(list-devices disk | head -n1)"
d-i partman-auto/expert_recipe string \
boot-root-home-swap :: \
512 32000 1024 ext4 \
$primary{ } \
$bootable{ } \
method{ format } \
format{ } \
use_filesystem{ } \
filesystem{ ext4 } \
mountpoint{ /boot } \
. \
4096 16386 -1 ext4 \
$primary{ } \
method{ lvm } \
vg_name{ vg01 } \
. \
2048 16386 -1 ext4 \
$lvmok{ } in_vg{ vg01 } \
lv_name{ root } \
method{ format } \
format{ } \
use_filesystem{ } \
filesystem{ ext4 } \
mountpoint{ / } \
. \
1024 16387 8096 ext4 \
$lvmok{ } in_vg{ vg01 } \
lv_name{ home } \
method{ format } \
format{ } \
use_filesystem{ } \
filesystem{ ext4 } \
mountpoint{ /home } \
. \
1024 8241 300% linux-swap \
$lvmok{ } in_vg{ vg01 } \
lv_name{ swap } \
method{ swap } \
format{ } \
.
3 changes: 3 additions & 0 deletions .requirements/preseed/src/txt.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
menu label ^Install Xubuntu
kernel /casper/vmlinuz
append initrd=/casper/initrd quiet vga=788 debian-installer/language=en debian-installer/country=US console-setup/ask_detect=false keyboard-configuration/layoutcode=us debian-installer/locale=en_US console-setup/layoutcode=us locale=en_US DEBIAN_FRONTEND=text theme=dark file=/cdrom/preseed/xubuntu.seed auto=true priority=critical ---
2 changes: 2 additions & 0 deletions containers/.local/bin/firejail-shebang
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
firejail --profile="${*}"
10 changes: 10 additions & 0 deletions containers/.local/bin/xscreensaver.profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env firejail-shebang
# include default.local
# include globals.local
# include default.profile
private-bin ${HOME}/.local/nix/profile/bin/xscreensaver
private-bin ${HOME}/.local/nix/profile/bin/xscreensaver-demo
private ${HOME}/.config/xscreensaver
whitelist ${HOME}/.local/nix/profile/bin/xscreensaver
whitelist ${HOME}/.local/nix/profile/bin/xscreensaver-demo
read-write ${HOME}/.xscreensaver
Loading