Compare commits

..

No commits in common. "dd6f579f74df7209c1d94bb0dba46c19b5e3d572" and "76003a686c96deee6decd24200fb97f1f5f3f897" have entirely different histories.

10 changed files with 15 additions and 193 deletions

View file

@ -3,6 +3,7 @@
# TODO Surely there's more elegant?
nix-channel --add https://nixos.org/channels/nixos-23.05 nixpkgs
# Below probably only needed on non-NixOS
nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz home-manager
# First commit before 23.05 release date:
nix-channel --add https://github.com/NixOS/nixos-hardware/archive/468a7a108108908c7a35d6549f1e1f0236a9448a.tar.gz nixos-hardware
nix-channel --update

View file

@ -1,71 +0,0 @@
#!/usr/bin/env nix-shell
#! nix-shell -i bash
#! nix-shell -p bash nixos-install-tools
set -euo pipefail
# Parse arguments
function help {
echo "Usage: $0 -e"
echo
echo "Options:"
echo " -h: Display this help message."
echo " -e: Erase the disk. This can be used in case the wanted partition scheme doesn't match."
}
disko_mode=mount
while getopts "e" OPTION
do
case "$OPTION" in
h)
help
exit 0
;;
e)
disko_mode=disko
;;
?)
help
exit 2
;;
esac
done
shift "$(($OPTIND -1))"
if [ "$#" -gt 0 ]
then
help
exit 2
fi
set -x
# Add channels to root user, as nixos-install uses those.
# Not great, but fixable with flakes I guess
sudo ./add_channels.sh
# Format or mount disk
sudo nix --extra-experimental-features nix-command --extra-experimental-features flakes run github:nix-community/disko -- --mode $disko_mode ./pindakaas_disko.nix
# Generate hardware-config.nix
sudo nixos-generate-config --no-filesystems --root /mnt
# --no-filesystems because they are imported via disko
# Plug system configuration into this git repo
sudo mkdir -p /mnt/etc/nixos
echo "{ ... }: { imports = [ ./hardware-configuration.nix /home/geoffrey/.config/dotfiles/pindakaas.nix ]; }" | sudo tee /mnt/etc/nixos/configuration.nix > /dev/null
# Everything there should be covered by (and conflicts with) the repo anyways.
# Install NixOS! Or create a new generation.
sudo nixos-install
# Install dotfiles. Actually not needed by nixos-install since it doesn't rewrite global paths to /mnt.
# Without it no nixos-rebuild from the system itself once installed though.
# Should probably be replaced with something like git-sync
# sudo mkdir -p /mnt/home/geoffrey/.config/
# sudo cp -a ../dotfiles /mnt/home/geoffrey/.config/
# sudo chown geoffrey:geoffrey /mnt/home/geoffrey -R
# Signal we're done!
# Although it might ask for passwords beforehand, so not sure it's really useful
echo 

View file

@ -1,12 +1,10 @@
{ ... }:
{
imports = [
"${builtins.fetchTarball "https://github.com/NixOS/nixos-hardware/archive/468a7a108108908c7a35d6549f1e1f0236a9448a.tar.gz"}/dell/g3/3779"
<nixos-hardware/dell/g3/3779>
./os/loader.nix
];
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "curacao";
frogeye.extra = true;
frogeye.desktop.xorg = true;

View file

@ -26,7 +26,7 @@ in
# Colored ls
# TODO Doesn't allow completion. Check out lsd instead
_colored_ls() {
${pkgs.coreutils}/bin/ls -lh --color=always $@ | ${pkgs.gawk}/bin/awk '
\ls -lh --color=always $@ | awk '
BEGIN {
FPAT = "([[:space:]]*[^[:space:]]+)";
OFS = "";
@ -475,7 +475,7 @@ in
];
sessionVariables = {
# Favourite commands
PAGER = "${pkgs.less}/bin/less";
PAGER = "${pkgs.coreutils}/bin/less";
EDITOR = "${pkgs.neovim}/bin/nvim";
# Extra config

View file

@ -16,9 +16,7 @@
dotfiles = {
path = lib.mkOption {
type = lib.types.str;
# default = "${config.home.homeDirectory}/.config/dotfiles";
# FIXME Above doesn't work outside home-manager context
default = "/home/geoffrey/.config/dotfiles";
default = "${config.home.homeDirectory}/.config/dotfiles";
};
};
};

View file

@ -2,10 +2,9 @@
{
networking.domain = "geoffrey.frogeye.fr";
time.timeZone = "Europe/Amsterdam";
boot.loader.efi.canTouchEfiVariables = true;
# Might fill emptiness?
boot.consoleLogLevel = 6; # KERN_INFO
time.timeZone = "Europe/Amsterdam";
# TODO qwerty-fr for console

View file

@ -1,7 +1,7 @@
{ pkgs, config, ... }:
{
imports = [
"${builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz"}/nixos"
<home-manager/nixos>
];
users.users.geoffrey = {
@ -9,7 +9,6 @@
extraGroups = [ "wheel" ]; # Enable sudo for the user.
shell = pkgs.zsh;
initialHashedPassword = "$y$j9T$e64bjL7iyVlniEKwKbM9g0$cCn74za0r6L9QMO20Fdxz3/SX0yvhz3Xd6.2BhtbRL1"; # Not a real password
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPE41gxrO8oZ5n3saapSwZDViOQphm6RzqgsBUyA88pU geoffrey@frogeye.fr"
];

View file

@ -7,6 +7,5 @@
./common.nix
./desktop.nix
./wireless.nix
"${builtins.fetchTarball "https://github.com/nix-community/disko/archive/3cb78c93e6a02f494aaf6aeb37481c27a2e2ee22.tar.gz"}/module.nix"
];
}

View file

@ -1,38 +1,15 @@
{ pkgs, config, ... }:
{
imports = [
# First commit before 23.05 release date:
"${builtins.fetchTarball "https://github.com/NixOS/nixos-hardware/archive/468a7a108108908c7a35d6549f1e1f0236a9448a.tar.gz"}/pine64/pinebook-pro"
<nixos-hardware/pine64/pinebook-pro>
./os/loader.nix
./pindakaas_disko.nix
];
boot = {
# nixos-hardware use latest kernel by default. It has been set a while ago, we maybe don't need it anymore?
kernelPackages = pkgs.linuxPackages;
# Pinebook supports UEFI, at least when tow-boot is installed on the SPI
loader = {
# EFI Variables don't work (no generation appears in systemd-boot)
efi.canTouchEfiVariables = false;
# systemd-boot crashes after booting, so GRUB it is
grub = {
enable = true;
efiSupport = true;
efiInstallAsRemovable = true;
device = "nodev";
};
};
};
# nixos-hardware use latest kernel by default. This obviously runs quickly out of sync with zfs packages.
boot.kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages;
networking.hostName = "pindakaas";
# DEBUG Barebones is faster
frogeye.dev.ansible = false;
frogeye.dev.python = false;
# frogeye.extra = false; # FIXME Not working yet
# frogeye.desktop.xorg = true;
# frogeye.dev.docker = true;
frogeye.extra = false; # FIXME Not working yet
frogeye.desktop.xorg = true;
frogeye.dev.docker = true;
}

View file

@ -1,78 +0,0 @@
{
disko.devices = {
disk = {
pindakaas_sd = {
type = "disk";
device = "/dev/disk/by-id/mmc-SN32G_0xfb19ae99";
content = {
type = "gpt";
partitions = {
ESP = {
# Needs enough to store multiple kernel generations
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [
"defaults"
];
};
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
# FIXME Hang on Linux boot, for some reason
# luks = {
# size = "100%";
# content = {
# type = "luks";
# name = "pindakaas_sd";
# # disable settings.keyFile if you want to use interactive password entry
# #passwordFile = "/tmp/secret.key"; # Interactive
# settings = {
# # Not having SSDs die fast is more important than crypto
# # nerds that could potentially discover which filesystem I
# # use from TRIM patterns
# allowDiscards = true;
# # keyFile = "/tmp/secret.key";
# fallbackToPassword = true; # TEST
# };
# # additionalKeyFiles = [ "/tmp/additionalSecret.key" ];
# content = {
# type = "btrfs";
# extraArgs = [ "-f" ];
# subvolumes = {
# "/nixos" = {
# mountpoint = "/";
# mountOptions = [ "compress=zstd" "noatime" ];
# };
# "/home" = {
# mountpoint = "/home";
# mountOptions = [ "compress=zstd" "relatime" ];
# };
# "/nix" = {
# mountpoint = "/nix";
# mountOptions = [ "compress=zstd" "noatime" ];
# };
# # Maybe later
# # "/swap" = {
# # mountpoint = "/.swapvol";
# # swap.swapfile.size = "20M";
# # };
# };
# };
# };
# };
};
};
};
};
};
}