2024-03-19 00:13:01 +00:00
|
|
|
|
{ inputs, desktop ? false, hostname, self }:
|
2024-03-18 20:33:28 +00:00
|
|
|
|
{ pkgs, ... }:
|
|
|
|
|
let
|
2023-05-23 10:59:07 +00:00
|
|
|
|
configure-gtk = pkgs.writeTextFile {
|
2023-06-13 18:51:56 +00:00
|
|
|
|
name = "configure-gtk";
|
|
|
|
|
destination = "/bin/configure-gtk";
|
|
|
|
|
executable = true;
|
2024-02-13 21:33:32 +00:00
|
|
|
|
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'
|
|
|
|
|
'';
|
2023-05-23 10:59:07 +00:00
|
|
|
|
};
|
2023-09-14 06:25:55 +00:00
|
|
|
|
|
2024-03-18 20:33:28 +00:00
|
|
|
|
theme = import "${self}/lib/theme" { inherit pkgs; };
|
2024-03-17 00:27:24 +00:00
|
|
|
|
|
2023-09-14 06:25:55 +00:00
|
|
|
|
username = "opdavies";
|
2024-02-13 21:33:32 +00:00
|
|
|
|
in {
|
2024-03-03 23:27:49 +00:00
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
2023-07-30 21:53:42 +00:00
|
|
|
|
|
2023-03-30 18:15:51 +00:00
|
|
|
|
# Bootloader.
|
|
|
|
|
boot.loader.systemd-boot.enable = true;
|
|
|
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
|
|
|
boot.loader.efi.efiSysMountPoint = "/boot/efi";
|
|
|
|
|
|
2023-06-15 18:33:41 +00:00
|
|
|
|
systemd.extraConfig = ''
|
|
|
|
|
DefaultTimeoutStopSec=10s
|
|
|
|
|
'';
|
2023-03-30 18:15:51 +00:00
|
|
|
|
|
2024-03-19 00:13:01 +00:00
|
|
|
|
networking.hostName = hostname;
|
|
|
|
|
|
2023-03-30 18:15:51 +00:00
|
|
|
|
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
|
|
|
|
|
|
|
|
|
# Configure network proxy if necessary
|
|
|
|
|
# networking.proxy.default = "http://user:password@proxy:port/";
|
|
|
|
|
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
|
|
|
|
|
|
|
|
|
|
# Enable networking
|
|
|
|
|
networking.networkmanager.enable = true;
|
|
|
|
|
|
|
|
|
|
# Set your time zone.
|
|
|
|
|
time.timeZone = "Europe/London";
|
|
|
|
|
|
|
|
|
|
# Select internationalisation properties.
|
|
|
|
|
i18n.defaultLocale = "en_GB.UTF-8";
|
|
|
|
|
|
|
|
|
|
i18n.extraLocaleSettings = {
|
|
|
|
|
LC_ADDRESS = "en_GB.UTF-8";
|
|
|
|
|
LC_IDENTIFICATION = "en_GB.UTF-8";
|
|
|
|
|
LC_MEASUREMENT = "en_GB.UTF-8";
|
|
|
|
|
LC_MONETARY = "en_GB.UTF-8";
|
|
|
|
|
LC_NAME = "en_GB.UTF-8";
|
|
|
|
|
LC_NUMERIC = "en_GB.UTF-8";
|
|
|
|
|
LC_PAPER = "en_GB.UTF-8";
|
|
|
|
|
LC_TELEPHONE = "en_GB.UTF-8";
|
|
|
|
|
LC_TIME = "en_GB.UTF-8";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# Enable the X11 windowing system.
|
|
|
|
|
services.xserver.enable = true;
|
|
|
|
|
|
|
|
|
|
services.xserver = {
|
2024-02-02 22:06:04 +00:00
|
|
|
|
xkb = {
|
|
|
|
|
layout = "gb";
|
|
|
|
|
variant = "";
|
|
|
|
|
};
|
2023-03-30 18:15:51 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# Configure console keymap
|
|
|
|
|
console.keyMap = "uk";
|
|
|
|
|
|
2023-08-21 16:40:04 +00:00
|
|
|
|
services.avahi.enable = true;
|
2024-01-14 09:11:03 +00:00
|
|
|
|
services.avahi.nssmdns4 = true;
|
2023-08-21 16:40:04 +00:00
|
|
|
|
services.avahi.openFirewall = true;
|
2023-03-30 18:15:51 +00:00
|
|
|
|
services.printing.enable = true;
|
|
|
|
|
|
2023-09-14 18:07:01 +00:00
|
|
|
|
# Enable sound with pipewire.
|
|
|
|
|
sound.enable = true;
|
2024-03-22 23:38:40 +00:00
|
|
|
|
hardware.pulseaudio.enable = false;
|
2023-03-30 18:15:51 +00:00
|
|
|
|
security.rtkit.enable = true;
|
2024-03-22 23:38:40 +00:00
|
|
|
|
|
|
|
|
|
services.pipewire = {
|
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
|
|
alsa = {
|
|
|
|
|
enable = true;
|
|
|
|
|
support32Bit = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
pulse.enable = true;
|
|
|
|
|
};
|
2023-03-30 18:15:51 +00:00
|
|
|
|
|
|
|
|
|
# Enable touchpad support (enabled default in most desktopManager).
|
|
|
|
|
# services.xserver.libinput.enable = true;
|
|
|
|
|
|
2023-09-14 06:25:55 +00:00
|
|
|
|
users.users.${username} = {
|
2023-03-30 18:15:51 +00:00
|
|
|
|
isNormalUser = true;
|
|
|
|
|
description = "Oliver Davies";
|
2024-03-18 20:33:28 +00:00
|
|
|
|
extraGroups = [ "docker" "networkmanager" "wheel" ];
|
|
|
|
|
packages = with pkgs; [ ];
|
2023-03-30 18:15:51 +00:00
|
|
|
|
};
|
|
|
|
|
|
2023-04-11 19:03:25 +00:00
|
|
|
|
security.sudo.wheelNeedsPassword = false;
|
|
|
|
|
|
2023-03-30 18:15:51 +00:00
|
|
|
|
# List packages installed in system profile. To search, run:
|
|
|
|
|
# $ nix search wget
|
|
|
|
|
environment.systemPackages = with pkgs;
|
2024-05-10 20:56:51 +00:00
|
|
|
|
[ ddev just mkcert ttyper yt-dlp ] ++ pkgs.lib.optionals desktop [
|
2023-12-27 15:18:32 +00:00
|
|
|
|
acpi
|
2024-02-14 12:17:50 +00:00
|
|
|
|
arandr
|
2024-05-09 11:55:48 +00:00
|
|
|
|
brightnessctl
|
|
|
|
|
configure-gtk
|
2023-12-27 15:18:32 +00:00
|
|
|
|
dunst
|
2024-05-09 11:55:48 +00:00
|
|
|
|
ffmpegthumbnailer
|
2023-12-27 15:18:32 +00:00
|
|
|
|
libnotify
|
2024-03-03 23:27:49 +00:00
|
|
|
|
obsidian
|
2024-03-14 23:22:00 +00:00
|
|
|
|
pocket-casts
|
2024-01-25 07:20:37 +00:00
|
|
|
|
rclone
|
|
|
|
|
rclone-browser
|
2024-05-09 11:55:48 +00:00
|
|
|
|
shotwell
|
2024-05-22 20:33:45 +00:00
|
|
|
|
slack
|
2024-03-14 23:22:00 +00:00
|
|
|
|
spotify
|
|
|
|
|
teams-for-linux
|
|
|
|
|
todoist-electron
|
2024-04-30 07:46:09 +00:00
|
|
|
|
vscode
|
2024-05-09 11:55:48 +00:00
|
|
|
|
xfce.thunar
|
|
|
|
|
xfce.thunar-volman
|
|
|
|
|
xfce.tumbler
|
2023-12-21 12:00:05 +00:00
|
|
|
|
|
|
|
|
|
# Games.
|
2024-02-10 18:55:47 +00:00
|
|
|
|
zeroad
|
2023-03-30 18:15:51 +00:00
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
# Some programs need SUID wrappers, can be configured further or are
|
|
|
|
|
# started in user sessions.
|
|
|
|
|
# programs.mtr.enable = true;
|
|
|
|
|
# programs.gnupg.agent = {
|
|
|
|
|
# enable = true;
|
|
|
|
|
# enableSSHSupport = true;
|
|
|
|
|
# };
|
|
|
|
|
|
|
|
|
|
# List services that you want to enable:
|
|
|
|
|
|
|
|
|
|
# Enable the OpenSSH daemon.
|
2023-08-24 21:39:35 +00:00
|
|
|
|
services.openssh.enable = true;
|
2023-03-30 18:15:51 +00:00
|
|
|
|
|
|
|
|
|
# Open ports in the firewall.
|
2024-04-30 19:40:06 +00:00
|
|
|
|
networking.firewall.allowedTCPPorts = [
|
|
|
|
|
9003 # xdebug
|
|
|
|
|
];
|
2023-03-30 18:15:51 +00:00
|
|
|
|
# networking.firewall.allowedUDPPorts = [ ... ];
|
|
|
|
|
# Or disable the firewall altogether.
|
|
|
|
|
# networking.firewall.enable = false;
|
|
|
|
|
|
|
|
|
|
# This value determines the NixOS release from which the default
|
|
|
|
|
# settings for stateful data, like file locations and database versions
|
|
|
|
|
# on your system were taken. It‘s perfectly fine and recommended to leave
|
|
|
|
|
# this value at the release version of the first install of this system.
|
|
|
|
|
# Before changing this value read the documentation for this option
|
|
|
|
|
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
|
|
|
|
system.stateVersion = "22.11"; # Did you read the comment?
|
|
|
|
|
|
2024-03-18 00:44:00 +00:00
|
|
|
|
virtualisation.docker = {
|
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
|
|
autoPrune = {
|
|
|
|
|
enable = true;
|
|
|
|
|
dates = "weekly";
|
|
|
|
|
};
|
|
|
|
|
};
|
2023-04-05 17:00:00 +00:00
|
|
|
|
|
|
|
|
|
programs.zsh.enable = true;
|
|
|
|
|
programs.zsh.histSize = 5000;
|
|
|
|
|
|
2023-09-14 06:25:55 +00:00
|
|
|
|
users.defaultUserShell = "/etc/profiles/per-user/${username}/bin/zsh";
|
2023-05-03 21:19:59 +00:00
|
|
|
|
|
2023-06-03 10:40:49 +00:00
|
|
|
|
fonts = {
|
|
|
|
|
fontconfig = {
|
|
|
|
|
enable = true;
|
2024-05-09 11:55:48 +00:00
|
|
|
|
defaultFonts = { monospace = [ theme.fonts.monospace.name ]; };
|
2023-06-03 10:40:49 +00:00
|
|
|
|
};
|
2023-12-21 12:09:03 +00:00
|
|
|
|
|
2024-03-17 00:27:24 +00:00
|
|
|
|
packages = with pkgs;
|
|
|
|
|
[
|
|
|
|
|
(nerdfonts.override {
|
|
|
|
|
fonts = [
|
|
|
|
|
"AnonymousPro"
|
|
|
|
|
"FiraCode"
|
|
|
|
|
"GeistMono"
|
|
|
|
|
"IntelOneMono"
|
|
|
|
|
"Iosevka"
|
|
|
|
|
"JetBrainsMono"
|
|
|
|
|
];
|
|
|
|
|
})
|
2024-03-18 20:33:28 +00:00
|
|
|
|
] ++ [ theme.fonts.monospace.package ];
|
2023-06-03 10:40:49 +00:00
|
|
|
|
};
|
|
|
|
|
|
2023-05-09 18:09:12 +00:00
|
|
|
|
zramSwap.enable = true;
|
2023-05-31 23:36:19 +00:00
|
|
|
|
|
2023-11-07 00:07:24 +00:00
|
|
|
|
nix = {
|
|
|
|
|
gc = {
|
|
|
|
|
automatic = true;
|
2024-02-07 23:28:44 +00:00
|
|
|
|
dates = "daily";
|
|
|
|
|
options = "--delete-older-than 7d";
|
2023-11-07 00:07:24 +00:00
|
|
|
|
};
|
2023-06-03 10:08:16 +00:00
|
|
|
|
|
2023-11-07 00:07:24 +00:00
|
|
|
|
optimise.automatic = true;
|
|
|
|
|
|
|
|
|
|
settings = {
|
|
|
|
|
auto-optimise-store = true;
|
2024-03-18 20:33:28 +00:00
|
|
|
|
experimental-features = [ "nix-command" "flakes" ];
|
2023-11-07 00:07:24 +00:00
|
|
|
|
warn-dirty = false;
|
|
|
|
|
};
|
2023-06-03 10:08:16 +00:00
|
|
|
|
};
|
|
|
|
|
|
2023-05-31 23:36:19 +00:00
|
|
|
|
# Make Caps lock work as an Escape key on press and Ctrl on hold.
|
2024-02-13 21:33:32 +00:00
|
|
|
|
services.interception-tools = let
|
|
|
|
|
dfkConfig = pkgs.writeText "dual-function-keys.yaml" ''
|
|
|
|
|
MAPPINGS:
|
|
|
|
|
- KEY: KEY_CAPSLOCK
|
|
|
|
|
TAP: KEY_ESC
|
|
|
|
|
HOLD: KEY_LEFTCTRL
|
|
|
|
|
'';
|
|
|
|
|
in {
|
|
|
|
|
enable = true;
|
2024-03-18 20:33:28 +00:00
|
|
|
|
plugins =
|
|
|
|
|
pkgs.lib.mkForce [ pkgs.interception-tools-plugins.dual-function-keys ];
|
2024-02-13 21:33:32 +00:00
|
|
|
|
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]]
|
|
|
|
|
'';
|
|
|
|
|
};
|
2023-06-04 15:30:17 +00:00
|
|
|
|
|
2023-06-13 18:51:56 +00:00
|
|
|
|
system.autoUpgrade = {
|
|
|
|
|
enable = true;
|
2024-02-26 16:41:32 +00:00
|
|
|
|
flake = inputs.self.outPath;
|
|
|
|
|
flags = [
|
|
|
|
|
"--update-input"
|
|
|
|
|
"nixpkgs"
|
|
|
|
|
"--no-write-lock-file"
|
|
|
|
|
"-L" # print build logs
|
|
|
|
|
];
|
|
|
|
|
dates = "08:00";
|
|
|
|
|
randomizedDelaySec = "45min";
|
2023-06-13 18:51:56 +00:00
|
|
|
|
};
|
2023-06-22 06:55:59 +00:00
|
|
|
|
|
2023-06-22 07:42:26 +00:00
|
|
|
|
services.gvfs.enable = true;
|
|
|
|
|
|
2023-06-22 06:55:59 +00:00
|
|
|
|
programs.gnupg.agent = {
|
|
|
|
|
enable = true;
|
|
|
|
|
enableSSHSupport = true;
|
2024-03-14 23:33:00 +00:00
|
|
|
|
pinentryPackage = pkgs.pinentry-qt;
|
2023-06-22 06:55:59 +00:00
|
|
|
|
};
|
2023-08-10 23:28:17 +00:00
|
|
|
|
|
2023-08-27 00:57:12 +00:00
|
|
|
|
programs.firefox = {
|
|
|
|
|
enable = true;
|
2024-03-18 20:33:28 +00:00
|
|
|
|
languagePacks = [ "en-GB" ];
|
2023-08-27 00:57:12 +00:00
|
|
|
|
preferences = {
|
|
|
|
|
"intl.accept_languages" = "en-GB, en";
|
|
|
|
|
"intl.regional_prefs.use_os_locales" = true;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2024-01-09 20:40:10 +00:00
|
|
|
|
services.blueman.enable = true;
|
|
|
|
|
|
2023-12-27 15:18:32 +00:00
|
|
|
|
services.cron = {
|
|
|
|
|
enable = true;
|
|
|
|
|
|
2024-03-18 20:33:28 +00:00
|
|
|
|
systemCronJobs =
|
|
|
|
|
[ "* * * * * opdavies /home/opdavies/.config/bin/notify-battery.sh" ];
|
2023-12-27 15:18:32 +00:00
|
|
|
|
};
|
2023-09-27 23:51:59 +00:00
|
|
|
|
|
|
|
|
|
services.auto-cpufreq.enable = true;
|
2024-03-09 20:33:44 +00:00
|
|
|
|
|
|
|
|
|
services.udev = {
|
|
|
|
|
enable = true;
|
|
|
|
|
extraRules = ''
|
|
|
|
|
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0660", GROUP="users", TAG+="uaccess", TAG+="udev-acl"
|
|
|
|
|
'';
|
|
|
|
|
};
|
2023-03-30 18:15:51 +00:00
|
|
|
|
}
|