Compare commits

...

5 Commits

16 changed files with 130 additions and 24 deletions

7
README.md Normal file
View File

@ -0,0 +1,7 @@
# NixOS Configs
This repository tracks my NixOS config. Generally, this is just for me, and is public for the purpose of global accessibility without authentication moreso than for the benefit of anyone other than me. That said, anyone is welcome to browse if they feel so inspired.
## Organization
**Top level** - Root configurations and anything you'd want to point a `/etc/nixos/configuration.nix` or `~/.config/nixpkgs/home.nix` at. These are the entrypoints to the configuration.

47
configs/filesystems.nix Normal file
View File

@ -0,0 +1,47 @@
{ config, lib, pkgs, modulesPath, ... }:
let systemInformation = import ../system/system-information.nix; in
{
boot.initrd.luks.devices = {
cryptoroot = {
device = systemInformation.rootPartition;
allowDiscards = true;
bypassWorkqueues = true;
};
cryptoswap = {
device = systemInformation.swapPartition;
keyFile = "/crypto_keyfile.bin";
allowDiscards = true;
bypassWorkqueues = true;
};
};
fileSystems = {
"/" = {
device = "/dev/mapper/cryptoroot";
options = [
"defaults"
# Batch journaling commits to 2 minutes for power saving
# https://wiki.archlinux.org/title/Power_management#Writeback_Time
"commit=120"
# Performance optimizations for SSD
"noatime"
"nodiratime"
"discard"
];
# Uncomment this once the root fs is actually btrfs
# fsType = "btrfs";
};
"/boot/efi" = {
device = systemInformation.efiPartition;
fsType = "vfat";
};
};
swapDevices = [
{
device = "/dev/mapper/cryptoswap";
discardPolicy = "both";
}
];
}

11
configs/home.full.nix Normal file
View File

@ -0,0 +1,11 @@
{pkgs, ...}: {
imports = [./home.nogui.nix]
home.packages = with pkgs; [
clapper
];
home.sessionVariables = {
MOZ_ENABLE_WAYLAND = "1";
};
programs.kitty = import programs/kitty.nix pkgs;
programs.firefox = import programs/firefox.nix pkgs;
}

View File

@ -3,7 +3,6 @@
NNN_FIFO = "/tmp/nnn.fifo";
LANG = "en_US.UTF-8";
EDITOR = "nvim";
MOZ_ENABLE_WAYLAND = "1";
};
home.keyboard.layout = "us";
home.keyboard.variant = "3l";
@ -11,7 +10,6 @@
restic
ripgrep
libqalculate
clapper
git-annex
git-annex-remote-rclone
qrencode
@ -62,13 +60,11 @@
pull.rebase = false;
};
};
programs.kitty = import programs/kitty.nix pkgs;
programs.password-store = {
enable = true;
package = pkgs.pass.withExtensions (exts: [ exts.pass-otp ]);
};
programs.fish = import programs/fish.nix pkgs;
programs.firefox = import programs/firefox.nix pkgs;
programs.nnn = {
enable = true;
plugins.mappings = {
@ -106,4 +102,4 @@
dconf.settings = import ./dconf.nix;
home.stateVersion = "22.11";
targets.genericLinux.enable = true;
}
}

View File

@ -137,13 +137,13 @@ pkgs: {
command = "coc#pum#visible() ? coc#pum#prev(1) : \"\\<C-h>\"";
expr = true;
}
{
mode = "i";
binding = "<CR>";
command = "coc#pum#visible() ? coc#pum#confirm() : \"\\<C-g>u\\<CR>\\<c-r>=coc#on_enter()\\<CR>\"";
silent = true;
expr = true;
}
# {
# mode = "i";
# binding = "<CR>";
# command = "coc#pum#visible() ? coc#pum#confirm() : \"\\<C-g>u\\<CR>\\<c-r>=coc#on_enter()\\<CR>\"";
# silent = true;
# expr = true;
# }
{
mode = "n";
binding = "<C-Space>";

View File

@ -28,4 +28,6 @@ function! ShowDocumentation()
else
call feedkeys('K', 'in')
endif
endfunction
endfunction
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm() : "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"

9
home.full.nix Normal file
View File

@ -0,0 +1,9 @@
{ config, pkgs, lib, ... }:
{
imports =
[
./configs/home.full.nix
];
programs.home-manager.enable = true;
}

9
home.nogui.nix Normal file
View File

@ -0,0 +1,9 @@
{ config, pkgs, lib, ... }:
{
imports =
[
./configs/home.nogui.nix
];
programs.home-manager.enable = true;
}

View File

@ -1,19 +1,15 @@
# sudo nix-channel --add https://github.com/NixOS/nixos-hardware/archive/master.tar.gz nixos-hardware
# sudo nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
{ config, pkgs, ... }:
let systemInformation = import ./system/system-information.nix; in
{ config, pkgs, lib, ... }:
{
networking.hostName = "kudzu";
imports =
[ # Include the results of the hardware scan.
#
# DON'T FORGET to add your hardware config too
# https://github.com/NixOS/nixos-hardware/
#
# Also make sure to move the swap configuration to the hardware config
/etc/nixos/hardware-configuration.nix
[
./configs/filesystems.nix
./system/hardware-requirements.nix
<home-manager/nixos>
];
@ -41,6 +37,8 @@
# Enable networking
networking.networkmanager.enable = true;
powerManagement.cpuFreqGovernor = "powersave";
# Set your time zone.
time.timeZone = "America/New_York";
@ -154,10 +152,11 @@
extraGroups = [ "networkmanager" "wheel" ];
shell = pkgs.fish;
};
home-manager.users.ember = import ./home.nix;
home-manager.users.ember = import ./configs/home.nix;
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
# List packages installed in system profile. To search, run:
environment.systemPackages = with pkgs; [
@ -167,6 +166,7 @@
wl-clipboard
unzip
vlc
file
gst_all_1.gstreamer gst_all_1.gst-plugins-base gst_all_1.gst-libav gst_all_1.gst-vaapi gst_all_1.gst-plugins-bad gst_all_1.gst-plugins-good gst_all_1.gst-plugins-ugly
];
environment.gnome.excludePackages = with pkgs.gnome; [
@ -219,4 +219,9 @@
libvdpau-va-gl
];
};
}
hardware.enableAllFirmware = true;
hardware.cpu.intel.updateMicrocode = systemInformation.isIntel;
# high-resolution display
hardware.video.hidpi.enable = systemInformation.isHiDPI;
}

View File

@ -0,0 +1,12 @@
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
<nixos-hardware/framework>
];
boot.initrd.availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ];
boot.kernelModules = [ "kvm-intel" ];
}

View File

@ -0,0 +1,8 @@
{
rootPartition = "/dev/disk/by-uuid/850e0a62-fd82-4360-b4d7-258817e86380";
swapPartition = "/dev/disk/by-uuid/6144d426-6c5f-4a8a-ac16-d4d5eecbf7a0";
efiPartition = "/dev/disk/by-uuid/E5A8-38EA";
isHiDPI = true;
isIntel = true;
}