2023-10-03 22:04:08 +00:00
|
|
|
|
{ inputs, pkgs, system }:
|
2023-03-30 18:15:51 +00:00
|
|
|
|
|
2023-05-23 10:59:07 +00:00
|
|
|
|
let
|
2023-11-04 10:29:29 +00:00
|
|
|
|
pkgsUnstable = inputs.nixpkgs-unstable.legacyPackages."${system}";
|
|
|
|
|
|
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;
|
|
|
|
|
text =
|
|
|
|
|
let
|
2023-05-23 10:59:07 +00:00
|
|
|
|
schema = pkgs.gsettings-desktop-schemas;
|
|
|
|
|
datadir = "${schema}/share/gsettings-schemas/${schema.name}";
|
2023-06-13 18:51:56 +00:00
|
|
|
|
in
|
|
|
|
|
''
|
2023-05-23 10:59:07 +00:00
|
|
|
|
export XDG_DATA_DIRS=${datadir}:$XDG_DATA_DIRS
|
|
|
|
|
gnome_schema=org.gnome.desktop.interface
|
|
|
|
|
gsettings set $gnome_schema gtk-theme 'Breeze Dark'
|
2023-06-13 18:51:56 +00:00
|
|
|
|
'';
|
2023-05-23 10:59:07 +00:00
|
|
|
|
};
|
2023-09-14 06:25:55 +00:00
|
|
|
|
|
|
|
|
|
username = "opdavies";
|
2023-06-13 18:51:56 +00:00
|
|
|
|
in
|
|
|
|
|
{
|
2023-07-30 21:53:42 +00:00
|
|
|
|
nixpkgs = {
|
|
|
|
|
config = {
|
|
|
|
|
allowUnfree = true;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
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
|
|
|
|
|
2023-08-07 21:27:54 +00:00
|
|
|
|
# networking.hostName = "nixedo"; # Define your 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 = {
|
2023-11-14 20:20:07 +00:00
|
|
|
|
# Configure keymap in X11.
|
2023-03-30 18:15:51 +00:00
|
|
|
|
layout = "gb";
|
|
|
|
|
xkbVariant = "";
|
2023-11-14 20:20:07 +00:00
|
|
|
|
|
|
|
|
|
displayManager = {
|
|
|
|
|
defaultSession = "none+i3";
|
2023-11-19 08:41:14 +00:00
|
|
|
|
lightdm.enable = true;
|
2023-11-14 20:20:07 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
windowManager.i3 = {
|
|
|
|
|
enable = true;
|
|
|
|
|
package = pkgs.i3-gaps;
|
|
|
|
|
extraPackages = with pkgs; [ i3status i3lock i3blocks ];
|
|
|
|
|
};
|
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;
|
|
|
|
|
services.avahi.nssmdns = true;
|
|
|
|
|
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;
|
|
|
|
|
hardware.pulseaudio.enable = true;
|
2023-03-30 18:15:51 +00:00
|
|
|
|
security.rtkit.enable = true;
|
2023-09-14 18:07:01 +00:00
|
|
|
|
# services.pipewire = {
|
|
|
|
|
# enable = true;
|
|
|
|
|
# alsa.enable = true;
|
|
|
|
|
# alsa.support32Bit = true;
|
|
|
|
|
# pulse.enable = true;
|
|
|
|
|
# # If you want to use JACK applications, uncomment this
|
|
|
|
|
# #jack.enable = true;
|
|
|
|
|
#
|
|
|
|
|
# # use the example session manager (no others are packaged yet so this is enabled by default,
|
|
|
|
|
# # no need to redefine it in your config for now)
|
|
|
|
|
# #media-session.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";
|
2023-09-14 18:07:01 +00:00
|
|
|
|
extraGroups = [ "docker" "networkmanager" "wheel" ];
|
2023-08-03 21:59:10 +00:00
|
|
|
|
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;
|
|
|
|
|
[
|
2023-05-31 19:35:57 +00:00
|
|
|
|
brightnessctl
|
2023-05-23 10:59:07 +00:00
|
|
|
|
configure-gtk
|
2023-06-12 22:32:34 +00:00
|
|
|
|
ffmpegthumbnailer
|
2023-08-27 16:35:23 +00:00
|
|
|
|
shotwell
|
2023-06-12 22:32:34 +00:00
|
|
|
|
xfce.thunar
|
|
|
|
|
xfce.thunar-volman
|
|
|
|
|
xfce.tumbler
|
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.
|
|
|
|
|
# networking.firewall.allowedTCPPorts = [ ... ];
|
|
|
|
|
# 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?
|
|
|
|
|
|
|
|
|
|
virtualisation.docker.enable = true;
|
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;
|
|
|
|
|
defaultFonts = {
|
2023-08-29 20:49:11 +00:00
|
|
|
|
monospace = [ "JetBrainsMono Nerd Font Mono" ];
|
2023-06-03 10:40:49 +00:00
|
|
|
|
};
|
|
|
|
|
};
|
2023-12-01 17:22:07 +00:00
|
|
|
|
packages = with pkgsUnstable; [
|
2023-08-24 21:39:35 +00:00
|
|
|
|
(nerdfonts.override {
|
|
|
|
|
fonts = [
|
2023-11-04 20:23:50 +00:00
|
|
|
|
"AnonymousPro"
|
2023-08-24 21:39:35 +00:00
|
|
|
|
"FiraCode"
|
2023-09-18 21:35:29 +00:00
|
|
|
|
"IntelOneMono"
|
2023-11-04 20:23:50 +00:00
|
|
|
|
"Iosevka"
|
2023-08-24 21:39:35 +00:00
|
|
|
|
"JetBrainsMono"
|
|
|
|
|
"Meslo"
|
|
|
|
|
];
|
|
|
|
|
})
|
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;
|
|
|
|
|
dates = "weekly";
|
|
|
|
|
options = "--delete-older-than 30d";
|
|
|
|
|
};
|
2023-06-03 10:08:16 +00:00
|
|
|
|
|
2023-11-07 00:07:24 +00:00
|
|
|
|
optimise.automatic = true;
|
|
|
|
|
|
|
|
|
|
settings = {
|
|
|
|
|
auto-optimise-store = true;
|
|
|
|
|
experimental-features = [ "nix-command" "flakes" ];
|
|
|
|
|
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.
|
|
|
|
|
services.interception-tools =
|
|
|
|
|
let
|
|
|
|
|
dfkConfig = pkgs.writeText "dual-function-keys.yaml" ''
|
|
|
|
|
MAPPINGS:
|
|
|
|
|
- KEY: KEY_CAPSLOCK
|
|
|
|
|
TAP: KEY_ESC
|
|
|
|
|
HOLD: KEY_LEFTCTRL
|
|
|
|
|
'';
|
|
|
|
|
in
|
|
|
|
|
{
|
|
|
|
|
enable = true;
|
2023-10-03 22:04:08 +00:00
|
|
|
|
plugins = pkgs.lib.mkForce [ pkgs.interception-tools-plugins.dual-function-keys ];
|
2023-05-31 23:36:19 +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 = {
|
|
|
|
|
allowReboot = true;
|
|
|
|
|
enable = true;
|
|
|
|
|
flake = "nixedo";
|
|
|
|
|
};
|
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;
|
|
|
|
|
pinentryFlavor = "qt";
|
|
|
|
|
};
|
2023-08-10 23:28:17 +00:00
|
|
|
|
|
2023-08-27 00:57:12 +00:00
|
|
|
|
programs.firefox = {
|
|
|
|
|
enable = true;
|
|
|
|
|
languagePacks = [ "en-GB" ];
|
|
|
|
|
package = pkgs.firefox-devedition;
|
|
|
|
|
preferences = {
|
|
|
|
|
"intl.accept_languages" = "en-GB, en";
|
|
|
|
|
"intl.regional_prefs.use_os_locales" = true;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2023-08-10 23:28:17 +00:00
|
|
|
|
services.udev.extraRules = ''
|
|
|
|
|
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0660", TAG+="uaccess", TAG+="udev-acl", GROUP="realet"
|
2023-09-14 06:25:55 +00:00
|
|
|
|
'';
|
2023-09-27 23:51:59 +00:00
|
|
|
|
|
|
|
|
|
services.auto-cpufreq.enable = true;
|
2023-03-30 18:15:51 +00:00
|
|
|
|
}
|
|
|
|
|
|