Format using nixfmt

This commit is contained in:
Oliver Davies 2024-03-18 20:33:28 +00:00
parent a33c74c580
commit b1421c97e1
30 changed files with 184 additions and 265 deletions

View file

@ -10,42 +10,31 @@
# opdavies-nvim.url = "path:/home/opdavies/Code/github.com/opdavies/opdavies.nvim";
};
outputs = inputs @ {
flake-parts,
self,
...
}: let
username = "opdavies";
outputs = inputs@{ flake-parts, self, ... }:
let
username = "opdavies";
mkNixos = import ./lib/nixos {inherit inputs self username;};
mkWsl = import ./lib/wsl2 {inherit inputs self username;};
in
flake-parts.lib.mkFlake {inherit inputs;} {
systems = ["x86_64-linux"];
mkNixos = import ./lib/nixos { inherit inputs self username; };
mkWsl = import ./lib/wsl2 { inherit inputs self username; };
in flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" ];
perSystem = {
pkgs,
self',
...
}: {
packages.default = pkgs.mkShell {
nativeBuildInputs = [pkgs.just];
};
perSystem = { pkgs, self', ... }: {
packages.default =
pkgs.mkShell { nativeBuildInputs = [ pkgs.nixfmt pkgs.just ]; };
formatter = pkgs.alejandra;
formatter = pkgs.nixfmt;
};
flake = {
lib = import ./lib {inherit inputs;};
lib = import ./lib { inherit inputs; };
nixosConfigurations = {
apollo = mkNixos {desktop = true;};
nixedo = mkNixos {desktop = true;};
apollo = mkNixos { desktop = true; };
nixedo = mkNixos { desktop = true; };
};
homeConfigurations = {
wsl2 = mkWsl;
};
homeConfigurations = { wsl2 = mkWsl; };
};
};
}

View file

@ -1,8 +1,6 @@
{
inputs,
desktop ? false,
self,
}: {pkgs, ...}: let
{ inputs, desktop ? false, self, }:
{ pkgs, ... }:
let
configure-gtk = pkgs.writeTextFile {
name = "configure-gtk";
destination = "/bin/configure-gtk";
@ -17,7 +15,7 @@
'';
};
theme = import "${self}/lib/theme" {inherit pkgs;};
theme = import "${self}/lib/theme" { inherit pkgs; };
username = "opdavies";
in {
@ -76,7 +74,7 @@ in {
windowManager.i3 = {
enable = true;
extraPackages = with pkgs; [i3status i3lock i3blocks];
extraPackages = with pkgs; [ i3status i3lock i3blocks ];
};
};
@ -111,8 +109,8 @@ in {
users.users.${username} = {
isNormalUser = true;
description = "Oliver Davies";
extraGroups = ["docker" "networkmanager" "wheel"];
packages = with pkgs; [];
extraGroups = [ "docker" "networkmanager" "wheel" ];
packages = with pkgs; [ ];
};
security.sudo.wheelNeedsPassword = false;
@ -128,8 +126,7 @@ in {
xfce.thunar
xfce.thunar-volman
xfce.tumbler
]
++ pkgs.lib.optionals desktop [
] ++ pkgs.lib.optionals desktop [
acpi
arandr
dunst
@ -190,9 +187,7 @@ in {
fonts = {
fontconfig = {
enable = true;
defaultFonts = {
monospace = ["JetBrainsMono Nerd Font Mono"];
};
defaultFonts = { monospace = [ "JetBrainsMono Nerd Font Mono" ]; };
};
packages = with pkgs;
@ -207,10 +202,7 @@ in {
"JetBrainsMono"
];
})
]
++ [
theme.fonts.monospace.package
];
] ++ [ theme.fonts.monospace.package ];
};
zramSwap.enable = true;
@ -226,7 +218,7 @@ in {
settings = {
auto-optimise-store = true;
experimental-features = ["nix-command" "flakes"];
experimental-features = [ "nix-command" "flakes" ];
warn-dirty = false;
};
};
@ -241,7 +233,8 @@ in {
'';
in {
enable = true;
plugins = pkgs.lib.mkForce [pkgs.interception-tools-plugins.dual-function-keys];
plugins =
pkgs.lib.mkForce [ pkgs.interception-tools-plugins.dual-function-keys ];
udevmonConfig = ''
- JOB: "${pkgs.interception-tools}/bin/intercept -g $DEVNODE | ${pkgs.interception-tools-plugins.dual-function-keys}/bin/dual-function-keys -c ${dfkConfig} | ${pkgs.interception-tools}/bin/uinput -d $DEVNODE"
DEVICE:
@ -274,7 +267,7 @@ in {
programs.firefox = {
enable = true;
languagePacks = ["en-GB"];
languagePacks = [ "en-GB" ];
preferences = {
"intl.accept_languages" = "en-GB, en";
"intl.regional_prefs.use_os_locales" = true;
@ -286,9 +279,8 @@ in {
services.cron = {
enable = true;
systemCronJobs = [
"* * * * * opdavies /home/opdavies/.config/bin/notify-battery.sh"
];
systemCronJobs =
[ "* * * * * opdavies /home/opdavies/.config/bin/notify-battery.sh" ];
};
services.auto-cpufreq.enable = true;

View file

@ -1,26 +1,21 @@
{
inputs,
self,
username,
}: {
desktop ? false,
}: let
configuration = import ./configuration.nix {inherit desktop inputs self;};
{ inputs, self, username, }:
{ desktop ? false, }:
let
configuration = import ./configuration.nix { inherit desktop inputs self; };
hardwareConfiguration = import ./hardware-configuration.nix;
in
inputs.nixpkgs.lib.nixosSystem {
modules = [
inputs.home-manager.nixosModules.home-manager
{
home-manager = {
extraSpecialArgs = {inherit inputs desktop self username;};
useGlobalPkgs = true;
useUserPackages = true;
users."${username}" = import ./home-manager;
};
}
in inputs.nixpkgs.lib.nixosSystem {
modules = [
inputs.home-manager.nixosModules.home-manager
{
home-manager = {
extraSpecialArgs = { inherit inputs desktop self username; };
useGlobalPkgs = true;
useUserPackages = true;
users."${username}" = import ./home-manager;
};
}
configuration
hardwareConfiguration
];
}
configuration
hardwareConfiguration
];
}

View file

@ -1,17 +1,12 @@
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
{ config, lib, pkgs, modulesPath, ... }: {
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules = ["xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.kernelParams = ["i8042.reset"];
boot.extraModulePackages = [];
boot.initrd.availableKernelModules =
[ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.kernelParams = [ "i8042.reset" ];
boot.extraModulePackages = [ ];
boot.kernelPackages = pkgs.linuxPackages_latest;
hardware.enableAllFirmware = true;
@ -26,7 +21,7 @@
fsType = "vfat";
};
swapDevices = [{device = "/dev/disk/by-label/swap";}];
swapDevices = [{ device = "/dev/disk/by-label/swap"; }];
# 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

View file

@ -1,44 +1,38 @@
{
config,
desktop,
inputs,
pkgs,
self,
username,
...
}: let
desktop-config = import ./desktop.nix {inherit config inputs pkgs username;};
shared-config = import "${self}/lib/shared/home-manager.nix" {inherit inputs pkgs self username;};
shared-packages = import "${self}/lib/shared/home-manager-packages.nix" {inherit inputs pkgs;};
{ config, desktop, inputs, pkgs, self, username, ... }:
let
desktop-config =
import ./desktop.nix { inherit config inputs pkgs username; };
shared-config = import "${self}/lib/shared/home-manager.nix" {
inherit inputs pkgs self username;
};
shared-packages = import "${self}/lib/shared/home-manager-packages.nix" {
inherit inputs pkgs;
};
pkgs-2311 = inputs.nixpkgs-2311.legacyPackages.${pkgs.system};
in {
imports =
if desktop
then [desktop-config shared-config]
else [shared-config];
if desktop then [ desktop-config shared-config ] else [ shared-config ];
home.packages =
shared-packages
++ pkgs.lib.optionals desktop [
pkgs.discord
pkgs.gimp
pkgs.gscan2pdf
pkgs-2311.kdenlive
pkgs.meslo-lg
pkgs.obs-studio
pkgs.okular
pkgs.pamixer
pkgs.pass
pkgs.pavucontrol
pkgs.pinentry
pkgs.slack
pkgs.via
pkgs.vlc
pkgs.xsel
pkgs.xcape
pkgs.zoom-us
];
home.packages = shared-packages ++ pkgs.lib.optionals desktop [
pkgs.discord
pkgs.gimp
pkgs.gscan2pdf
pkgs-2311.kdenlive
pkgs.meslo-lg
pkgs.obs-studio
pkgs.okular
pkgs.pamixer
pkgs.pass
pkgs.pavucontrol
pkgs.pinentry
pkgs.slack
pkgs.via
pkgs.vlc
pkgs.xsel
pkgs.xcape
pkgs.zoom-us
];
home.sessionVariables = {
EDITOR = "nvim";

View file

@ -1,9 +1,4 @@
{
config,
inputs,
pkgs,
username,
}: {
{ config, inputs, pkgs, username, }: {
imports = [
./modules/alacritty.nix
./modules/autorandr.nix

View file

@ -1,13 +1,9 @@
{
lib,
pkgs,
self,
...
}: let
{ lib, pkgs, self, ... }:
let
inherit (lib) strings;
inherit (strings) toInt;
theme = import "${self}/lib/theme" {inherit pkgs;};
theme = import "${self}/lib/theme" { inherit pkgs; };
in {
programs.alacritty = {
enable = true;
@ -30,7 +26,7 @@ in {
glyph_offset.y = 6;
};
shell = {program = "zsh";};
shell = { program = "zsh"; };
};
};
}

View file

@ -1,4 +1,4 @@
{username, ...}: {
{ username, ... }: {
services.autorandr.enable = true;
xdg.configFile."autorandr/postswitch" = {
@ -14,8 +14,10 @@
enable = true;
profiles = let
laptop = "00ffffffffffff000daef21400000000161c0104a51f117802ee95a3544c99260f505400000001010101010101010101010101010101363680a0703820402e1e240035ad10000018000000fe004e3134304843472d4751320a20000000fe00434d4e0a202020202020202020000000fe004e3134304843472d4751320a2000bb";
monitor = "00ffffffffffff004c2d1710424e58432b1f0103803f24782ac8b5ad50449e250f5054bfef80714f810081c081809500a9c0b300010108e80030f2705a80b0588a0078682100001e000000fd00324b1e873c000a202020202020000000fc004c5532385235350a2020202020000000ff0048345a524130303132380a20200183020335f04961120313041f10605f2309070783010000e305c0006b030c002000b83c2000200167d85dc401788003e20f81e3060501023a801871382d40582c450078682100001e023a80d072382d40102c458078682100001e04740030f2705a80b0588a0078682100001e565e00a0a0a029503020350078682100001a000049";
laptop =
"00ffffffffffff000daef21400000000161c0104a51f117802ee95a3544c99260f505400000001010101010101010101010101010101363680a0703820402e1e240035ad10000018000000fe004e3134304843472d4751320a20000000fe00434d4e0a202020202020202020000000fe004e3134304843472d4751320a2000bb";
monitor =
"00ffffffffffff004c2d1710424e58432b1f0103803f24782ac8b5ad50449e250f5054bfef80714f810081c081809500a9c0b300010108e80030f2705a80b0588a0078682100001e000000fd00324b1e873c000a202020202020000000fc004c5532385235350a2020202020000000ff0048345a524130303132380a20200183020335f04961120313041f10605f2309070783010000e305c0006b030c002000b83c2000200167d85dc401788003e20f81e3060501023a801871382d40582c450078682100001e023a80d072382d40102c458078682100001e04740030f2705a80b0588a0078682100001e565e00a0a0a029503020350078682100001a000049";
in {
laptop = {
config.eDP-1 = {

View file

@ -1,3 +1 @@
{
services.copyq.enable = true;
}
{ services.copyq.enable = true; }

View file

@ -2,10 +2,6 @@
services.dunst = {
enable = true;
settings = {
global = {
follow = "keyboard";
};
};
settings = { global = { follow = "keyboard"; }; };
};
}

View file

@ -1,14 +1,9 @@
let
baseUrl = "https://www.oliverdavies.uk";
let baseUrl = "https://www.oliverdavies.uk";
in {
services.espanso = {
enable = true;
configs = {
default = {
show_notifications = false;
};
};
configs = { default = { show_notifications = false; }; };
matches = {
base = {

View file

@ -1,3 +1 @@
{
programs.feh.enable = true;
}
{ programs.feh.enable = true; }

View file

@ -1,4 +1,4 @@
{username, ...}: {
{ username, ... }: {
services.flameshot = {
enable = true;

View file

@ -1,11 +1,7 @@
{
config,
inputs,
self,
username,
pkgs,
...
}: let
{ config, inputs, pkgs, self, username, ... }:
let
theme = import "${self}/lib/theme" { inherit pkgs; };
modifier = "Mod4";
in {
xsession.windowManager.i3 = {
@ -13,12 +9,9 @@ in {
config = {
assigns = {
"7" = [{class = "vlc";}];
"8" = [{class = "0ad";}];
"9" = [
{class = "Slack";}
{class = "discord";}
];
"7" = [{ class = "vlc"; }];
"8" = [{ class = "0ad"; }];
"9" = [ { class = "Slack"; } { class = "discord"; } ];
};
defaultWorkspace = "workspace number 1";
@ -52,10 +45,13 @@ in {
"XF86AudioRaiseVolume" = "exec pamixer -ui 2 && pamixer --get-volume";
"XF86AudioLowerVolume" = "exec pamixer -ud 2 && pamixer --get-volume";
"XF86AudioMute" = "exec pamixer --toggle-mute && ( [ \"$(pamixer --get-mute)\" = \"true\" ] && echo 0";
"XF86AudioMute" = ''
exec pamixer --toggle-mute && ( [ "$(pamixer --get-mute)" = "true" ] && echo 0'';
"XF86MonBrightnessDown" = "exec brightnessctl set 5%- | sed -En 's/.*\(([0-9]+)%\).*/\1/p'";
"XF86MonBrightnessUp" = "exec brightnessctl set +5% | sed -En 's/.*\(([0-9]+)%\).*/\1/p'";
"XF86MonBrightnessDown" =
"exec brightnessctl set 5%- | sed -En 's/.*(([0-9]+)%).*/1/p'";
"XF86MonBrightnessUp" =
"exec brightnessctl set +5% | sed -En 's/.*(([0-9]+)%).*/1/p'";
};
terminal = "alacritty";
@ -80,14 +76,12 @@ in {
'';
config = {
bars = [
{
position = "bottom";
statusCommand = "${pkgs.i3status}/bin/i3status";
}
];
bars = [{
position = "bottom";
statusCommand = "${pkgs.i3status}/bin/i3status";
}];
fonts.names = ["GeistMono"];
fonts.names = [ "${theme.fonts.monospace.name}" ];
gaps = {
smartBorders = "on";

View file

@ -1,3 +1 @@
{
programs.rofi.enable = true;
}
{ programs.rofi.enable = true; }

View file

@ -1,8 +1,4 @@
{
inputs,
pkgs,
...
}:
{ inputs, pkgs, ... }:
with pkgs; [
awscli2
bitwarden-cli

View file

@ -1,9 +1,4 @@
{
inputs,
pkgs,
username,
self,
}: {
{ inputs, pkgs, username, self, }: {
home.username = "${username}";
home.homeDirectory = "/home/${username}";
@ -12,7 +7,7 @@
programs.home-manager.enable = true;
imports = [
(import ./modules/neovim.nix {inherit inputs;})
(import ./modules/neovim.nix { inherit inputs; })
./modules/bat.nix
./modules/bin.nix
./modules/direnv.nix

View file

@ -1,3 +1 @@
{
programs.bat.enable = true;
}
{ programs.bat.enable = true; }

View file

@ -1,5 +1,5 @@
{self, ...}: {
home.sessionPath = ["$HOME/.config/bin"];
{ self, ... }: {
home.sessionPath = [ "$HOME/.config/bin" ];
xdg.configFile.bin = {
source = "${self}/bin";

View file

@ -54,10 +54,12 @@
current-branch = "rev-parse --abbrev-ref HEAD";
dc = "diff --color --word-diff --cached";
df = "diff --color --word-diff";
dup = "!git checkout develop && git fetch origin && echo && git sl develop..origin/develop && echo && git pull --quiet && git checkout -";
dup =
"!git checkout develop && git fetch origin && echo && git sl develop..origin/develop && echo && git pull --quiet && git checkout -";
fixup = "commit --fixup";
issues = "!gh issue list --web";
mup = "!git master-to-main-wrapper checkout %BRANCH% && git fetch origin && echo && git sl %BRANCH%..origin/%BRANCH% && echo && git pull --quiet && git checkout -";
mup =
"!git master-to-main-wrapper checkout %BRANCH% && git fetch origin && echo && git sl %BRANCH%..origin/%BRANCH% && echo && git pull --quiet && git checkout -";
no-ff = "merge --no-ff";
pl = "pull";
prune = "remote prune origin";
@ -69,10 +71,12 @@
repush = "!git pull --rebase && git push";
ri = "rebase --interactive";
rid = "!git rebase -i $(git merge-base develop HEAD)";
rim = "!git rebase -i $(git master-to-main-wrapper merge-base %BRANCH% HEAD)";
rim =
"!git rebase -i $(git master-to-main-wrapper merge-base %BRANCH% HEAD)";
rip = "!git rebase -i $(git merge-base production HEAD)";
ris = "!git rebase -i $(git merge-base staging HEAD)";
riu = "!git rebase -i $(git rev-parse --abbrev-ref --symbolic-full-name @{u})";
riu =
"!git rebase -i $(git rev-parse --abbrev-ref --symbolic-full-name @{u})";
rmup = "!git mup && git master-to-main-wrapper rebase %BRANCH%";
sl = "log --oneline --decorate -20";
sla = "log --oneline --decorate --graph --all -20";
@ -97,7 +101,7 @@
checkout.defaultRemote = "origin";
color.ui = true;
column.ui = "auto";
commit = {template = "~/.gitmessage";};
commit = { template = "~/.gitmessage"; };
core = {
editor = "nvim";
excludesFile = "~/.config/git/ignore";

View file

@ -1,3 +1 @@
{
programs.lsd.enable = true;
}
{ programs.lsd.enable = true; }

View file

@ -1,7 +1,8 @@
{inputs}: {pkgs, ...}: let
system = pkgs.system;
{ inputs }:
{ pkgs, ... }:
let system = pkgs.system;
in {
programs.neovim = inputs.opdavies-nvim.lib.mkHomeManager {inherit system;};
programs.neovim = inputs.opdavies-nvim.lib.mkHomeManager { inherit system; };
home.file.".markdownlint.yaml".text = ''
default: true

View file

@ -1,3 +1 @@
{
programs.nnn.enable = true;
}
{ programs.nnn.enable = true; }

View file

@ -1,4 +1,4 @@
{self, ...}: {
{ self, ... }: {
xdg.configFile.phpactor = {
source = "${self}/config/phpactor";
recursive = true;

View file

@ -1,5 +1,5 @@
{pkgs, ...}: {
home.packages = with pkgs; [ripgrep];
{ pkgs, ... }: {
home.packages = with pkgs; [ ripgrep ];
xdg.configFile."ripgrep/config".text = ''
--follow

View file

@ -1,3 +1 @@
{
programs.starship.enable = true;
}
{ programs.starship.enable = true; }

View file

@ -1,5 +1,5 @@
{pkgs, ...}: let
inherit (pkgs) tmuxPlugins;
{ pkgs, ... }:
let inherit (pkgs) tmuxPlugins;
in {
programs.tmux = {
enable = true;
@ -102,10 +102,7 @@ in {
set -g @resurrect-strategy-nvim 'session'
'';
plugins = [
tmuxPlugins.resurrect
tmuxPlugins.vim-tmux-navigator
tmuxPlugins.yank
];
plugins =
[ tmuxPlugins.resurrect tmuxPlugins.vim-tmux-navigator tmuxPlugins.yank ];
};
}

View file

@ -200,19 +200,19 @@
plugins = [
{
name = "themes/robbyrussell";
tags = ["from:oh-my-zsh" "as:theme"];
tags = [ "from:oh-my-zsh" "as:theme" ];
}
{
name = "plugin/git";
tags = ["from:oh-my-zsh"];
tags = [ "from:oh-my-zsh" ];
}
{
name = "plugin/vi-mode";
tags = ["from:oh-my-zsh"];
tags = [ "from:oh-my-zsh" ];
}
{name = "mollifier/cd-gitroot";}
{name = "zsh-users/zsh-completions";}
{name = "zsh-users/zsh-syntax-highlighting";}
{ name = "mollifier/cd-gitroot"; }
{ name = "zsh-users/zsh-completions"; }
{ name = "zsh-users/zsh-syntax-highlighting"; }
];
};
};

View file

@ -1,11 +1,11 @@
{pkgs, ...}: {
{ pkgs, ... }: {
fonts = {
monospace = {
name = "MesloLGSDZ Nerd Font Mono";
name = "JetBrainsMono Nerd Font Mono";
# fc-list : family | sort | grep "Nerd Font"
package = pkgs.nerdfonts.override {fonts = ["Meslo"];};
size = "10";
package = pkgs.nerdfonts.override { fonts = [ "JetBrainsMono" ]; };
size = "8";
};
};
}

View file

@ -1,29 +1,26 @@
{
inputs,
self,
system,
username,
}: let
{ inputs, self, system, username, }:
let
pkgs = inputs.nixpkgs.legacyPackages.${system};
shared-config = import "${self}/lib/shared/home-manager.nix" {inherit inputs pkgs self username;};
shared-packages = import "${self}/lib/shared/home-manager-packages.nix" {inherit inputs pkgs;};
in
inputs.home-manager.lib.homeManagerConfiguration {
inherit pkgs;
shared-config = import "${self}/lib/shared/home-manager.nix" {
inherit inputs pkgs self username;
};
shared-packages = import "${self}/lib/shared/home-manager-packages.nix" {
inherit inputs pkgs;
};
in inputs.home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
{
imports = [shared-config];
modules = [{
imports = [ shared-config ];
home.packages = shared-packages;
home.packages = shared-packages;
home.sessionVariables = {
EDITOR = "nvim";
PATH = "$PATH:./vendor/bin:./node_modules/.bin";
PULUMI_SKIP_UPDATE_CHECK = "true";
RIPGREP_CONFIG_PATH = "$HOME/.config/ripgrep/config";
};
}
];
}
home.sessionVariables = {
EDITOR = "nvim";
PATH = "$PATH:./vendor/bin:./node_modules/.bin";
PULUMI_SKIP_UPDATE_CHECK = "true";
RIPGREP_CONFIG_PATH = "$HOME/.config/ripgrep/config";
};
}];
}