chore: hax
This commit is contained in:
parent
57d59e5f69
commit
e6243b48ba
17 changed files with 104 additions and 60 deletions
3
docs/vm/faq.md
Normal file
3
docs/vm/faq.md
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
## Why not recurse the module folder
|
||||||
|
|
||||||
|
Imports are special in NIX and its important that they are definet at runtime for lazy evaluation - if you do optional/coded imports not everything is avaliable for evaluating.
|
|
@ -9,7 +9,6 @@
|
||||||
imports = [
|
imports = [
|
||||||
|
|
||||||
# Common imports
|
# Common imports
|
||||||
../common/optional/fish.nix
|
|
||||||
../common/optional/gnome.nix
|
../common/optional/gnome.nix
|
||||||
../common/optional/editors/vscode
|
../common/optional/editors/vscode
|
||||||
../common/optional/firefox.nix
|
../common/optional/firefox.nix
|
||||||
|
@ -25,13 +24,13 @@
|
||||||
|
|
||||||
fileSystems."/" =
|
fileSystems."/" =
|
||||||
{
|
{
|
||||||
device = "/dev/disk/by-label/701fc943-ede7-41ed-8a53-3cc38fc68fe5";
|
device = "/dev/disk/by-uuid/701fc943-ede7-41ed-8a53-3cc38fc68fe5";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/boot" =
|
fileSystems."/boot" =
|
||||||
{
|
{
|
||||||
device = "/dev/disk/by-uuid/C634-F571";
|
device = "/dev/disk/by-uuid/1D5B-36D3";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,32 +0,0 @@
|
||||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
|
||||||
# and may be overwritten by future invocations. Please make changes
|
|
||||||
# to /etc/nixos/configuration.nix instead.
|
|
||||||
{ config, lib, pkgs, modulesPath, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
fileSystems."/" =
|
|
||||||
{
|
|
||||||
device = "/dev/disk/by-uuid/701fc943-ede7-41ed-8a53-3cc38fc68fe5";
|
|
||||||
fsType = "ext4";
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/boot" =
|
|
||||||
{
|
|
||||||
device = "/dev/disk/by-uuid/C634-F571";
|
|
||||||
fsType = "vfat";
|
|
||||||
};
|
|
||||||
|
|
||||||
swapDevices = [ ];
|
|
||||||
|
|
||||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
|
||||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
|
||||||
# still possible to use this option, but it's recommended to use it in conjunction
|
|
||||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
|
||||||
networking.useDHCP = lib.mkDefault true;
|
|
||||||
# networking.interfaces.enp12s0.useDHCP = lib.mkDefault true;
|
|
||||||
# networking.interfaces.wlp13s0.useDHCP = lib.mkDefault true;
|
|
||||||
|
|
||||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
{
|
|
||||||
programs.fish = {
|
|
||||||
enable = true;
|
|
||||||
vendor = {
|
|
||||||
completions.enable = true;
|
|
||||||
config.enable = true;
|
|
||||||
functions.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -7,7 +7,6 @@
|
||||||
, ...
|
, ...
|
||||||
}: {
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
../common/optional/fish.nix
|
|
||||||
../common/optional/monitoring.nix
|
../common/optional/monitoring.nix
|
||||||
../common/optional/reboot-required.nix
|
../common/optional/reboot-required.nix
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
imports = [
|
imports = [
|
||||||
|
|
||||||
# Common imports
|
# Common imports
|
||||||
../common/optional/fish.nix
|
|
||||||
../common/optional/gnome.nix
|
../common/optional/gnome.nix
|
||||||
../common/optional/editors/vscode
|
../common/optional/editors/vscode
|
||||||
../common/optional/firefox.nix
|
../common/optional/firefox.nix
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./system
|
./system
|
||||||
|
./programs
|
||||||
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
5
nixos/modules/nixos/programs/default.nix
Normal file
5
nixos/modules/nixos/programs/default.nix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./shell
|
||||||
|
];
|
||||||
|
}
|
5
nixos/modules/nixos/programs/shell/default.nix
Normal file
5
nixos/modules/nixos/programs/shell/default.nix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./fish.nix
|
||||||
|
];
|
||||||
|
}
|
46
nixos/modules/nixos/programs/shell/fish.nix
Normal file
46
nixos/modules/nixos/programs/shell/fish.nix
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
{ lib
|
||||||
|
, config
|
||||||
|
, self
|
||||||
|
, pkgs
|
||||||
|
, ...
|
||||||
|
}:
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.mySystem.shell.fish;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.mySystem.shell.fish =
|
||||||
|
{
|
||||||
|
enable = mkEnableOption "Fish";
|
||||||
|
enablePlugins = mkOption
|
||||||
|
{
|
||||||
|
type = lib.types.bool;
|
||||||
|
description = "If we want to add fish plugins";
|
||||||
|
default = true;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
# Install fish systemwide
|
||||||
|
config.programs.fish = mkIf cfg.enable {
|
||||||
|
enable = true;
|
||||||
|
vendor = {
|
||||||
|
completions.enable = true;
|
||||||
|
config.enable = true;
|
||||||
|
functions.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Install fish plugins systemwide
|
||||||
|
config.mySystem.system.packages = with pkgs; mkIf cfg.enable [
|
||||||
|
fishPlugins.done
|
||||||
|
fishPlugins.fzf-fish
|
||||||
|
fishPlugins.forgit
|
||||||
|
fishPlugins.hydro
|
||||||
|
fzf
|
||||||
|
fishPlugins.grc
|
||||||
|
grc
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
|
@ -17,7 +17,7 @@ in
|
||||||
|
|
||||||
};
|
};
|
||||||
gc = {
|
gc = {
|
||||||
enabled = mkEnableOption "automatic garbage collection" // {
|
enable = mkEnableOption "automatic garbage collection" // {
|
||||||
default = true;
|
default = true;
|
||||||
};
|
};
|
||||||
persistent = mkOption
|
persistent = mkOption
|
||||||
|
@ -35,9 +35,9 @@ in
|
||||||
optimise.automatic = cfg.autoOptimiseStore;
|
optimise.automatic = cfg.autoOptimiseStore;
|
||||||
|
|
||||||
# automatically garbage collect nix store
|
# automatically garbage collect nix store
|
||||||
gc = mkIf cfg.gc.enabled {
|
gc = mkIf cfg.gc.enable {
|
||||||
# garbage collection
|
# garbage collection
|
||||||
automatic = cfg.gc.enabled;
|
automatic = cfg.gc.enable;
|
||||||
options = "--delete-older-than 30d";
|
options = "--delete-older-than 30d";
|
||||||
persistent = cfg.gc.persistent;
|
persistent = cfg.gc.persistent;
|
||||||
};
|
};
|
||||||
|
|
|
@ -13,11 +13,7 @@ with lib;
|
||||||
imports =
|
imports =
|
||||||
[
|
[
|
||||||
(modulesPath + "/installer/scan/not-detected.nix") # Generated by nixos-config-generate
|
(modulesPath + "/installer/scan/not-detected.nix") # Generated by nixos-config-generate
|
||||||
./global/nix.nix
|
./global
|
||||||
./global/users.nix
|
|
||||||
./global/sops.nix
|
|
||||||
./global/nixpkgs.nix
|
|
||||||
./global/system.nix
|
|
||||||
];
|
];
|
||||||
|
|
||||||
mySystem = {
|
mySystem = {
|
||||||
|
@ -26,8 +22,14 @@ with lib;
|
||||||
time.timeZone = "Australia/Melbourne";
|
time.timeZone = "Australia/Melbourne";
|
||||||
security.increaseWheelLoginLimits = true;
|
security.increaseWheelLoginLimits = true;
|
||||||
system.packages = [ pkgs.bat ];
|
system.packages = [ pkgs.bat ];
|
||||||
|
|
||||||
|
# Lets see if fish everywhere is OK on the pi's
|
||||||
|
# TODO decide if i drop to bash on pis?
|
||||||
|
shell.fish.enable = true;
|
||||||
|
# But wont enable plugins globally, leave them for workstations
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
i18n = {
|
i18n = {
|
||||||
defaultLocale = lib.mkDefault "en_AU.UTF-8";
|
defaultLocale = lib.mkDefault "en_AU.UTF-8";
|
||||||
};
|
};
|
||||||
|
|
9
nixos/profiles/global/default.nix
Normal file
9
nixos/profiles/global/default.nix
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./nix.nix
|
||||||
|
./nixpkgs.nix
|
||||||
|
./sops.nix
|
||||||
|
./system.nix
|
||||||
|
./users.nix
|
||||||
|
];
|
||||||
|
}
|
|
@ -26,6 +26,7 @@
|
||||||
|
|
||||||
# Substitutions
|
# Substitutions
|
||||||
trusted-substituters = [
|
trusted-substituters = [
|
||||||
|
"https://cache.garnix.io"
|
||||||
"https://nix-community.cachix.org"
|
"https://nix-community.cachix.org"
|
||||||
"https://numtide.cachix.org"
|
"https://numtide.cachix.org"
|
||||||
];
|
];
|
||||||
|
@ -33,6 +34,7 @@
|
||||||
trusted-public-keys = [
|
trusted-public-keys = [
|
||||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||||
"numtide.cachix.org-1:2ps1kLBUWjxIneOy1Ik6cQjb41X0iXVXeHigGmycPPE="
|
"numtide.cachix.org-1:2ps1kLBUWjxIneOy1Ik6cQjb41X0iXVXeHigGmycPPE="
|
||||||
|
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
|
||||||
];
|
];
|
||||||
|
|
||||||
# Fallback quickly if substituters are not available.
|
# Fallback quickly if substituters are not available.
|
||||||
|
|
|
@ -2,12 +2,20 @@
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
{
|
{
|
||||||
|
|
||||||
|
mySystem.system.packages = with pkgs; [
|
||||||
|
ntfs3g
|
||||||
|
];
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
|
|
||||||
initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
|
initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ];
|
||||||
kernelModules = [ "kvm-amd" ];
|
kernelModules = [ "kvm-amd" ];
|
||||||
extraModulePackages = [ ];
|
extraModulePackages = [ ];
|
||||||
|
|
||||||
|
# for managing/mounting ntfs
|
||||||
|
supportedFilesystems = [ "ntfs" ];
|
||||||
|
|
||||||
loader = {
|
loader = {
|
||||||
systemd-boot.enable = true;
|
systemd-boot.enable = true;
|
||||||
efi.canTouchEfiVariables = true;
|
efi.canTouchEfiVariables = true;
|
||||||
|
|
|
@ -9,6 +9,9 @@ with lib;
|
||||||
kernelModules = [ "kvm-amd" ];
|
kernelModules = [ "kvm-amd" ];
|
||||||
extraModulePackages = [ ];
|
extraModulePackages = [ ];
|
||||||
|
|
||||||
|
# for managing/mounting ntfs
|
||||||
|
supportedFilesystems = [ "ntfs" ];
|
||||||
|
|
||||||
loader = {
|
loader = {
|
||||||
systemd-boot.enable = true;
|
systemd-boot.enable = true;
|
||||||
efi.canTouchEfiVariables = true;
|
efi.canTouchEfiVariables = true;
|
||||||
|
@ -21,6 +24,9 @@ with lib;
|
||||||
# set xserver videodrivers for amp gpu
|
# set xserver videodrivers for amp gpu
|
||||||
services.xserver.videoDrivers = [ "amdgpu" ];
|
services.xserver.videoDrivers = [ "amdgpu" ];
|
||||||
|
|
||||||
|
# As this is a laptop explicitly enable nmcli (likely enabled by GUI anyway)
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,13 +5,15 @@
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
{
|
{
|
||||||
boot = {
|
|
||||||
|
config.mySystem.shell.fish.plugins = true;
|
||||||
|
config.boot = {
|
||||||
|
|
||||||
binfmt.emulatedSystems = [ "aarch64-linux" ]; # Enabled for raspi4 compilation
|
binfmt.emulatedSystems = [ "aarch64-linux" ]; # Enabled for raspi4 compilation
|
||||||
plymouth.enable = true;
|
plymouth.enable = true; # hide console with splash screen
|
||||||
};
|
};
|
||||||
|
|
||||||
nix.settings = {
|
config.nix.settings = {
|
||||||
# TODO factor out into mySystem
|
# TODO factor out into mySystem
|
||||||
# Avoid disk full issues
|
# Avoid disk full issues
|
||||||
max-free = lib.mkDefault (1000 * 1000 * 1000);
|
max-free = lib.mkDefault (1000 * 1000 * 1000);
|
||||||
|
@ -19,12 +21,11 @@ with lib;
|
||||||
};
|
};
|
||||||
|
|
||||||
# set xserver videodrivers if used
|
# set xserver videodrivers if used
|
||||||
services.xserver.enable = true;
|
config.services.xserver.enable = true;
|
||||||
|
|
||||||
# Laptop so ill likely use wireles
|
# Laptop so ill likely use wireles
|
||||||
# very likely to be set by GUI packages but lets
|
# very likely to be set by GUI packages but lets
|
||||||
# be declarative.
|
# be declarative.
|
||||||
networking.networkmanager.enable = true;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue