Skip to content

Instantly share code, notes, and snippets.

@Hubro
Last active August 8, 2023 22:31
Show Gist options
  • Save Hubro/f0baca5792f73d2ed20a16d52eef59a1 to your computer and use it in GitHub Desktop.
Save Hubro/f0baca5792f73d2ed20a16d52eef59a1 to your computer and use it in GitHub Desktop.
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
let
unstable = import <nixos-unstable> { config = { allowUnfree = true; }; };
in
{
imports =
[
# Include the results of the hardware scan.
/etc/nixos/hardware-configuration.nix
<home-manager/nixos>
];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "foo"; # Define your hostname.
networking.extraHosts = ''
'';
#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;
#networking.networkmanager.unmanaged = [ "wlp2s0" ];
# Firewall
networking.firewall = {
allowedTCPPorts = [ 8384 2200 ]; # Syncthing
allowedUDPPorts = [ 22000 21027 ]; # Syncthing
};
# Set your time zone.
time.timeZone = "Europe/Oslo";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
# Configure console keymap
console.keyMap = "no";
# Define a user account. Don't forget to set a password with ‘passwd’.
users.users.tomas = {
isNormalUser = true;
description = "Tomas Sandven";
extraGroups = [ "networkmanager" "wheel" ];
shell = pkgs.zsh;
packages = with pkgs; [ ];
};
home-manager.users.tomas = { pkgs, ... }: {
gtk.cursorTheme.package = pkgs.gnome.adwaita-icon-theme;
gtk.cursorTheme.name = "Adwaita";
gtk.cursorTheme.size = 24;
home.stateVersion = "23.05";
home.pointerCursor.package = pkgs.gnome.adwaita-icon-theme;
home.pointerCursor.name = "Adwaita";
home.pointerCursor.size = 24;
};
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
nixpkgs.config.permittedInsecurePackages = [
"openssl-1.1.1u" # DELETE ASAP
"openssl-1.1.1v" # DELETE ASAP
];
security.rtkit.enable = true;
#
# System packages
#
environment.systemPackages = with pkgs; [
bash
bat
curl
curlie
gcc
fd
ripgrep
file
pciutils # Provides "lspci"
git
glib
killall
httpie
inotify-tools
wget
jq
(python311.withPackages (ps:
with ps;
[
click
pip
pulsectl
pynvim
rich
virtualenv
(buildPythonPackage rec {
pname = "pulsectl-asyncio";
version = "1.1.1";
format = "pyproject";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-tZdrDd0jXZzMNFWgO+Zk98siAclCmTsDzraznZzqitA=";
};
# Dependencies
propagatedBuildInputs = [
setuptools
wheel
pulsectl
];
})
]))
starship
neovim
rustup
zsh-vi-mode
xdg-utils
# GUI shit
bottles
pulseaudio # provides pactl
gtk3
gtk4
gsettings-desktop-schemas
gnome.dconf-editor
gnome.adwaita-icon-theme
gnome.nautilus
gthumb
evince
xorg.xrdb # Read $HOME/.Xresources
darkman
hyprpaper
iwgtk
kitty
j4-dmenu-desktop
insync # Client for Dropbox, Google Drive etc.
neovide
pavucontrol
playerctl
tofi
viber
telegram-desktop
slack
slack-term
vivaldi
vivaldi-ffmpeg-codecs
unstable.waybar
wl-clipboard
mako
slurp # Tool for selecting a screen region on wayland, nice for screenshots
grim # Grab screenshots from Wayland compositors
swappy # Super light weight image editor, nice for screenshots
qt6.qtwayland # Wayland support for Qt
libsForQt5.qt5.qtwayland # Wayland support for Qt
xorg.xprop
];
fonts.fonts = with pkgs; [
(nerdfonts.override { fonts = [ "CascadiaCode" "FiraCode" "Iosevka" ]; })
];
#
# Programs
#
programs.hyprland = {
enable = true;
xwayland.enable = true;
xwayland.hidpi = true;
};
programs.zsh = {
enable = true;
promptInit = ''
# Starship
eval "$(starship init zsh)"
'';
interactiveShellInit = ''
# Custom shell stuff
if [[ -f "$HOME/syncthing/dotfiles/shell-setup.zsh" ]]; then
source "$HOME/syncthing/dotfiles/shell-setup.zsh"
fi
# FZF
export FZF_DEFAULT_OPTS="--height 50% --reverse --border"
export FZF_CTRL_R_OPTS="--height 10 --layout default"
export FZF_DEFAULT_COMMAND='
find . -type f,l \
! -path "*/.*/*" \
! -path "*/__pycache__/*" \
! -path "*/node_modules/*"'
# zsh-vi-mode
source "${pkgs.zsh-vi-mode}/share/zsh-vi-mode/zsh-vi-mode.plugin.zsh"
zvm_after_init_commands+=('__zvm_apply_keybindings')
function __zvm_apply_keybindings() {
source "$(fzf-share)/key-bindings.zsh"
}
export ZVM_INSERT_MODE_CURSOR=$ZVM_CURSOR_BLINKING_BEAM
export ZVM_NORMAL_MODE_CURSOR=$ZVM_CURSOR_BLOCK
export ZVM_LINE_INIT_MODE=$ZVM_MODE_INSERT
export ZVM_CURSOR_STYLE_ENABLED=true
'';
};
programs.fzf = {
keybindings = true;
fuzzyCompletion = true;
};
#
# Services
#
services.dbus.enable = true;
services.syncthing = {
enable = true;
user = "tomas";
dataDir = "/home/tomas/syncthing";
configDir = "/home/tomas/.config/syncthing";
overrideDevices = true;
devices = {
# ...
};
};
sound.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
xdg.portal = {
enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-hyprland ];
};
services.gnome.gnome-settings-daemon.enable = true;
# Configure keymap in X11
services.xserver = {
layout = "no";
xkbVariant = "";
};
# 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 = "23.05"; # Did you read the comment?
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment