Skip to content

Instantly share code, notes, and snippets.

@bitonic
Last active February 22, 2021 08:15
Show Gist options
  • Select an option

  • Save bitonic/b170ea0219a08fe48d1e09aeff18903b to your computer and use it in GitHub Desktop.

Select an option

Save bitonic/b170ea0219a08fe48d1e09aeff18903b 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, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
# Boot config
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.systemd-boot.enable = true;
networking.hostName = "tommy"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
time.timeZone = "Europe/Rome";
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
# Per-interface useDHCP will be mandatory in the future, so this generated config
# replicates the default behaviour.
networking.useDHCP = false;
networking.interfaces.enp7s0.useDHCP = true;
networking.interfaces.wlp5s0.useDHCP = true;
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
nixpkgs.config.allowUnfree = true;
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
# console = {
# font = "Lat2-Terminus16";
# keyMap = "us";
# };
# Enable the GNOME 3 Desktop Environment.
services.xserver.enable = true;
services.xserver.displayManager.gdm.enable = true;
services.xserver.displayManager.gdm.autoSuspend = false;
services.xserver.desktopManager.gnome3 = {
enable = true;
flashback = {
enableMetacity = true;
customSessions = [
{
label = "i3";
command = "${pkgs.i3}/bin/i3";
enableGnomePanel = false;
}
];
};
};
# Configure keymap in X11
# services.xserver.layout = "us";
# services.xserver.xkbOptions = "eurosign:e";
# Enable CUPS to print documents.
# services.printing.enable = true;
# Enable sound.
sound.enable = true;
hardware.pulseaudio.enable = true;
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# Define a user account. Don't forget to set a password with ‘passwd’.
users.users.bitonic = {
isNormalUser = true;
extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
openssh.authorizedKeys.keys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDIclxiwNjjWlit5sR1nAw4Sn6H6jj06DrE208jkx/EYdAF2SFG4hDaWwprr7SCQvhjOMVkCjUcL9vB+Sm+5zWitzif3IBWzws5mWOxGT24s8aBxh/vxcwrjNWbHQi+WgMXYKfyTyHPENB2r+vg61gydpd8/5paIpgGTv9UTcUaC5PPz+JJGhnDoagS0CVCZyjfriqQVtaqsuMb2TGOxUYh5+ATdQMBcrhtDhDWPLi9j83qCewdJKF8DrTUS1bijkEj7FcrkxuUyts2NypXYLErmtBVDciF0yLw6m6rtB3E917AfYoo5R1/9shQU02EixVKxNJSm7TUunY3bEhsauXX f@mazzo.li" ];
shell = pkgs.zsh;
};
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
wget
vim
firefox
kakoune
dropbox
google-chrome
nginx
rtorrent
git
python3
rofi
python38Packages.py3status
slack
keepassxc
i3status
i3
binutils
nix-index
file
zettlr
meshlab
blender
gnome3.gnome-tweak-tool
borgbackup
screen
gnumake
];
# 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.
services.openssh.enable = true;
services.openssh.permitRootLogin = "no";
services.openssh.ports = [ 22 2222 ];
# Open ports in the firewall.
networking.firewall.allowedTCPPorts = [ 80 443 49164 ];
networking.firewall.allowedUDPPorts = [ 49164 ];
# 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 = "20.09"; # Did you read the comment?
# According to Niklas this can kill your session
# system.autoUpgrade.enable = true;
# system.autoUpgrade.allowReboot = true;
# zsh
programs.zsh.enable = true;
programs.zsh.interactiveShellInit = ''
source ${pkgs.grml-zsh-config}/etc/zsh/zshrc
alias d='ls -lah'
alias g=git
alias k=kak
export MANWIDTH=72
# Make meta-delete like emacs
autoload -U select-word-style
select-word-style bash
# Editor
export EDITOR=kak
# Remove useless stuff from prompt
zstyle ':prompt:grml:left:setup' items rc change-root host path vcs time percent
'';
programs.zsh.promptInit = ""; # otherwise it'll override the grml prompt
fonts = {
fontconfig = {
localConf = ''
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="pattern">
<test qual="any" name="family"><string>Menlo</string></test>
<edit name="family" mode="assign" binding="same"><string>PragmataPro</string></edit>
</match>
<match target="pattern">
<test qual="any" name="family"><string>Consolas</string></test>
<edit name="family" mode="assign" binding="same"><string>PragmataPro</string></edit>
</match>
<match target="pattern">
<test qual="any" name="family"><string>Monaco</string></test>
<edit name="family" mode="assign" binding="same"><string>PragmataPro</string></edit>
</match>
</fontconfig>
'';
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment