Compare commits
No commits in common. "05b1f2d88ae592350e086adfb8e1772e5d976a77" and "36608fa9e447cc73dfe60bdf48d96148f7cbd099" have entirely different histories.
05b1f2d88a
...
36608fa9e4
4
.gitignore
vendored
4
.gitignore
vendored
|
@ -1,4 +0,0 @@
|
||||||
*/system
|
|
||||||
*/vm
|
|
||||||
*/vmWithBootLoader
|
|
||||||
*.qcow2
|
|
|
@ -1,8 +1,8 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
# TODO Flakes
|
# TODO Surely there's more elegant?
|
||||||
|
|
||||||
nix-channel --add https://nixos.org/channels/nixos-23.11 nixpkgs
|
nix-channel --add https://nixos.org/channels/nixos-23.05 nixpkgs
|
||||||
nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.11.tar.gz home-manager
|
# Below probably only needed on non-NixOS
|
||||||
nix-channel --add https://github.com/NixOS/nixos-hardware/archive/8772491ed75f150f02552c60694e1beff9f46013.tar.gz nixos-hardware
|
nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz home-manager
|
||||||
nix-channel --update
|
nix-channel --update
|
||||||
|
|
66
build_os.sh
66
build_os.sh
|
@ -1,66 +0,0 @@
|
||||||
#!/usr/bin/env nix-shell
|
|
||||||
#! nix-shell -i bash
|
|
||||||
#! nix-shell -p bash nix-output-monitor
|
|
||||||
|
|
||||||
set -euo pipefail
|
|
||||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
||||||
|
|
||||||
# Parse arguments
|
|
||||||
function help {
|
|
||||||
echo "Usage: $0 [-h|-v|-b] profile"
|
|
||||||
echo
|
|
||||||
echo "Arguments:"
|
|
||||||
echo " profile: OS/disk profile to use"
|
|
||||||
echo
|
|
||||||
echo "Options:"
|
|
||||||
echo " -h: Display this help message."
|
|
||||||
echo " -v: Build a virtual machine."
|
|
||||||
echo " -b: Build a virtual machine with boot loader."
|
|
||||||
}
|
|
||||||
|
|
||||||
attr=system
|
|
||||||
while getopts "hvb" OPTION
|
|
||||||
do
|
|
||||||
case "$OPTION" in
|
|
||||||
h)
|
|
||||||
help
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
v)
|
|
||||||
attr=vm
|
|
||||||
;;
|
|
||||||
b)
|
|
||||||
attr=vmWithBootLoader
|
|
||||||
;;
|
|
||||||
?)
|
|
||||||
help
|
|
||||||
exit 2
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
shift "$(($OPTIND -1))"
|
|
||||||
|
|
||||||
if [ "$#" -ne 1 ]
|
|
||||||
then
|
|
||||||
help
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
profile="$1"
|
|
||||||
|
|
||||||
profile_dir="${SCRIPT_DIR}/${profile}"
|
|
||||||
if [ ! -d "$profile_dir" ]
|
|
||||||
then
|
|
||||||
echo "Profile not found."
|
|
||||||
fi
|
|
||||||
|
|
||||||
nixos_config="${profile_dir}/os.nix"
|
|
||||||
if [ ! -f "$nixos_config" ]
|
|
||||||
then
|
|
||||||
echo "NixOS configuration not found."
|
|
||||||
fi
|
|
||||||
|
|
||||||
set -x
|
|
||||||
|
|
||||||
nom-build '<nixpkgs/nixos>' -I "nixos-config=${nixos_config}" -A "$attr" -o "${profile_dir}/${attr}"
|
|
||||||
|
|
||||||
echo
|
|
|
@ -1,15 +1,8 @@
|
||||||
{ lib, ... }:
|
{ lib, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
<nixos-hardware/dell/g3/3779>
|
"${builtins.fetchTarball "https://github.com/NixOS/nixos-hardware/archive/468a7a108108908c7a35d6549f1e1f0236a9448a.tar.gz"}/dell/g3/3779"
|
||||||
];
|
];
|
||||||
|
|
||||||
# UEFI works here, and variables can be touched
|
boot.loader.efi.canTouchEfiVariables = lib.mkDefault true;
|
||||||
boot.loader = {
|
|
||||||
efi.canTouchEfiVariables = lib.mkDefault true;
|
|
||||||
grub = {
|
|
||||||
enable = true;
|
|
||||||
efiSupport = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
{ id, name, ... }:
|
|
||||||
{
|
{
|
||||||
disko.devices = {
|
disko.devices = {
|
||||||
disk = {
|
disk = {
|
||||||
"${name}" = {
|
pindakaas_sd = {
|
||||||
type = "disk";
|
type = "disk";
|
||||||
device = "/dev/disk/by-id/${id}";
|
device = "/dev/disk/by-id/usb-Kingston_DataTraveler_3.0_E0D55EA57414F510489F0F1A-0:0";
|
||||||
content = {
|
content = {
|
||||||
type = "gpt";
|
type = "gpt";
|
||||||
partitions = {
|
partitions = {
|
||||||
|
@ -25,8 +24,8 @@
|
||||||
size = "100%";
|
size = "100%";
|
||||||
content = {
|
content = {
|
||||||
type = "luks";
|
type = "luks";
|
||||||
name = "${name}";
|
name = "pindakaas_sd";
|
||||||
passwordFile = "/tmp/secret.key"; # TODO Generate this somehow
|
#passwordFile = "/tmp/secret.key"; # Commented out so asked interactively
|
||||||
settings = {
|
settings = {
|
||||||
# Not having SSDs die fast is more important than crypto
|
# Not having SSDs die fast is more important than crypto
|
||||||
# nerds that could potentially discover which filesystem I
|
# nerds that could potentially discover which filesystem I
|
||||||
|
@ -62,5 +61,4 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
}
|
|
38
curacao_usb/disko-hanging.nix
Normal file
38
curacao_usb/disko-hanging.nix
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
{
|
||||||
|
disko.devices = {
|
||||||
|
disk = {
|
||||||
|
vdb = {
|
||||||
|
type = "disk";
|
||||||
|
device = "/dev/disk/by-id/usb-Kingston_DataTraveler_3.0_E0D55EA57414F510489F0F1A-0:0";
|
||||||
|
content = {
|
||||||
|
type = "gpt";
|
||||||
|
partitions = {
|
||||||
|
ESP = {
|
||||||
|
size = "500M";
|
||||||
|
type = "EF00";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
luks = {
|
||||||
|
size = "100%";
|
||||||
|
content = {
|
||||||
|
type = "luks";
|
||||||
|
name = "crypted";
|
||||||
|
settings.allowDiscards = true;
|
||||||
|
passwordFile = "/tmp/secret.key";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "ext4";
|
||||||
|
mountpoint = "/";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
32
curacao_usb/disko-working.nix
Normal file
32
curacao_usb/disko-working.nix
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
{
|
||||||
|
disko.devices = {
|
||||||
|
disk = {
|
||||||
|
vdb = {
|
||||||
|
type = "disk";
|
||||||
|
device = "/dev/disk/by-id/usb-Kingston_DataTraveler_3.0_E0D55EA57414F510489F0F1A-0:0";
|
||||||
|
content = {
|
||||||
|
type = "gpt";
|
||||||
|
partitions = {
|
||||||
|
ESP = {
|
||||||
|
size = "500M";
|
||||||
|
type = "EF00";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
root = {
|
||||||
|
size = "100%";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "ext4";
|
||||||
|
mountpoint = "/";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -1 +0,0 @@
|
||||||
import ../dk/single_uefi_btrfs.nix { id = "usb-Kingston_DataTraveler_3.0_E0D55EA57414F510489F0F1A-0:0"; name = "curacao_usb"; }
|
|
1
curacao_usb/disko.nix
Symbolic link
1
curacao_usb/disko.nix
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
disko-hanging.nix
|
|
@ -1,22 +1,30 @@
|
||||||
{ pkgs, config, ... }:
|
{ pkgs, config, ... }:
|
||||||
{
|
{
|
||||||
|
# This whole folder is DEBUG
|
||||||
imports = [
|
imports = [
|
||||||
../os
|
"${builtins.fetchTarball "https://github.com/nix-community/disko/archive/3cb78c93e6a02f494aaf6aeb37481c27a2e2ee22.tar.gz"}/module.nix"
|
||||||
../curacao/options.nix
|
|
||||||
../curacao/hardware.nix
|
|
||||||
./disko.nix
|
./disko.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
networking.hostName = "curacao_usb";
|
networking.hostName = "curacao_usb";
|
||||||
|
|
||||||
# It's a removable drive, so no touching EFI vars
|
boot = {
|
||||||
# (quite a lot of stuff to set for that!)
|
# nixos-hardware use latest kernel by default. It has been set a while ago, we maybe don't need it anymore?
|
||||||
boot.loader = {
|
kernelPackages = pkgs.linuxPackages;
|
||||||
efi.canTouchEfiVariables = false;
|
|
||||||
grub = {
|
# Pinebook supports UEFI, at least when tow-boot is installed on the SPI
|
||||||
efiInstallAsRemovable = true;
|
loader = {
|
||||||
device = "nodev";
|
# 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";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
# full profile
|
|
||||||
|
|
||||||
Fake configuration that contains everything I could ever need,
|
|
||||||
used for debugging.
|
|
||||||
Can't build a full system due to not having a filesystem / bootloader configuration,
|
|
||||||
build as a VM (without bootloader).
|
|
|
@ -172,7 +172,8 @@ in
|
||||||
enable = true;
|
enable = true;
|
||||||
enableAutosuggestions = true;
|
enableAutosuggestions = true;
|
||||||
enableCompletion = true;
|
enableCompletion = true;
|
||||||
syntaxHighlighting.enable = true;
|
enableSyntaxHighlighting = true;
|
||||||
|
# syntaxHighlighting.enable = true; # 23.11 syntax
|
||||||
historySubstringSearch.enable = true;
|
historySubstringSearch.enable = true;
|
||||||
initExtra = lib.strings.concatLines [
|
initExtra = lib.strings.concatLines [
|
||||||
commonRc
|
commonRc
|
||||||
|
@ -349,7 +350,6 @@ in
|
||||||
];
|
];
|
||||||
extraConfig = builtins.readFile ./tmux.conf + "source-file ${themepack}/share/tmux-plugins/tmux-themepack/powerline/default/green.tmuxtheme\n";
|
extraConfig = builtins.readFile ./tmux.conf + "source-file ${themepack}/share/tmux-plugins/tmux-themepack/powerline/default/green.tmuxtheme\n";
|
||||||
};
|
};
|
||||||
translate-shell.enable = true; # TODO Cool config?
|
|
||||||
};
|
};
|
||||||
services = {
|
services = {
|
||||||
gpg-agent = {
|
gpg-agent = {
|
||||||
|
@ -394,7 +394,7 @@ in
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
home = {
|
home = {
|
||||||
stateVersion = "23.11";
|
stateVersion = "23.05";
|
||||||
language = {
|
language = {
|
||||||
base = "en_US.UTF-8";
|
base = "en_US.UTF-8";
|
||||||
# time = "en_DK.UTF-8"; # FIXME Disabled because complaints during nixos-rebuild switch
|
# time = "en_DK.UTF-8"; # FIXME Disabled because complaints during nixos-rebuild switch
|
||||||
|
@ -423,6 +423,7 @@ in
|
||||||
man
|
man
|
||||||
# nodePackages.insect # FIXME Don't install on aarch64
|
# nodePackages.insect # FIXME Don't install on aarch64
|
||||||
# TODO Use whatever replaces insect
|
# TODO Use whatever replaces insect
|
||||||
|
translate-shell
|
||||||
unzip
|
unzip
|
||||||
unrar
|
unrar
|
||||||
p7zip
|
p7zip
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
# TODO wine-gecko wine-mono lib32-libpulse (?)
|
# TODO wine-gecko wine-mono lib32-libpulse (?)
|
||||||
|
|
||||||
# gaming
|
# gaming
|
||||||
# steam # FIXME Requires i686-linux or something. IIRC the package says to use the NixOS config and not it directly.
|
steam
|
||||||
yuzu-mainline
|
yuzu-mainline
|
||||||
minecraft
|
minecraft
|
||||||
# TODO factorio
|
# TODO factorio
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
let
|
let
|
||||||
stylix = builtins.fetchGit {
|
stylix = builtins.fetchGit {
|
||||||
url = "https://github.com/danth/stylix.git";
|
url = "https://github.com/danth/stylix.git";
|
||||||
# No 23.11 branch last I checked
|
ref = "release-23.05";
|
||||||
rev = "8b3f61727f3b86c27096c3c014ae602aa40670ba";
|
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
78
hm/vim.nix
78
hm/vim.nix
|
@ -2,9 +2,9 @@
|
||||||
let
|
let
|
||||||
nixvim = import (builtins.fetchGit {
|
nixvim = import (builtins.fetchGit {
|
||||||
url = "https://github.com/nix-community/nixvim";
|
url = "https://github.com/nix-community/nixvim";
|
||||||
ref = "nixos-23.11";
|
ref = "nixos-23.05";
|
||||||
});
|
});
|
||||||
vim-shot-f = pkgs.vimUtils.buildVimPlugin {
|
vim-shot-f = pkgs.vimUtils.buildVimPluginFrom2Nix {
|
||||||
pname = "vim-shot-f";
|
pname = "vim-shot-f";
|
||||||
version = "2016-02-05";
|
version = "2016-02-05";
|
||||||
src = pkgs.fetchFromGitHub {
|
src = pkgs.fetchFromGitHub {
|
||||||
|
@ -15,7 +15,7 @@ let
|
||||||
};
|
};
|
||||||
meta.homepage = "https://github.com/deris/vim-shot-f";
|
meta.homepage = "https://github.com/deris/vim-shot-f";
|
||||||
};
|
};
|
||||||
quick-scope = pkgs.vimUtils.buildVimPlugin rec {
|
quick-scope = pkgs.vimUtils.buildVimPluginFrom2Nix rec {
|
||||||
pname = "quick-scope";
|
pname = "quick-scope";
|
||||||
version = "2.6.1";
|
version = "2.6.1";
|
||||||
src = pkgs.fetchFromGitHub {
|
src = pkgs.fetchFromGitHub {
|
||||||
|
@ -199,7 +199,8 @@ in
|
||||||
# TODO Could add some, could also remove some
|
# TODO Could add some, could also remove some
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
phpactor.enable = true; # PHP
|
# FIXME phpactor. Only from 23.11
|
||||||
|
# phpactor.enable = true; # PHP
|
||||||
rnix-lsp.enable = true; # Nix
|
rnix-lsp.enable = true; # Nix
|
||||||
# FIXME sqlls
|
# FIXME sqlls
|
||||||
yamlls.enable = true; # YAML
|
yamlls.enable = true; # YAML
|
||||||
|
@ -225,7 +226,7 @@ in
|
||||||
# indent = true; # Not very working last time I tried apparently
|
# indent = true; # Not very working last time I tried apparently
|
||||||
};
|
};
|
||||||
# TODO Investigate https://github.com/nvim-treesitter/nvim-treesitter-textobjects
|
# TODO Investigate https://github.com/nvim-treesitter/nvim-treesitter-textobjects
|
||||||
indent-blankline.enable = true; # TODO integrate with rainbow-delimiters and use more of the options
|
indent-blankline.enable = true; # 23.11 integrate with rainbow-delimiters and use more of the options
|
||||||
|
|
||||||
undotree.enable = true; # Navigate edition history
|
undotree.enable = true; # Navigate edition history
|
||||||
|
|
||||||
|
@ -269,7 +270,7 @@ in
|
||||||
|
|
||||||
# Treesitter
|
# Treesitter
|
||||||
nvim-ts-rainbow # Randomly color parenthesis pairs
|
nvim-ts-rainbow # Randomly color parenthesis pairs
|
||||||
# TODO Replace with plugins.rainbow-delimiters
|
# 23.11: Replace with plugins.rainbow-delimiters
|
||||||
|
|
||||||
# Snippets
|
# Snippets
|
||||||
vim-vsnip
|
vim-vsnip
|
||||||
|
@ -286,14 +287,14 @@ in
|
||||||
|
|
||||||
# Language-specific
|
# Language-specific
|
||||||
tcomment_vim # Language-aware (un)commenting
|
tcomment_vim # Language-aware (un)commenting
|
||||||
] ++ lib.optionals config.frogeye.extra [
|
] ++ lib.optionals config.frogeye.extra [
|
||||||
vim-LanguageTool # Check grammar for human languages
|
vim-LanguageTool # Check grammar for human languages
|
||||||
] ++ lib.optionals config.programs.pandoc.enable [
|
] ++ lib.optionals config.programs.pandoc.enable [
|
||||||
vim-pandoc # Pandoc-specific stuff because there's no LSP for it
|
vim-pandoc # Pandoc-specific stuff because there's no LSP for it
|
||||||
vim-pandoc-syntax
|
vim-pandoc-syntax
|
||||||
] ++ lib.optionals config.frogeye.dev.c [
|
] ++ lib.optionals config.frogeye.dev.c [
|
||||||
nvim-dap # Debug Adapter Protocol client
|
nvim-dap # Debug Adapter Protocol client
|
||||||
] ++ lib.optionals config.frogeye.dev.ansible [
|
] ++ lib.optionals config.frogeye.dev.ansible [
|
||||||
ansible-vim # FIXME See if it doesn't require to do ./UltiSnips/generate.sh
|
ansible-vim # FIXME See if it doesn't require to do ./UltiSnips/generate.sh
|
||||||
];
|
];
|
||||||
extraConfigLua = lib.strings.concatMapStringsSep "\n" (f: builtins.readFile f) [
|
extraConfigLua = lib.strings.concatMapStringsSep "\n" (f: builtins.readFile f) [
|
||||||
|
@ -354,53 +355,54 @@ in
|
||||||
# TODO Is not working, options is set to nil even though it shouldn't
|
# TODO Is not working, options is set to nil even though it shouldn't
|
||||||
};
|
};
|
||||||
|
|
||||||
keymaps = [
|
# 23.11: Use keymaps, seems better
|
||||||
|
maps = {
|
||||||
# GENERAL
|
# GENERAL
|
||||||
|
|
||||||
# Allow saving of files as sudo when I forgot to start vim using sudo.
|
# Allow saving of files as sudo when I forgot to start vim using sudo.
|
||||||
# From https://stackoverflow.com/a/7078429
|
# From https://stackoverflow.com/a/7078429
|
||||||
{ mode = "c"; key = "w!!"; action = "w !sudo tee > /dev/null %"; }
|
command."w!!" = { action = "w !sudo tee > /dev/null %"; };
|
||||||
|
|
||||||
{ mode = "i"; key = "jk"; action = "<Esc>"; }
|
insert."jk" = { action = "<Esc>"; };
|
||||||
{ mode = "v"; key = "<Enter>"; action = "<Esc>"; }
|
visual."<Enter>" = { action = "<Esc>"; };
|
||||||
{ key = "<Enter>"; action = "o<Esc>"; }
|
normal."<Enter>" = { action = "o<Esc>"; };
|
||||||
|
|
||||||
# { key = "<C-H>"; action = ":bp<CR>"; }
|
# normal."<C-H>" = { action = ":bp<CR>"; };
|
||||||
# { key = "<C-L>"; action = ":bn<CR>"; }
|
# normal."<C-L>" = { action = ":bn<CR>"; };
|
||||||
{ key = "<C-K>"; action = "kkkkkkkkkkkkkkkkkkkkk"; }
|
normal."<C-K>" = { action = "kkkkkkkkkkkkkkkkkkkkk"; };
|
||||||
{ key = "<C-J>"; action = "jjjjjjjjjjjjjjjjjjjjj"; }
|
normal."<C-J>" = { action = "jjjjjjjjjjjjjjjjjjjjj"; };
|
||||||
|
|
||||||
# \s to replace globally the word under the cursor
|
# \s to replace globally the word under the cursor
|
||||||
{ key = "<Leader>s"; action = ":%s/\\<<C-r><C-w>\\>/"; }
|
normal."<Leader>s" = { action = ":%s/\\<<C-r><C-w>\\>/"; };
|
||||||
|
|
||||||
# PLUGINS
|
# PLUGINS
|
||||||
|
|
||||||
# barbar
|
# barbar
|
||||||
{ key = "<C-H>"; action = "<Cmd>BufferPrevious<CR>"; options = { silent = true; }; }
|
normal."<C-H>" = { action = "<Cmd>BufferPrevious<CR>"; silent = true; };
|
||||||
{ key = "<C-L>"; action = "<Cmd>BufferNext<CR>"; options = { silent = true; }; }
|
normal."<C-L>" = { action = "<Cmd>BufferNext<CR>"; silent = true; };
|
||||||
# TODO https://www.reddit.com/r/neovim/comments/mbj8m5/how_to_setup_ctrlshiftkey_mappings_in_neovim_and/
|
# TODO https://www.reddit.com/r/neovim/comments/mbj8m5/how_to_setup_ctrlshiftkey_mappings_in_neovim_and/
|
||||||
{ key = "<Space><C-H>"; action = "<Cmd>BufferMovePrevious<CR>"; options = { silent = true; }; }
|
normal."<Space><C-H>" = { action = "<Cmd>BufferMovePrevious<CR>"; silent = true; };
|
||||||
{ key = "<Space><C-L>"; action = "<Cmd>BufferMoveNext<CR>"; options = { silent = true; }; }
|
normal."<Space><C-L>" = { action = "<Cmd>BufferMoveNext<CR>"; silent = true; };
|
||||||
# TODO gotos don't work
|
# TODO gotos don't work
|
||||||
{ key = "<C-1>"; action = "<Cmd>BufferGoto 1<CR>"; options = { silent = true; }; }
|
normal."<C-1>" = { action = "<Cmd>BufferGoto 1<CR>"; silent = true; };
|
||||||
{ key = "<C-2>"; action = "<Cmd>BufferGoto 2<CR>"; options = { silent = true; }; }
|
normal."<C-2>" = { action = "<Cmd>BufferGoto 2<CR>"; silent = true; };
|
||||||
{ key = "<C-3>"; action = "<Cmd>BufferGoto 3<CR>"; options = { silent = true; }; }
|
normal."<C-3>" = { action = "<Cmd>BufferGoto 3<CR>"; silent = true; };
|
||||||
{ key = "<C-4>"; action = "<Cmd>BufferGoto 4<CR>"; options = { silent = true; }; }
|
normal."<C-4>" = { action = "<Cmd>BufferGoto 4<CR>"; silent = true; };
|
||||||
{ key = "<C-5>"; action = "<Cmd>BufferGoto 5<CR>"; options = { silent = true; }; }
|
normal."<C-5>" = { action = "<Cmd>BufferGoto 5<CR>"; silent = true; };
|
||||||
{ key = "<C-6>"; action = "<Cmd>BufferGoto 6<CR>"; options = { silent = true; }; }
|
normal."<C-6>" = { action = "<Cmd>BufferGoto 6<CR>"; silent = true; };
|
||||||
{ key = "<C-7>"; action = "<Cmd>BufferGoto 7<CR>"; options = { silent = true; }; }
|
normal."<C-7>" = { action = "<Cmd>BufferGoto 7<CR>"; silent = true; };
|
||||||
{ key = "<C-8>"; action = "<Cmd>BufferGoto 8<CR>"; options = { silent = true; }; }
|
normal."<C-8>" = { action = "<Cmd>BufferGoto 8<CR>"; silent = true; };
|
||||||
{ key = "<C-9>"; action = "<Cmd>BufferGoto 9<CR>"; options = { silent = true; }; }
|
normal."<C-9>" = { action = "<Cmd>BufferGoto 9<CR>"; silent = true; };
|
||||||
{ key = "<C-0>"; action = "<Cmd>BufferLast<CR>"; options = { silent = true; }; }
|
normal."<C-0>" = { action = "<Cmd>BufferLast<CR>"; silent = true; };
|
||||||
{ key = "gb"; action = "<Cmd>BufferPick<CR>"; options = { silent = true; }; }
|
normal."gb" = { action = "<Cmd>BufferPick<CR>"; silent = true; };
|
||||||
# TODO Other useful options?
|
# TODO Other useful options?
|
||||||
|
|
||||||
# symbols-outline-nvim
|
# symbols-outline-nvim
|
||||||
{ key = "<Space>s"; action = "<Cmd>SymbolsOutline<CR>"; options = { silent = true; }; }
|
normal."<Space>s" = { action = "<Cmd>SymbolsOutline<CR>"; silent = true; };
|
||||||
|
|
||||||
# undotree
|
# undotree
|
||||||
{ key = "<Space>u"; action = "<Cmd>UndotreeToggle<CR>"; options = { silent = true; }; }
|
normal."<Space>u" = { action = "<Cmd>UndotreeToggle<CR>"; silent = true; };
|
||||||
|
|
||||||
];
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,10 +7,10 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||||
|
|
||||||
# Parse arguments
|
# Parse arguments
|
||||||
function help {
|
function help {
|
||||||
echo "Usage: $0 [-h|-e] profile"
|
echo "Usage: $0 [-e] [-h] profile"
|
||||||
echo
|
echo
|
||||||
echo "Arguments:"
|
echo "Arguments:"
|
||||||
echo " profile: OS/disk profile to use"
|
echo " file: OS/disk profile to use"
|
||||||
echo
|
echo
|
||||||
echo "Options:"
|
echo "Options:"
|
||||||
echo " -h: Display this help message."
|
echo " -h: Display this help message."
|
||||||
|
@ -18,7 +18,7 @@ function help {
|
||||||
}
|
}
|
||||||
|
|
||||||
disko_mode=mount
|
disko_mode=mount
|
||||||
while getopts "he" OPTION
|
while getopts "e" OPTION
|
||||||
do
|
do
|
||||||
case "$OPTION" in
|
case "$OPTION" in
|
||||||
h)
|
h)
|
||||||
|
|
|
@ -55,6 +55,7 @@
|
||||||
chrony = {
|
chrony = {
|
||||||
enable = true;
|
enable = true;
|
||||||
servers = map (n: "${toString n}.europe.pool.ntp.org") (lib.lists.range 0 3);
|
servers = map (n: "${toString n}.europe.pool.ntp.org") (lib.lists.range 0 3);
|
||||||
|
extraConfig = "rtcsync"; # See 23.11 release notes
|
||||||
};
|
};
|
||||||
|
|
||||||
# Prevent power button from shutting down the computer.
|
# Prevent power button from shutting down the computer.
|
||||||
|
@ -73,6 +74,6 @@
|
||||||
system.copySystemConfiguration = true;
|
system.copySystemConfiguration = true;
|
||||||
|
|
||||||
# Use defaults from
|
# Use defaults from
|
||||||
system.stateVersion = "23.11";
|
system.stateVersion = "23.05";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{ pkgs, config, ... }:
|
{ pkgs, config, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
<home-manager/nixos>
|
"${builtins.fetchTarball "https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz"}/nixos"
|
||||||
];
|
];
|
||||||
|
|
||||||
users.users.geoffrey = {
|
users.users.geoffrey = {
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
{ pkgs, config, ... }:
|
{ pkgs, config, ... }:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
<nixos-hardware/pine64/pinebook-pro>
|
# First commit before 23.05 release date:
|
||||||
|
"${builtins.fetchTarball "https://github.com/NixOS/nixos-hardware/archive/468a7a108108908c7a35d6549f1e1f0236a9448a.tar.gz"}/pine64/pinebook-pro"
|
||||||
];
|
];
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
|
@ -9,7 +10,6 @@
|
||||||
kernelPackages = pkgs.linuxPackages;
|
kernelPackages = pkgs.linuxPackages;
|
||||||
|
|
||||||
# Otherwise it will not show stage1 echo and prompt
|
# Otherwise it will not show stage1 echo and prompt
|
||||||
# UPST
|
|
||||||
kernelParams = ["console=tty0"];
|
kernelParams = ["console=tty0"];
|
||||||
|
|
||||||
# Pinebook supports UEFI, at least when tow-boot is installed on the SPI
|
# Pinebook supports UEFI, at least when tow-boot is installed on the SPI
|
||||||
|
|
|
@ -1 +1,65 @@
|
||||||
import ../dk/single_uefi_btrfs.nix { id = "mmc-SN32G_0xfb19ae99"; name = "pindakaas_sd"; }
|
{
|
||||||
|
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"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
luks = {
|
||||||
|
size = "100%";
|
||||||
|
content = {
|
||||||
|
type = "luks";
|
||||||
|
name = "pindakaas_sd";
|
||||||
|
passwordFile = "/tmp/secret.key"; # TODO Generate this somehow
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
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";
|
||||||
|
# };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
1
pindakaas_sd/hybrid
Symbolic link
1
pindakaas_sd/hybrid
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
/nix/store/bz6nqy0ky5l33rfrkb6k66bzkgw18k90-nixos-system-pindakaas_sd-23.05.4981.5b528f99f73c
|
2
vm/.gitignore
vendored
Normal file
2
vm/.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
*.qcow2
|
||||||
|
result
|
11
vm/build.sh
Executable file
11
vm/build.sh
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
#!/usr/bin/env nix-shell
|
||||||
|
#! nix-shell -i bash
|
||||||
|
#! nix-shell -p bash nix-output-monitor
|
||||||
|
|
||||||
|
# Build a NixOS VM for testing
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||||
|
|
||||||
|
nom-build '<nixpkgs/nixos>' -A vm \
|
||||||
|
-I nixos-config=./os.nix
|
|
@ -9,6 +9,6 @@
|
||||||
fpga = true;
|
fpga = true;
|
||||||
python = true;
|
python = true;
|
||||||
};
|
};
|
||||||
extra = true;
|
# extra = true; # FIXME Should support aarch64
|
||||||
};
|
};
|
||||||
}
|
}
|
Loading…
Reference in a new issue