Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 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
- home-manager = builtins.fetchTarball {
- url = "https://github.com/rycee/home-manager/archive/master.tar.gz";
- };
- impermanence = builtins.fetchTarball {
- url =
- "https://github.com/nix-community/impermanence/archive/master.tar.gz";
- };
- emacs = builtins.fetchTarball {
- url = https://github.com/nix-community/emacs-overlay/archive/master.tar.gz;
- };
- in
- {
- imports =
- [ # Include the results of the hardware scan.
- ./hardware-configuration.nix
- "${home-manager}/nixos"
- "${impermanence}/nixos.nix"
- ];
- system.stateVersion = "20.03"; # Did you read the comment?
- networking.hostName = "dent";
- time.timeZone = "US/Eastern";
- networking.networkmanager.enable = true;
- boot.initrd.luks.gpgSupport = true;
- boot.initrd.luks.devices = {
- root = {
- device = "/dev/sda2";
- # device = "/dev/disk/by-uuid/0decdb2d-934a-4f86-a17f-f76c5c806679";
- preLVM = true;
- allowDiscards = true;
- gpgCard = {
- gracePeriod = 25;
- encryptedPass = "${/nix/persist/boot_pass/pass.gpg}";
- publicKey = "${/nix/persist/boot_pass/mog.asc}";
- };
- };
- };
- hardware.nitrokey.enable = true;
- programs.gnupg.agent = { enable = true; enableSSHSupport = true; };
- security.pam.enableSSHAgentAuth = true;
- environment.etc."vim/vimrc".text = ''
- set nocompatible
- syntax on
- set backspace=indent,eol,start
- set mouse-=a
- '';
- environment.persistence."/nix/persist" = {
- directories = [
- "/etc/nixos"
- "/etc/NetworkManager/system-connections"
- ];
- files = [
- "/etc/machine-id"
- "/etc/ssh/ssh_host_rsa_key"
- "/etc/ssh/ssh_host_rsa_key.pub"
- "/etc/ssh/ssh_host_ed25519_key"
- "/etc/ssh/ssh_host_ed25519_key.pub"
- ];
- };
- users.mutableUsers = false;
- users.users.mog = {
- isNormalUser = true;
- createHome = true;
- group = "users";
- extraGroups = [ "networkmanager" "wheel" "dialout" "vboxusers" "docker" "libvirtd" "nitrokey" "plugdev" ];
- uid = 1000;
- };
- home-manager.users.mog = { pkgs, ... }: {
- imports = [ "${impermanence}/home-manager.nix" ];
- programs.home-manager.enable = true;
- home.persistence."/nix/persist/home/mog" = {
- directories = [ ".ssh" "Downloads" ".config/hexchat" ];
- files = [ ".bash_history" ];
- };
- };
- boot.loader.systemd-boot.enable = true;
- boot.loader.efi.canTouchEfiVariables = true;
- boot.loader.systemd-boot.editor = false;
- # fileSystems."/".options = [ "noatime" "nodiratime" "discard" ];
- boot.kernelPackages = pkgs.linuxPackages_latest;
- networking.useDHCP = false;
- networking.interfaces.wlp6s0.useDHCP = false;
- services.udev = {
- extraRules = ''
- ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="34:13:e8:37:5c:fd", NAME="wlan0"
- # Rule for USB Receiver
- SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c53e", MODE="0660", TAG+="uaccess", GROUP="dialout"
- # Rule when connected via Bluetooth
- # Updated rule, thanks to Torsten Maehne (https://github.com/maehne)
- SUBSYSTEMS=="input", ATTRS{name}=="SPOTLIGHT*", MODE="0660", TAG+="uaccess", GROUP="dialout"
- '';
- };
- services.tlp.enable = true;
- services.tlp.extraConfig = ''
- USB_BLACKLIST="1d50:60e6 20a0:4108"
- '';
- services.openssh.enable = true;
- services.blueman.enable = true;
- virtualisation.docker.enable = true;
- networking.firewall.enable = false;
- # Enable the X11 windowing system.
- services.xserver.enable = true;
- services.xserver.wacom.enable = true;
- services.xserver.libinput.enable = true;
- services.xserver.modules = [ pkgs.xf86_input_wacom ];
- environment.variables = { MOZ_USE_XINPUT2="1"; };
- services.xserver.layout = "us";
- services.printing.enable = true;
- services.xserver.displayManager.gdm.enable = true;
- services.xserver.desktopManager.gnome3.enable = true;
- sound.enable = true;
- hardware.pulseaudio.enable = true;
- hardware.opengl.driSupport32Bit = true;
- hardware.pulseaudio.support32Bit = true;
- hardware.pulseaudio.package = pkgs.pulseaudioFull;
- hardware.bluetooth.enable = true;
- services.logind.lidSwitch = "lock";
- services.logind.lidSwitchDocked = "lock";
- services.fstrim.enable = true;
- services.fstrim.interval = "daily";
- services.avahi.enable = true;
- services.avahi.nssmdns = true;
- services.lorri.enable = true;
- # nixpkgs.overlays = [
- # (import (builtins.fetchGit {
- # url = "https://github.com/nix-community/emacs-overlay.git";
- # ref = "66270257dde436cd434083746ae4a30ca4a870a0";
- # }))
- # ];
- nixpkgs.overlays = [
- (import (builtins.fetchTarball {
- url = https://github.com/nix-community/emacs-overlay/archive/master.tar.gz;
- }))
- ];
- environment.systemPackages = with pkgs; [
- vim
- firefox
- ];
- programs.bash.enableCompletion = true;
- console.keyMap = "us";
- console.font = "Lat2-Terminus16";
- i18n = {
- defaultLocale = "en_US.UTF-8";
- };
- fonts = {
- enableFontDir = true;
- enableGhostscriptFonts = true;
- fonts = with pkgs; [
- inconsolata # monospaced
- ubuntu_font_family # Ubuntu fonts
- unifont # some international languages
- corefonts
- mononoki
- victor-mono
- ankacoder
- ankacoder-condensed
- terminus_font
- terminus_font_ttf
- ];
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement