nix #11

Manually merged
geoffrey merged 113 commits from nix into main 2023-12-09 21:43:01 +01:00
13 changed files with 62 additions and 33 deletions
Showing only changes of commit 5125e05266 - Show all commits

6
config/nix/add_channels.sh Executable file
View file

@ -0,0 +1,6 @@
#!/usr/bin/env bash
# TODO Surely there's more elegant?
nix-channel --add https://nixos.org/channels/nixos-23.05 nixpkgs
nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.05.tar.gz home-manager
nix-channel --add https://github.com/NixOS/nixos-hardware/archive/master.tar.gz nixos-hardware

View file

@ -1,3 +1,20 @@
#/usr/bin/env sh #/usr/bin/env sh
# Build a disk image for testing on pindakaas via sd card
export NIXPKGS_ALLOW_UNFREE=1 export NIXPKGS_ALLOW_UNFREE=1
nix-build '<nixpkgs/nixos>' -A config.system.build.sdImage -I nixos-config=./pindakaas.nix extra=""
if [ "$(uname -m)" != "aarch64" ]
then
# If we have binfmt QEMU (https://nixos.wiki/wiki/NixOS_on_ARM#Compiling_through_binfmt_QEMU),
# we can pretend we're aarch64.
if [ -f /proc/sys/fs/binfmt_misc/qemu-aarch64 ]
then
extra="--argstr system aarch64-linux"
# Otherwise, use cross-compilation...
# theorically faster but doesn't use the cache and never got it to build a full customized image
else
extra="--argstr nixpkgs.crossSystem.system aarch64-linux"
fi
fi
nix-build '<nixpkgs/nixos>' -A config.system.build.sdImage -I nixos-config=./pindakaas.nix $extra --show-trace

18
config/nix/build-vm.sh Executable file
View file

@ -0,0 +1,18 @@
#/usr/bin/env sh
# Build a NixOS VM for testing
#
# For x86_64 hosts: use curacao config
# For aarch64 hosts: use pindakaas config
export NIXPKGS_ALLOW_UNFREE=1
if [ "$(uname -m)" == "x86_64" ]
then
config=./curacao.nix
elif [ "$(uname -m)" == "aarch64" ]
then
config=./pindakaas.nix
fi
nix-build '<nixpkgs/nixos>' -A vm \
-I nixpkgs=channel:nixos-23.05 \
-I nixos-config=${config}

View file

@ -1,5 +0,0 @@
#/usr/bin/env sh
export NIXPKGS_ALLOW_UNFREE=1
nix-build '<nixpkgs/nixos>' -A vm \
-I nixpkgs=channel:nixos-23.05 \
-I nixos-config=./testvm.nix

View file

@ -5,6 +5,6 @@
./os/loader.nix ./os/loader.nix
]; ];
networking.hostName = "curacao.geoffrey.frogeye.fr"; networking.hostName = "curacao";
frogeye.extra = true; frogeye.extra = true;
} }

View file

@ -407,7 +407,8 @@ in
moreutils moreutils
man man
visidata visidata
nodePackages.insect # nodePackages.insect # FIXME Don't install on aarch64
# TODO Use whatever replaces insect
translate-shell translate-shell
unzip unzip
unrar unrar

View file

@ -269,12 +269,13 @@
"d" = "exec ${autorandrmenu {title="Default profile"; option="--default"; builtin = true;}}, mode default"; "d" = "exec ${autorandrmenu {title="Default profile"; option="--default"; builtin = true;}}, mode default";
} // return_bindings; } // return_bindings;
"${mode_temp}" = { "${mode_temp}" = {
"r" = "exec ${pkgs.sct}/bin/sct 1000"; # "r" = "exec ${pkgs.sct}/bin/sct 1000";
"d" = "exec ${pkgs.sct}/bin/sct 2000"; # "d" = "exec ${pkgs.sct}/bin/sct 2000";
"c" = "exec ${pkgs.sct}/bin/sct 4500"; # "c" = "exec ${pkgs.sct}/bin/sct 4500";
"o" = "exec ${pkgs.sct}/bin/sct"; # "o" = "exec ${pkgs.sct}/bin/sct";
"a" = "exec ${pkgs.sct}/bin/sct 8000"; # "a" = "exec ${pkgs.sct}/bin/sct 8000";
"b" = "exec ${pkgs.sct}/bin/sct 10000"; # "b" = "exec ${pkgs.sct}/bin/sct 10000";
# FIXME Not on aarch64
} // return_bindings; } // return_bindings;
}; };
window = { window = {

View file

@ -1,5 +1,4 @@
{ pkgs, ... }: { pkgs, ... }: {
{
# TODO Separate in diffrent packages once the structure is finalized... # TODO Separate in diffrent packages once the structure is finalized...
# or connvert into per-directory requirements # or connvert into per-directory requirements
home.packages = with pkgs; [ home.packages = with pkgs; [
@ -29,7 +28,7 @@
# FPGA # FPGA
yosys yosys
verilog verilog
ghdl # ghdl # TODO Not on aarch64
gtkwave # TODO Display server only gtkwave # TODO Display server only
# Network # Network

View file

@ -15,13 +15,13 @@ let
}; };
meta.homepage = "https://github.com/deris/vim-shot-f"; meta.homepage = "https://github.com/deris/vim-shot-f";
}; };
quick-scope = pkgs.vimUtils.buildVimPluginFrom2Nix { 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 {
owner = "deris"; owner = "unblevable";
repo = "quick-scope"; repo = "quick-scope";
rev = "2.6.1"; rev = "v${version}";
sha256 = "iAPvIs/lhW+w5kFTZKaY97D/kfCGtqKrJVFvZ8cHu+c="; sha256 = "iAPvIs/lhW+w5kFTZKaY97D/kfCGtqKrJVFvZ8cHu+c=";
}; };
meta.homepage = "https://github.com/unblevable/quick-scope"; meta.homepage = "https://github.com/unblevable/quick-scope";

View file

@ -1,5 +1,7 @@
{ pkgs, lib, ... }: { pkgs, lib, ... }:
{ {
networking.domain = "geoffrey.frogeye.fr";
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
time.timeZone = "Europe/Amsterdam"; time.timeZone = "Europe/Amsterdam";

View file

@ -4,7 +4,7 @@
# TODO This doesn't change anything, at least in the VM # TODO This doesn't change anything, at least in the VM
networking.wireless = { networking.wireless = {
enable = true; enable = true;
networks = builtins.fromJSON ./wireless/networks.json; # If this file doesn't exist, run ./wireless/import.py networks = builtins.fromJSON (builtins.readFile ./wireless/networks.json); # If this file doesn't exist, run ./wireless/import.py
extraConfig = '' extraConfig = ''
country=NL country=NL
''; '';

View file

@ -3,8 +3,7 @@
imports = [ imports = [
# <nixos-hardware/pine64/pinebook-pro> # <nixos-hardware/pine64/pinebook-pro>
<nixpkgs/nixos/modules/installer/sd-card/sd-image-aarch64.nix> <nixpkgs/nixos/modules/installer/sd-card/sd-image-aarch64.nix>
# ./os/loader.nix # Don't uncomment this before having put extra behind an option! ./os/loader.nix
]; ];
nixpkgs.crossSystem.system = "aarch64-linux"; networking.hostName = "pindakaas";
# networking.hostName = "pindakaas.geoffrey.frogeye.fr";
} }

View file

@ -1,9 +0,0 @@
{ ... }:
{
imports = [
./os/loader.nix
];
networking.hostName = "nixos";
frogeye.extra = true;
}