Run nix fmt
Format using `nixfmt-rfc-style`.
This commit is contained in:
parent
14a1f177a0
commit
7f2df5f726
24 changed files with 317 additions and 162 deletions
lib/nixos
|
@ -1,24 +1,32 @@
|
|||
{ inputs, desktop ? false, hostname, self }:
|
||||
{
|
||||
inputs,
|
||||
desktop ? false,
|
||||
hostname,
|
||||
self,
|
||||
}:
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
configure-gtk = pkgs.writeTextFile {
|
||||
name = "configure-gtk";
|
||||
destination = "/bin/configure-gtk";
|
||||
executable = true;
|
||||
text = let
|
||||
schema = pkgs.gsettings-desktop-schemas;
|
||||
datadir = "${schema}/share/gsettings-schemas/${schema.name}";
|
||||
in ''
|
||||
export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS
|
||||
gnome_schema=org.gnome.desktop.interface
|
||||
gsettings set $gnome_schema gtk-theme 'Breeze Dark'
|
||||
'';
|
||||
text =
|
||||
let
|
||||
schema = pkgs.gsettings-desktop-schemas;
|
||||
datadir = "${schema}/share/gsettings-schemas/${schema.name}";
|
||||
in
|
||||
''
|
||||
export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS
|
||||
gnome_schema=org.gnome.desktop.interface
|
||||
gsettings set $gnome_schema gtk-theme 'Breeze Dark'
|
||||
'';
|
||||
};
|
||||
|
||||
theme = import "${self}/lib/theme" { inherit pkgs; };
|
||||
|
||||
username = "opdavies";
|
||||
in {
|
||||
in
|
||||
{
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
# Bootloader.
|
||||
|
@ -126,7 +134,11 @@ in {
|
|||
users.users.${username} = {
|
||||
isNormalUser = true;
|
||||
description = "Oliver Davies";
|
||||
extraGroups = [ "docker" "networkmanager" "wheel" ];
|
||||
extraGroups = [
|
||||
"docker"
|
||||
"networkmanager"
|
||||
"wheel"
|
||||
];
|
||||
packages = with pkgs; [ ];
|
||||
};
|
||||
|
||||
|
@ -216,10 +228,13 @@ in {
|
|||
fonts = {
|
||||
fontconfig = {
|
||||
enable = true;
|
||||
defaultFonts = { monospace = [ theme.fonts.monospace.name ]; };
|
||||
defaultFonts = {
|
||||
monospace = [ theme.fonts.monospace.name ];
|
||||
};
|
||||
};
|
||||
|
||||
packages = with pkgs;
|
||||
packages =
|
||||
with pkgs;
|
||||
[
|
||||
(nerdfonts.override {
|
||||
fonts = [
|
||||
|
@ -231,7 +246,8 @@ in {
|
|||
"JetBrainsMono"
|
||||
];
|
||||
})
|
||||
] ++ [ theme.fonts.monospace.package ];
|
||||
]
|
||||
++ [ theme.fonts.monospace.package ];
|
||||
};
|
||||
|
||||
zramSwap.enable = true;
|
||||
|
@ -247,31 +263,35 @@ in {
|
|||
|
||||
settings = {
|
||||
auto-optimise-store = true;
|
||||
experimental-features = [ "nix-command" "flakes" ];
|
||||
experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
warn-dirty = false;
|
||||
};
|
||||
};
|
||||
|
||||
# Make Caps lock work as an Escape key on press and Ctrl on hold.
|
||||
services.interception-tools = let
|
||||
dfkConfig = pkgs.writeText "dual-function-keys.yaml" ''
|
||||
MAPPINGS:
|
||||
- KEY: KEY_CAPSLOCK
|
||||
TAP: KEY_ESC
|
||||
HOLD: KEY_LEFTCTRL
|
||||
'';
|
||||
in {
|
||||
enable = true;
|
||||
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:
|
||||
NAME: "AT Translated Set 2 keyboard"
|
||||
EVENTS:
|
||||
EV_KEY: [[KEY_CAPSLOCK, KEY_ESC, KEY_LEFTCTRL]]
|
||||
'';
|
||||
};
|
||||
services.interception-tools =
|
||||
let
|
||||
dfkConfig = pkgs.writeText "dual-function-keys.yaml" ''
|
||||
MAPPINGS:
|
||||
- KEY: KEY_CAPSLOCK
|
||||
TAP: KEY_ESC
|
||||
HOLD: KEY_LEFTCTRL
|
||||
'';
|
||||
in
|
||||
{
|
||||
enable = true;
|
||||
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:
|
||||
NAME: "AT Translated Set 2 keyboard"
|
||||
EVENTS:
|
||||
EV_KEY: [[KEY_CAPSLOCK, KEY_ESC, KEY_LEFTCTRL]]
|
||||
'';
|
||||
};
|
||||
|
||||
system.autoUpgrade = {
|
||||
enable = true;
|
||||
|
@ -308,8 +328,7 @@ 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;
|
||||
|
|
|
@ -1,15 +1,36 @@
|
|||
{ inputs, self, username }:
|
||||
{ desktop ? false, hostname }:
|
||||
{
|
||||
inputs,
|
||||
self,
|
||||
username,
|
||||
}:
|
||||
{
|
||||
desktop ? false,
|
||||
hostname,
|
||||
}:
|
||||
let
|
||||
configuration =
|
||||
import ./configuration.nix { inherit desktop hostname inputs self; };
|
||||
configuration = import ./configuration.nix {
|
||||
inherit
|
||||
desktop
|
||||
hostname
|
||||
inputs
|
||||
self
|
||||
;
|
||||
};
|
||||
hardwareConfiguration = import ./hardware-configuration.nix;
|
||||
in inputs.nixpkgs.lib.nixosSystem {
|
||||
in
|
||||
inputs.nixpkgs.lib.nixosSystem {
|
||||
modules = [
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager = {
|
||||
extraSpecialArgs = { inherit inputs desktop self username; };
|
||||
extraSpecialArgs = {
|
||||
inherit
|
||||
inputs
|
||||
desktop
|
||||
self
|
||||
username
|
||||
;
|
||||
};
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
users."${username}" = import ./home-manager;
|
||||
|
|
|
@ -1,8 +1,20 @@
|
|||
{ config, lib, pkgs, modulesPath, ... }: {
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||
|
||||
boot.initrd.availableKernelModules =
|
||||
[ "xhci_pci" "thunderbolt" "nvme" "usb_storage" "sd_mod" ];
|
||||
boot.initrd.availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"thunderbolt"
|
||||
"nvme"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.kernelParams = [
|
||||
|
@ -28,7 +40,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
|
||||
|
@ -41,6 +53,5 @@
|
|||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
||||
hardware.bluetooth.enable = true;
|
||||
hardware.cpu.intel.updateMicrocode =
|
||||
lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
|
|
|
@ -1,34 +1,60 @@
|
|||
{ config, desktop, inputs, pkgs, self, username, ... }:
|
||||
{
|
||||
config,
|
||||
desktop,
|
||||
inputs,
|
||||
pkgs,
|
||||
self,
|
||||
username,
|
||||
...
|
||||
}:
|
||||
let
|
||||
desktop-config =
|
||||
import ./desktop.nix { inherit config inputs pkgs username; };
|
||||
desktop-config = import ./desktop.nix {
|
||||
inherit
|
||||
config
|
||||
inputs
|
||||
pkgs
|
||||
username
|
||||
;
|
||||
};
|
||||
shared-config = import "${self}/lib/shared/home-manager.nix" {
|
||||
inherit inputs pkgs self username;
|
||||
inherit
|
||||
inputs
|
||||
pkgs
|
||||
self
|
||||
username
|
||||
;
|
||||
};
|
||||
shared-packages = import "${self}/lib/shared/home-manager-packages.nix" {
|
||||
inherit inputs pkgs;
|
||||
};
|
||||
in {
|
||||
shared-packages = import "${self}/lib/shared/home-manager-packages.nix" { inherit inputs pkgs; };
|
||||
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.kdenlive
|
||||
pkgs.meslo-lg
|
||||
pkgs.obs-studio
|
||||
pkgs.okular
|
||||
pkgs.pamixer
|
||||
pkgs.pass
|
||||
pkgs.pavucontrol
|
||||
pkgs.pinentry
|
||||
pkgs.via
|
||||
pkgs.xsel
|
||||
pkgs.xcape
|
||||
pkgs.zoom-us
|
||||
];
|
||||
home.packages =
|
||||
shared-packages
|
||||
++ pkgs.lib.optionals desktop [
|
||||
pkgs.discord
|
||||
pkgs.gimp
|
||||
pkgs.gscan2pdf
|
||||
pkgs.kdenlive
|
||||
pkgs.meslo-lg
|
||||
pkgs.obs-studio
|
||||
pkgs.okular
|
||||
pkgs.pamixer
|
||||
pkgs.pass
|
||||
pkgs.pavucontrol
|
||||
pkgs.pinentry
|
||||
pkgs.via
|
||||
pkgs.xsel
|
||||
pkgs.xcape
|
||||
pkgs.zoom-us
|
||||
];
|
||||
|
||||
home.sessionVariables = {
|
||||
EDITOR = "nvim";
|
||||
|
|
|
@ -1,4 +1,10 @@
|
|||
{ config, inputs, pkgs, username, }: {
|
||||
{
|
||||
config,
|
||||
inputs,
|
||||
pkgs,
|
||||
username,
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./modules/copyq.nix
|
||||
./modules/dunst.nix
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
services.dunst = {
|
||||
enable = true;
|
||||
|
||||
settings = { global = { follow = "keyboard"; }; };
|
||||
settings = {
|
||||
global = {
|
||||
follow = "keyboard";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
let baseUrl = "https://www.oliverdavies.uk";
|
||||
in {
|
||||
let
|
||||
baseUrl = "https://www.oliverdavies.uk";
|
||||
in
|
||||
{
|
||||
services.espanso = {
|
||||
enable = true;
|
||||
|
||||
configs = { default = { show_notifications = false; }; };
|
||||
configs = {
|
||||
default = {
|
||||
show_notifications = false;
|
||||
};
|
||||
};
|
||||
|
||||
matches = {
|
||||
base = {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{ username, ... }: {
|
||||
{ username, ... }:
|
||||
{
|
||||
services.flameshot = {
|
||||
enable = true;
|
||||
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
{ config, inputs, pkgs, ... }:
|
||||
{
|
||||
config,
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
programs.i3status-rust = {
|
||||
|
@ -64,18 +69,19 @@
|
|||
xwayland = true;
|
||||
|
||||
config = {
|
||||
bars = [{
|
||||
colors.background = "#111111";
|
||||
bars = [
|
||||
{
|
||||
colors.background = "#111111";
|
||||
|
||||
fonts = {
|
||||
names = [ "JetBrainsMono Nerd Font Mono" ];
|
||||
size = 12.0;
|
||||
};
|
||||
fonts = {
|
||||
names = [ "JetBrainsMono Nerd Font Mono" ];
|
||||
size = 12.0;
|
||||
};
|
||||
|
||||
statusCommand =
|
||||
"i3status-rs ~/.config/i3status-rust/config-default.toml";
|
||||
trayPadding = 5;
|
||||
}];
|
||||
statusCommand = "i3status-rs ~/.config/i3status-rust/config-default.toml";
|
||||
trayPadding = 5;
|
||||
}
|
||||
];
|
||||
|
||||
defaultWorkspace = "workspace number 1";
|
||||
|
||||
|
@ -85,7 +91,9 @@
|
|||
};
|
||||
|
||||
input = {
|
||||
"*" = { xkb_layout = "gb"; };
|
||||
"*" = {
|
||||
xkb_layout = "gb";
|
||||
};
|
||||
|
||||
"type:touchpad" = {
|
||||
dwt = "enabled";
|
||||
|
@ -94,8 +102,10 @@
|
|||
};
|
||||
|
||||
keybindings =
|
||||
let modifier = config.wayland.windowManager.sway.config.modifier;
|
||||
in inputs.nixpkgs.lib.mkOptionDefault {
|
||||
let
|
||||
modifier = config.wayland.windowManager.sway.config.modifier;
|
||||
in
|
||||
inputs.nixpkgs.lib.mkOptionDefault {
|
||||
"${modifier}+Escape" = "exec swaylock --daemonize";
|
||||
"${modifier}+Shift+b" = "exec ${pkgs.firefox}/bin/firefox";
|
||||
"${modifier}+Shift+f" = "exec ${pkgs.xfce.thunar}/bin/thunar";
|
||||
|
@ -112,7 +122,9 @@
|
|||
# bg = "~/.config/wallpaper/wallpaper.jpg fill";
|
||||
# };
|
||||
|
||||
eDP-1 = { scale = "1.0"; };
|
||||
eDP-1 = {
|
||||
scale = "1.0";
|
||||
};
|
||||
};
|
||||
|
||||
terminal = "wezterm";
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{ inputs, username, ... }:
|
||||
{ pkgs, ... }: {
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
services.displayManager.defaultSession = "sway";
|
||||
|
||||
programs.sway.enable = true;
|
||||
|
@ -9,16 +10,24 @@
|
|||
extraPortals = with pkgs; [ xdg-desktop-portal-wlr ];
|
||||
};
|
||||
|
||||
home-manager.users.${username} = { pkgs, ... }: {
|
||||
home.sessionVariables = {
|
||||
MOZ_ENABLE_WAYLAND = "1";
|
||||
MOZ_USE_XINPUT2 = "1";
|
||||
QT_QPA_PLATFORM = "wayland";
|
||||
SDL_VIDEODRIVER = "wayland";
|
||||
XDG_CURRENT_DESKTOP = "sway";
|
||||
XDG_SESSION_TYPE = "wayland";
|
||||
};
|
||||
home-manager.users.${username} =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.sessionVariables = {
|
||||
MOZ_ENABLE_WAYLAND = "1";
|
||||
MOZ_USE_XINPUT2 = "1";
|
||||
QT_QPA_PLATFORM = "wayland";
|
||||
SDL_VIDEODRIVER = "wayland";
|
||||
XDG_CURRENT_DESKTOP = "sway";
|
||||
XDG_SESSION_TYPE = "wayland";
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [ i3status swaybg wdisplays wl-clipboard wofi ];
|
||||
};
|
||||
home.packages = with pkgs; [
|
||||
i3status
|
||||
swaybg
|
||||
wdisplays
|
||||
wl-clipboard
|
||||
wofi
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue