1
0
Fork 0

chore: Standardise formatting

This commit is contained in:
lwad 2023-11-30 22:37:47 +00:00
parent ef07d5fff8
commit d026b17600
18 changed files with 265 additions and 282 deletions

View File

@ -2,9 +2,7 @@
{
boot = {
extraModulePackages = [
config.boot.kernelPackages.rtl8812au
];
extraModulePackages = [ config.boot.kernelPackages.rtl8812au ];
tmp = {
useTmpfs = true;
tmpfsSize = "10%";
@ -22,22 +20,19 @@
};
home-manager.users.lukew = {
home = {
packages = with pkgs; [
easyeffects
gimp
minetest
openboard
];
packages = with pkgs; [ easyeffects gimp minetest openboard ];
stateVersion = "22.11";
};
programs = {
alacritty.settings.font.size = 10.0;
bash.shellAliases.rdiff = "rsync -nilrc --delete ryuko:Documents/ ~/Documents/ --exclude-from=/home/lukew/Documents/exclude";
bash.shellAliases.rdiff =
"rsync -nilrc --delete ryuko:Documents/ ~/Documents/ --exclude-from=/home/lukew/Documents/exclude";
};
xdg.desktopEntries = {
portal = {
categories = [ "Education" ];
exec = "${pkgs.librewolf}/bin/librewolf -P university --new-tab \"https://portal.lancaster.ac.uk/portal/my-area/modules\"";
exec = ''
${pkgs.librewolf}/bin/librewolf -P university --new-tab "https://portal.lancaster.ac.uk/portal/my-area/modules"'';
genericName = "Lancaster University Portal";
name = "Portal";
terminal = false;
@ -52,8 +47,7 @@
../components/desktop-environment.nix
];
networking = {
firewall.extraCommands = let
iptables = "${pkgs.iptables}/bin/iptables";
firewall.extraCommands = let iptables = "${pkgs.iptables}/bin/iptables";
in ''
${iptables} --insert INPUT --match iprange --src-range 192.168.178.2-192.168.178.255 --jump REJECT
${iptables} --new-chain rdp || echo ""
@ -64,7 +58,8 @@
hostName = "akame";
};
programs = {
bash.shellAliases.keyboard-leds = "${pkgs.doas}/bin/doas ${pkgs.g810-led}/bin/g810-led -a FF0000";
bash.shellAliases.keyboard-leds =
"${pkgs.doas}/bin/doas ${pkgs.g810-led}/bin/g810-led -a FF0000";
steam.enable = true;
};
services = {
@ -115,5 +110,6 @@
];
};
};
system.stateVersion = "22.11"; # Do not change this value, even in the event of an upgrade
system.stateVersion =
"22.11"; # Do not change this value, even in the event of an upgrade
}

View File

@ -4,24 +4,23 @@
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "sd_mod" ];
boot.initrd.availableKernelModules =
[ "xhci_pci" "ahci" "nvme" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/b3268bba-efd6-4a3e-9813-6c327b169e04";
fsType = "btrfs";
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/b3268bba-efd6-4a3e-9813-6c327b169e04";
fsType = "btrfs";
};
fileSystems."/boot/efi" =
{ device = "/dev/disk/by-uuid/359E-F68B";
fsType = "vfat";
};
fileSystems."/boot/efi" = {
device = "/dev/disk/by-uuid/359E-F68B";
fsType = "vfat";
};
swapDevices = [ ];
@ -36,5 +35,6 @@
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@ -67,17 +67,19 @@
virtualisation = {
diskImage = "$HOME/lab-nixos.qcow2";
diskSize = (64 * 1024);
fileSystems. "/home/lukew/Documents" = {
fileSystems."/home/lukew/Documents" = {
fsType = "9p";
device = "h-drive";
options = [ "trans=virtio" "version=9p2000.L" "access=user" ];
};
qemu.options = [
"-vga virtio"
"-smp \"$(nproc)\""
"-m \"$(($(getconf _PHYS_PAGES) * $(getconf PAGE_SIZE) / (1024 ** 2) * 3 / 4))\""
''-smp "$(nproc)"''
''
-m "$(($(getconf _PHYS_PAGES) * $(getconf PAGE_SIZE) / (1024 ** 2) * 3 / 4))"''
"-full-screen"
"-virtfs local,path=\"$HOME/h-drive\",security_model=mapped-file,mount_tag=h-drive"
''
-virtfs local,path="$HOME/h-drive",security_model=mapped-file,mount_tag=h-drive''
"-display gtk,grab-on-hover=yes,full-screen=yes"
];
resolution = {

View File

@ -100,13 +100,16 @@ in {
"browser.contentblocking.category" = "strict";
"browser.newtab.preload" = false;
"browser.newtabpage.enabled" = false;
"browser.newtabpage.activity-stream.feeds.discoverystreamfeed" = false;
"browser.newtabpage.activity-stream.section.highlights.includePocket" = false;
"browser.newtabpage.activity-stream.feeds.discoverystreamfeed" =
false;
"browser.newtabpage.activity-stream.section.highlights.includePocket" =
false;
"browser.places.speculativeConnect.enabled" = false;
"browser.region.network.url" = "";
"browser.region.update.enabled" = false;
"browser.safebrowsing.allowOverride" = false;
"browser.safebrowsing.downloads.remote.block_potentially_unwanted" = false;
"browser.safebrowsing.downloads.remote.block_potentially_unwanted" =
false;
"browser.safebrowsing.downloads.remote.block_uncommon" = false;
"browser.safebrowsing.downloads.remote.enabled" = false;
"browser.safebrowsing.downloads.remote.url" = "";
@ -325,13 +328,16 @@ in {
"browser.contentblocking.category" = "strict";
"browser.newtab.preload" = false;
"browser.newtabpage.enabled" = false;
"browser.newtabpage.activity-stream.feeds.discoverystreamfeed" = false;
"browser.newtabpage.activity-stream.section.highlights.includePocket" = false;
"browser.newtabpage.activity-stream.feeds.discoverystreamfeed" =
false;
"browser.newtabpage.activity-stream.section.highlights.includePocket" =
false;
"browser.places.speculativeConnect.enabled" = false;
"browser.region.network.url" = "";
"browser.region.update.enabled" = false;
"browser.safebrowsing.allowOverride" = false;
"browser.safebrowsing.downloads.remote.block_potentially_unwanted" = false;
"browser.safebrowsing.downloads.remote.block_potentially_unwanted" =
false;
"browser.safebrowsing.downloads.remote.block_uncommon" = false;
"browser.safebrowsing.downloads.remote.enabled" = false;
"browser.safebrowsing.downloads.remote.url" = "";
@ -409,9 +415,9 @@ in {
icon_position = "left";
min_icon_size = 0;
max_icon_size = 32;
icon_path = let
base_path = "${pkgs.breeze-icons}/share/icons/breeze-dark";
in "${base_path}/status/16/:${base_path}/devices/16";
icon_path =
let base_path = "${pkgs.breeze-icons}/share/icons/breeze-dark";
in "${base_path}/status/16/:${base_path}/devices/16";
sticky_history = "yes";
history_length = 20;
dmenu = "${pkgs.rofi}/bin/rofi -dmenu -p dunst:";
@ -427,9 +433,7 @@ in {
mouse_middle_click = "close_all";
mouse_right_click = "do_action";
};
experimental = {
per_monitor_dpi = "false";
};
experimental = { per_monitor_dpi = "false"; };
urgency_low = {
background = colors.near_black;
foreground = colors.text;
@ -459,7 +463,8 @@ in {
xdg = {
desktopEntries.chromium-browser = {
name = "Chromium";
exec = "${pkgs.ungoogled-chromium}/bin/chromium -no-default-browser-check %U";
exec =
"${pkgs.ungoogled-chromium}/bin/chromium -no-default-browser-check %U";
};
configFile."cava/config".text = ''
[general]

View File

@ -1,17 +1,10 @@
{ ... }:
{
{ ... }: {
fileSystems = {
"/".options = [
"noatime"
"nodiratime"
"compress=zstd"
];
"/boot/efi".options = [
"noatime"
"nodiratime"
];
"/".options = [ "noatime" "nodiratime" "compress=zstd" ];
"/boot/efi".options = [ "noatime" "nodiratime" ];
"/mnt/external" = {
device = "/dev/disk/by-id/usb-Kingston_DT_microDuo_001A4D5D52A8BEB11991A332-0:0-part1";
device =
"/dev/disk/by-id/usb-Kingston_DT_microDuo_001A4D5D52A8BEB11991A332-0:0-part1";
fsType = "btrfs";
options = [
"noatime"

View File

@ -18,22 +18,29 @@
xdotool = "${pkgs.xdotool}/bin/xdotool";
};
scripts = with programs; rec {
change_volume = command: step: boost: "exec --no-startup-id ${pamixer} ${if boost then "--allow-boost" else ""} -${command} ${if (command == "t") then "" else toString step} && (pkill -RTMIN+10 i3blocks & ${show_volume_notification} ${command})";
show_volume_notification = pkgs.writeScript "show_volume_notification.sh" ''
volume="$(${pamixer} --get-volume)"
change_volume = command: step: boost:
"exec --no-startup-id ${pamixer} ${
if boost then "--allow-boost" else ""
} -${command} ${
if (command == "t") then "" else toString step
} && (pkill -RTMIN+10 i3blocks & ${show_volume_notification} ${command})";
show_volume_notification =
pkgs.writeScript "show_volume_notification.sh" ''
volume="$(${pamixer} --get-volume)"
if [[ $(${pamixer} --get-mute) == "true" ]]; then
icon="audio-volume-muted"
elif [[ "$1" == "down" ]]; then
icon="audio-volume-medium"
else
icon="audio-volume-high"
fi
if [[ $(${pamixer} --get-mute) == "true" ]]; then
icon="audio-volume-muted"
elif [[ "$1" == "down" ]]; then
icon="audio-volume-medium"
else
icon="audio-volume-high"
fi
${pkgs.dunst}/bin/dunstify -a "changeVolume" -u low -i "$icon" -h string:x-dunst-stack-tag:changeVolume -h int:value:"$volume" "$volume%" -t 750
'';
${pkgs.dunst}/bin/dunstify -a "changeVolume" -u low -i "$icon" -h string:x-dunst-stack-tag:changeVolume -h int:value:"$volume" "$volume%" -t 750
'';
};
in with programs; with scripts; ''
in with programs;
with scripts; ''
#### GENERAL CONFIGURATION ####
# Specify floating modifier key
@ -316,8 +323,7 @@
bindsym $mod+e layout toggle split
bindsym $mod+v split v
'';
aesthetic = let
colors = (import ../theme.nix).colors;
aesthetic = let colors = (import ../theme.nix).colors;
in ''
#### GENERAL CONFIGURATION ####
@ -412,10 +418,7 @@
displayManager.defaultSession = "none+i3";
windowManager.i3 = {
enable = true;
extraPackages = with pkgs; [
alsa-utils
pulseaudioFull
];
extraPackages = with pkgs; [ alsa-utils pulseaudioFull ];
package = pkgs.i3;
};
};

View File

@ -17,13 +17,14 @@ let
done
'';
};
in with programs; with scripts; ''
in with programs;
with scripts; ''
#### VARIABLES ####
# Mode prompts
set $display_mode_prompt "Display: 1='Left Only' 2='Right Only' 3='Both'"
set $audio_mode_prompt "Audio Devices: 1=Headphones 2=Speakers 3=Wireless (d=Disconnect)"
# Audio mode commands
set $headphones_command ${mute_audio} && ${pactl} set-default-sink $(${pactl} list sinks | grep -e "Monitor Source: " | sed "s/\tMonitor Source: //" | grep -e "Focusrite_Scarlett_2i2") && pkill -RTMIN+10 i3blocks && ${pamixer} --set-volume 0
set $speakers_command ${mute_audio} && ${pactl} set-default-sink $(${pactl} list sinks | grep -e "Monitor Source: " | sed "s/\tMonitor Source: //" | grep -e "C-Media_Electronics_Inc._USB_Audio_Device") && pkill -RTMIN+10 i3blocks && ${pamixer} --set-volume 0
@ -68,47 +69,47 @@ in with programs; with scripts; ''
fi
''
}
#### KEYBINDINGS ####
# Mode controls
bindsym $mod+Shift+a mode $audio_mode_prompt
bindsym $mod+o mode $display_mode_prompt
#### AUTOSTART ENTRIES ####
exec --no-startup-id ${pkgs.easyeffects}/bin/easyeffects --gapplication-service
exec_always --no-startup-id (${xinput} list | grep -e "UGTABLET 10 inch PenTablet" && ${xinput} map-to-output "UGTABLET 10 inch PenTablet Mouse" "DVI-D-0" && ${xinput} map-to-output "UGTABLET 10 inch PenTablet Pen Pen (0)" "DVI-D-0")
exec_always --no-startup-id ${pkgs.openrgb}/bin/openrgb --profile Default
exec --no-startup-id ${pkgs.signal-desktop}/bin/signal-desktop --start-in-tray
#### MODES ####
# Display mode
mode $display_mode_prompt {
bindsym 1 exec --no-startup-id ${xrandr} --output HDMI-0 --primary --mode 2560x1080 --pos 0x0 --output DVI-D-0 --off
bindsym 2 exec --no-startup-id ${xrandr} --output DVI-D-0 --primary --mode 1920x1080 --pos 0x0 --output HDMI-0 --off
bindsym 3 exec --no-startup-id ${xrandr} --output HDMI-0 --primary --mode 2560x1080 --pos 0x0 --output DVI-D-0 --mode 1920x1080 --pos 2560x0
bindsym Escape mode "default"
}
# Audio mode
mode $audio_mode_prompt {
bindsym 1 exec --no-startup-id $headphones_command, mode "default"
bindsym 2 exec --no-startup-id $speakers_command, mode "default"
bindsym 3 exec --no-startup-id $wireless_command, mode "default"
bindsym d exec --no-startup-id ${bluetoothctl} disconnect, exec --no-startup-id $speakers_command, mode "default"
bindsym Escape mode "default"
}
#### WORKSPACE DEFINITIONS ####
workspace $ws1 output HDMI-0 DVI-D-0
workspace $ws2 output HDMI-0 DVI-D-0
workspace $ws3 output HDMI-0 DVI-D-0

View File

@ -1,4 +1,3 @@
{ ... }:
''
''
""

View File

@ -6,23 +6,23 @@ let
};
in with programs; ''
#### VARIABLES ####
# Mode prompts
set $display_mode_prompt "Display: 1='Internal Only' 2='External Only' 3='External Only (alt)' 4='Both' 5='Both (alt)'"
#### KEYBINDINGS ####
# Bind display brightness controls
bindsym XF86MonBrightnessUp exec --no-startup-id ${brightnessctl} -e set +1%
bindsym XF86MonBrightnessDown exec --no-startup-id ${brightnessctl} -e set 1%-
# Mode controls
bindsym $mod+o mode $display_mode_prompt
#### MODES ####
# Display mode
mode $display_mode_prompt {
bindsym 1 exec --no-startup-id ${xrandr} --output eDP-1 --primary --mode 1920x1080 --pos 0x0 --output HDMI-1-1 --off
@ -30,13 +30,13 @@ in with programs; ''
bindsym 3 exec --no-startup-id ${xrandr} --output HDMI-1-2 --primary --mode `${xrandr} | grep -A1 "HDMI-1-2" | tail -n 1 | sed -e "s/^ *//" -e "s/ .*//"` --pos 0x0 --output eDP-1 --off
bindsym 4 exec --no-startup-id ${xrandr} --output eDP-1 --mode 1920x1080 --pos 320x1080 --output HDMI-1-1 --primary --mode `${xrandr} | grep -A1 "HDMI-1-1" | tail -n 1 | sed -e "s/^ *//" -e "s/ .*//"` --pos 0x0
bindsym 4 exec --no-startup-id ${xrandr} --output eDP-1 --mode 1920x1080 --pos 320x1080 --output HDMI-1-2 --primary --mode `${xrandr} | grep -A1 "HDMI-1-2" | tail -n 1 | sed -e "s/^ *//" -e "s/ .*//"` --pos 0x0
bindsym Escape mode "default"
}
#### WORKSPACE DEFINITIONS ####
workspace $ws1 output HDMI-1-1 HDMI-1-2 eDP-1
workspace $ws2 output HDMI-1-1 HDMI-1-2 eDP-1
workspace $ws3 output HDMI-1-1 HDMI-1-2 eDP-1

View File

@ -6,32 +6,32 @@ let
};
in with programs; ''
#### VARIABLES ####
# Mode prompts
set $display_mode_prompt "Display: 1='Internal Only' 2='External Only' 3='Both'"
#### KEYBINDINGS ####
# Bind display brightness controls
bindsym XF86MonBrightnessUp exec --no-startup-id ${brightnessctl} -e set +1%
bindsym XF86MonBrightnessDown exec --no-startup-id ${brightnessctl} -e set 1%-
#### MODES ####
# Display mode
mode $display_mode_prompt {
bindsym 1 exec --no-startup-id ${xrandr} --output LVDS-1 --primary --mode 1920x1080 --pos 0x0 --output HDMI-1 --off
bindsym 2 exec --no-startup-id ${xrandr} --output HDMI-1 --primary --mode `${xrandr} | grep -A1 "HDMI-1" | tail -n 1 | sed -e "s/^ *//" -e "s/ .*//"` --pos 0x0 --output LVDS-1 --off
bindsym 3 exec --no-startup-id ${xrandr} --output LVDS-1 --mode 1920x1080 --pos 320x1080 --output HDMI-1 --primary --mode `${xrandr} | grep -A1 "HDMI-1-1" | tail -n 1 | sed -e "s/^ *//" -e "s/ .*//"` --pos 0x0
bindsym Escape mode "default"
}
#### WORKSPACE DEFINITIONS ####
workspace $ws1 output LVDS-1
workspace $ws2 output LVDS-1
workspace $ws3 output LVDS-1

View File

@ -6,12 +6,10 @@
extraConfig = ''
xkb-layout=gb
'';
fonts = [
{
name = "FiraCode Nerd Font";
package = (pkgs.nerdfonts.override { fonts = [ "FiraCode" ]; });
}
];
fonts = [{
name = "FiraCode Nerd Font";
package = (pkgs.nerdfonts.override { fonts = [ "FiraCode" ]; });
}];
hwRender = true;
};
}

View File

@ -28,7 +28,7 @@
vim.opt.scrolloff = 2
vim.opt.wrap = false
vim.opt.pumheight = 10 -- Popup menu height.
vim.opt.showmode = false -- Mode indicator.
@ -309,8 +309,8 @@
luasnip
nvim-cmp
nvim-lspconfig
(nvim-treesitter.withPlugins (
plugins: with plugins; [
(nvim-treesitter.withPlugins (plugins:
with plugins; [
bash
c
css
@ -326,8 +326,7 @@
r
rust
typescript
]
))
]))
telescope-nvim
vim-prettier
vim-repeat

View File

@ -17,19 +17,19 @@
console.keyMap = "uk";
documentation.nixos.enable = false;
environment = {
defaultPackages = lib.mkForce [];
defaultPackages = lib.mkForce [ ];
sessionVariables = { # home decluttering
ANDROID_HOME = "\${XDG_DATA_HOME}/android";
ANDROID_USER_HOME = "\${XDG_DATA_HOME}/android";
CUDA_CACHE_PATH = "\${XDG_CACHE_HOME}/nv";
GNUPGHOME = "\${XDG_DATA_HOME}/gnupg";
GRADLE_USER_HOME= "\${XDG_DATA_HOME}/gradle";
GRADLE_USER_HOME = "\${XDG_DATA_HOME}/gradle";
GTK2_RC_FILES = "\${XDG_CONFIG_HOME}/gtk-3.0/gtkrc";
HISTFILE = "\${XDG_STATE_HOME}/bash/history";
IONIC_CONFIG_DIRECTORY = "\${XDG_CONFIG_HOME}/ionic";
_JAVA_OPTIONS = "-Djava.util.prefs.userRoot=\${XDG_CONFIG_HOME}/java";
MYSQL_HISTFILE = "\${XDG_DATA_HOME}/mysql_history";
NODE_REPL_HISTORY="\${XDG_DATA_HOME}/node_repl_history";
NODE_REPL_HISTORY = "\${XDG_DATA_HOME}/node_repl_history";
PSQL_HISTORY = "\${XDG_DATA_HOME}/psql_history";
XCOMPOSECACHE = "\${XDG_CACHE_HOME}/X11/xcompose";
XDG_CACHE_HOME = "$HOME/.cache";
@ -37,57 +37,58 @@
XDG_DATA_HOME = "$HOME/.local/share";
XDG_STATE_HOME = "$HOME/.local/state";
};
systemPackages = with pkgs; [ # development
cabal-install
cargo
clang
clangStdenv
cloak
elmPackages.elm
erlang
gcc
gdb
ghc
gnumake
libclang
nodejs
nodePackages.ts-node
inputs.nixpkgs-unstable.legacyPackages.x86_64-linux.openjdk
plantuml
pmd
python310
rebar3
rustc
shellcheck
strace
typescript
valgrind
] ++ [ # utilities
entr
eza
fd
fzf
jq
mdcat
most
rename # rename with pcre
ripgrep
rsync
unzip
watchexec
wget
] ++ [ # applications
inputs.project-manager.packages.x86_64-linux.default
pulsemixer
R
] ++ [ # other
cifs-utils
ffmpeg
libcxx
libinput
ntfs3g
openal
];
systemPackages = with pkgs;
[ # development
cabal-install
cargo
clang
clangStdenv
cloak
elmPackages.elm
erlang
gcc
gdb
ghc
gnumake
libclang
nodejs
nodePackages.ts-node
inputs.nixpkgs-unstable.legacyPackages.x86_64-linux.openjdk
plantuml
pmd
python310
rebar3
rustc
shellcheck
strace
typescript
valgrind
] ++ [ # utilities
entr
eza
fd
fzf
jq
mdcat
most
rename # rename with pcre
ripgrep
rsync
unzip
watchexec
wget
] ++ [ # applications
inputs.project-manager.packages.x86_64-linux.default
pulsemixer
R
] ++ [ # other
cifs-utils
ffmpeg
libcxx
libinput
ntfs3g
openal
];
variables = { # git identities
DISROOT_EMAIL = "toolbox.0-kindred@icloud.com";
DISROOT_NAME = "lwad";
@ -132,8 +133,10 @@
enable = true;
shellAliases = {
calculator = "(cd && R --save --quiet)";
drivediff = "rsync -nilrc --delete /mnt/external/Documents/ /home/lukew/Documents/ | sed -e \"/\.undo/d\" -e \"/\.git/d\"";
otp = "${pkgs.cloak}/bin/cloak view lancs | ${pkgs.coreutils}/bin/tr -d \"\\n\" | ${pkgs.xclip}/bin/xclip -i -selection clipboard";
drivediff = ''
rsync -nilrc --delete /mnt/external/Documents/ /home/lukew/Documents/ | sed -e "/.undo/d" -e "/.git/d"'';
otp = ''
${pkgs.cloak}/bin/cloak view lancs | ${pkgs.coreutils}/bin/tr -d "\n" | ${pkgs.xclip}/bin/xclip -i -selection clipboard'';
p = "project-manager";
xclip = "xclip -selection clipboard";
};
@ -152,7 +155,8 @@
};
xdg.desktopEntries.disroot = {
categories = [ "Development" ];
exec = "${pkgs.librewolf}/bin/librewolf --new-tab \"https://git.disroot.org/lwad\"";
exec = ''
${pkgs.librewolf}/bin/librewolf --new-tab "https://git.disroot.org/lwad"'';
genericName = "disroot";
name = "disroot";
terminal = false;
@ -173,29 +177,22 @@
LC_TELEPHONE = "en_GB.UTF-8";
};
};
imports = [
inputs.home-manager.nixosModules.default
./components/neovim.nix
];
imports =
[ inputs.home-manager.nixosModules.default ./components/neovim.nix ];
nix = {
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 7d";
};
nixPath = [ "nixpkgs=${inputs.nixpkgs}" "home-manager=${inputs.home-manager}" ];
nixPath =
[ "nixpkgs=${inputs.nixpkgs}" "home-manager=${inputs.home-manager}" ];
registry.nixpkgs.flake = inputs.nixpkgs;
settings = {
allowed-users = [
"lukew"
"root"
];
allowed-users = [ "lukew" "root" ];
auto-optimise-store = true;
experimental-features = [ "nix-command" "flakes" ];
trusted-users = [
"lukew"
"root"
];
trusted-users = [ "lukew" "root" ];
};
};
nixpkgs.config.allowUnfree = true;
@ -213,19 +210,21 @@
dconf.enable = true;
bash.shellAliases = {
cp = "cp -i";
base = "cd \"$(git rev-parse --show-toplevel)\"";
base = ''cd "$(git rev-parse --show-toplevel)"'';
grep = "grep --color=auto";
here = "pwd >/tmp/herethere";
eza = "eza --long --icons --git";
ft = "watchexec --clear=clear --no-default-ignore eza --long --git --tree --icons";
ft =
"watchexec --clear=clear --no-default-ignore eza --long --git --tree --icons";
n = "nvim";
nixos-status = "journalctl -xefu nixos-upgrade.service";
nixos-upgrade = "sudo systemctl start nixos-upgrade.service";
nixos-upgrade-local = "sudo nixos-rebuild switch --no-write-lock-file --recreate-lock-file --flake /etc/nixos/#";
nixos-upgrade-local =
"sudo nixos-rebuild switch --no-write-lock-file --recreate-lock-file --flake /etc/nixos/#";
open = "xdg-open";
recent = "\\eza --sort=modified --reverse | head -n 1";
there = "cd \"$(head -n 1 /tmp/herethere)\"";
wget = "wget --hsts-file=\"$XDG_DATA_HOME/wget-hsts\"";
there = ''cd "$(head -n 1 /tmp/herethere)"'';
wget = ''wget --hsts-file="$XDG_DATA_HOME/wget-hsts"'';
};
git = {
config = {
@ -240,8 +239,8 @@
settings = {
add_newline = false;
character = {
success_symbol = "[\\\$](white)";
error_symbol = "[\\\$](#BE2A49)";
success_symbol = "[\\$](white)";
error_symbol = "[\\$](#BE2A49)";
};
directory = {
home_symbol = "home";
@ -251,14 +250,17 @@
style = "#777777";
truncation_length = 5;
};
format = "$username$directory$git_branch$git_status$nix_shell\n$character";
format = ''
$username$directory$git_branch$git_status$nix_shell
$character'';
git_branch = {
format = "[\\($branch\\)]($style)";
ignore_branches = [ "master" "main" ];
style = "purple";
};
git_status = {
format = "([$conflicted$deleted$renamed$modified$staged$untracked$ahead_behind]($style))";
format =
"([$conflicted$deleted$renamed$modified$staged$untracked$ahead_behind]($style))";
style = "purple";
};
line_break.disabled = true;
@ -273,7 +275,8 @@
tmux = {
enable = true;
extraConfig = let
project-manager = "${inputs.project-manager.packages.x86_64-linux.default}/bin/project-manager";
project-manager =
"${inputs.project-manager.packages.x86_64-linux.default}/bin/project-manager";
in ''
set -sg escape-time 0
set -g status-position top
@ -308,11 +311,7 @@
autoUpgrade = {
dates = "00:00";
enable = true;
flags = [
"--recreate-lock-file"
"--refresh"
"--no-write-lock-file"
];
flags = [ "--recreate-lock-file" "--refresh" "--no-write-lock-file" ];
flake = "git+ssh://disroot/lwad/nixos.git";
persistent = true;
};
@ -321,7 +320,8 @@
services = {
NetworkManager-wait-online.enable = lib.mkForce false;
systemd-networkd-wait-online.enable = lib.mkForce false;
nixos-upgrade.preStart = "while ! ${pkgs.unixtools.ping}/bin/ping -c 1 -W 1 cache.nixos.org; do ${pkgs.coreutils}/bin/sleep 1; done";
nixos-upgrade.preStart =
"while ! ${pkgs.unixtools.ping}/bin/ping -c 1 -W 1 cache.nixos.org; do ${pkgs.coreutils}/bin/sleep 1; done";
};
};
time.timeZone = "Europe/London";

View File

@ -13,34 +13,22 @@
akame = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./configuration.nix
./akame
];
modules = [ ./configuration.nix ./akame ];
};
asuna = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./configuration.nix
./asuna
];
modules = [ ./configuration.nix ./asuna ];
};
ryuko = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./configuration.nix
./ryuko
];
modules = [ ./configuration.nix ./ryuko ];
};
shinobu = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
./configuration.nix
./shinobu
];
modules = [ ./configuration.nix ./shinobu ];
};
};
};

View File

@ -1,10 +1,7 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
brightnessctl
freerdp
];
environment.systemPackages = with pkgs; [ brightnessctl freerdp ];
fileSystems."/mnt/h" = {
device = "//homes.lancs.ac.uk/18/waddingl";
fsType = "cifs";
@ -27,7 +24,8 @@
programs = {
alacritty.settings.font.size = 7.0;
bash.shellAliases = {
rdiff = "rsync -nilrc --delete akame:Documents/ ~/Documents/ --exclude-from=/home/lukew/Documents/exclude";
rdiff =
"rsync -nilrc --delete akame:Documents/ ~/Documents/ --exclude-from=/home/lukew/Documents/exclude";
rdp = "xfreerdp /u:lukew /v:akame /f";
};
};
@ -56,8 +54,8 @@
DISK_DEVICES = "nvme0n1";
DISK_APM_LEVEL_ON_AC = "254 254";
DISK_APM_LEVEL_ON_BAT = "254 254";
PLATFORM_PROFILE_ON_AC= "performace";
PLATFORM_PROFILE_ON_BAT= "low-power";
PLATFORM_PROFILE_ON_AC = "performace";
PLATFORM_PROFILE_ON_BAT = "low-power";
CPU_SCALING_GOVERNOR_ON_AC = "powersave";
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
CPU_MIN_PERF_ON_AC = 0;
@ -81,17 +79,15 @@
palmDetect = true;
twoFingerScroll = true;
};
xrandrHeads = [
{
output = "eDP-0";
primary = true;
monitorConfig = ''
Option "Position" "0 0"
Option "PreferredMode" "1920x1080"
Option "DPMS" "true"
'';
}
];
xrandrHeads = [{
output = "eDP-0";
primary = true;
monitorConfig = ''
Option "Position" "0 0"
Option "PreferredMode" "1920x1080"
Option "DPMS" "true"
'';
}];
};
};
system.stateVersion = "22.11";

View File

@ -4,24 +4,23 @@
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.availableKernelModules =
[ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/202be2c6-c5ce-491b-a07a-61e9232908e6";
fsType = "btrfs";
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/202be2c6-c5ce-491b-a07a-61e9232908e6";
fsType = "btrfs";
};
fileSystems."/boot/efi" =
{ device = "/dev/disk/by-uuid/508E-4BCD";
fsType = "vfat";
};
fileSystems."/boot/efi" = {
device = "/dev/disk/by-uuid/508E-4BCD";
fsType = "vfat";
};
swapDevices = [ ];
@ -35,5 +34,6 @@
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@ -1,9 +1,7 @@
{ pkgs, ... }:
{
environment.systemPackages = with pkgs; [
brightnessctl
];
environment.systemPackages = with pkgs; [ brightnessctl ];
hardware.bluetooth.enable = false;
home-manager.users.lukew = {
home.stateVersion = "22.11";

View File

@ -4,28 +4,32 @@
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" "sr_mod" "rtsx_pci_sdmmc" ];
boot.initrd.availableKernelModules = [
"xhci_pci"
"ehci_pci"
"ahci"
"usb_storage"
"sd_mod"
"sr_mod"
"rtsx_pci_sdmmc"
];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/d81ae17e-f33b-461c-a657-424fde5254b2";
fsType = "btrfs";
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/d81ae17e-f33b-461c-a657-424fde5254b2";
fsType = "btrfs";
};
fileSystems."/boot/efi" =
{ device = "/dev/disk/by-uuid/9D37-F38D";
fsType = "vfat";
};
fileSystems."/boot/efi" = {
device = "/dev/disk/by-uuid/9D37-F38D";
fsType = "vfat";
};
swapDevices =
[ { device = "/swap/swapfile"; }
];
swapDevices = [{ device = "/swap/swapfile"; }];
# 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
@ -35,5 +39,6 @@
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
}