From 6a6779a869d51fcd9768cf600d29e3575b1d2ef3 Mon Sep 17 00:00:00 2001 From: Valentin Boettcher Date: Sun, 4 Mar 2018 11:51:02 +0100 Subject: [PATCH] first commit --- #hardware-configuration.nix# | 26 ++++++++ .#hardware-configuration.nix | 1 + .gitignore | 3 + README.md | 1 + compton.nix | 89 +++++++++++++++++++++++++++ configuration.nix | 65 ++++++++++++++++++++ packages.nix | 113 +++++++++++++++++++++++++++++++++++ services.nix | 37 ++++++++++++ 8 files changed, 335 insertions(+) create mode 100644 #hardware-configuration.nix# create mode 120000 .#hardware-configuration.nix create mode 100644 .gitignore create mode 100644 README.md create mode 100644 compton.nix create mode 100644 configuration.nix create mode 100644 packages.nix create mode 100644 services.nix diff --git a/#hardware-configuration.nix# b/#hardware-configuration.nix# new file mode 100644 index 0000000..705aa96 --- /dev/null +++ b/#hardware-configuration.nix# @@ -0,0 +1,26 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ config, lib, pkgs, ... }: + +{ + imports = + [ + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usb_storage" "sd_mod" ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/sda2"; + fsType = "bcachefs"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/f0e6d651-4cb6-4595-aa92-5793958f92c2"; } + ]; + + nix.maxJobs = lib.mkDefault 4; + powerManagement.cpuFreqGovernor = "powersave"; +} diff --git a/.#hardware-configuration.nix b/.#hardware-configuration.nix new file mode 120000 index 0000000..1f0d153 --- /dev/null +++ b/.#hardware-configuration.nix @@ -0,0 +1 @@ +root@nixos.13812:1520099551 \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fc19693 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +hardware-configuration.nix +#* +*~ diff --git a/README.md b/README.md new file mode 100644 index 0000000..8ff198a --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# nixconf diff --git a/compton.nix b/compton.nix new file mode 100644 index 0000000..b76fa96 --- /dev/null +++ b/compton.nix @@ -0,0 +1,89 @@ +{ config, pkgs, ...}: + +{ + services.compton = { + enable = true; + extraOptions = '' + backend = "glx"; + vsync = "opengl-swc"; + + shadow = true; + no-dock-shadow = true; + no-dnd-shadow = true; + clear-shadow = true; + + shadow-radius = 10; + shadow-offset-x = -5; + shadow-offset-y = 0; + shadow-opacity = 0.8; + shadow-red = 0.11; + shadow-green = 0.12; + shadow-blue = 0.13; + shadow-exclude = [ + "name = 'Notification'", + "_GTK_FRAME_EXTENTS@:c", + "class_g = 'i3-frame'", + "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'", + "_NET_WM_STATE@:32a *= '_NET_WM_STATE_STICKY'", + "!I3_FLOATING_WINDOW@:c" + ]; + shadow-ignore-shaped = true; + + alpha-step = 0.06; + blur-background = false; + blur-background-fixed = true; + blur-kern = "7x7box"; + blur-background-exclude = [ + "class_g = 'i3-frame'", + "window_type = 'dock'", + "window_type = 'desktop'", + "_GTK_FRAME_EXTENTS@:c" + ]; + + # Duplicating the _NET_WM_STATE entries because compton cannot deal with atom arrays :-/ + opacity-rule = [ + "97:class_g = 'Termite' && !_NET_WM_STATE@:32a", + + "0:_NET_WM_STATE@[0]:32a = '_NET_WM_STATE_HIDDEN'", + "0:_NET_WM_STATE@[1]:32a = '_NET_WM_STATE_HIDDEN'", + "0:_NET_WM_STATE@[2]:32a = '_NET_WM_STATE_HIDDEN'", + "0:_NET_WM_STATE@[3]:32a = '_NET_WM_STATE_HIDDEN'", + "0:_NET_WM_STATE@[4]:32a = '_NET_WM_STATE_HIDDEN'", + + "90:_NET_WM_STATE@[0]:32a = '_NET_WM_STATE_STICKY'", + "90:_NET_WM_STATE@[1]:32a = '_NET_WM_STATE_STICKY'", + "90:_NET_WM_STATE@[2]:32a = '_NET_WM_STATE_STICKY'", + "90:_NET_WM_STATE@[3]:32a = '_NET_WM_STATE_STICKY'", + "90:_NET_WM_STATE@[4]:32a = '_NET_WM_STATE_STICKY'" + ]; + + fading = false; + fade-delta = 7; + fade-in-step = 0.05; + fade-out-step = 0.05; + fade-exclude = []; + + mark-wmwin-focused = true; + mark-ovredir-focused = true; + use-ewmh-active-win = true; + detect-rounded-corners = true; + detect-client-opacity = true; + refresh-rate = 0; + dbe = false; + paint-on-overlay = true; + glx-no-stencil = true; + glx-copy-from-front = false; + glx-swap-method = "undefined"; + sw-opti = true; + unredir-if-possible = false; + focus-exclude = []; + detect-transient = true; + detect-client-leader = true; + invert-color-include = []; + + wintypes: { + tooltip = { fade = true; shadow = false; opacity = 1.00; focus = true; }; + }; + ''; + }; +} diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..e3033f4 --- /dev/null +++ b/configuration.nix @@ -0,0 +1,65 @@ +{ config, pkgs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + (import ./packages.nix {inherit config pkgs; }) + (import ./services.nix {inherit config pkgs; }) + ]; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # Enable BCACHEFS + boot.supportedFilesystems = [ "bcachefs" ]; + + # Set your time zone. + time.timeZone = "Europe/Berlin"; + + # Networking + networking.networkmanager.enable = true; + + # Fish + programs.fish.enable = true; + + # Users + users.mutableUsers = false; + users.extraUsers.hiro = { + isNormalUser = true; + home = "/home/hiro"; + shell = pkgs.fish; + extraGroups = ["networkmanager" "wheel" "audio"]; + hashedPassword = "$6$WDVgnDUHXXHm$JGkoT5VU7GAxd9Z34N1bfGF79rnB.P2t.DdSpJ.a3bwipfFFsGD2z13yRKmp3H4PuBdcY.B1i7cyGmEyv3Q.r/"; + }; + + # Getting OOMOX to work + environment.extraInit = '' + # SVG loader for pixbuf (needed for GTK svg icon themes) + export GDK_PIXBUF_MODULE_FILE=$(echo ${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/*/loaders.cache) + ''; + + # No Sudo Password + security.sudo.wheelNeedsPassword = false; + + # Audio + hardware.pulseaudio.enable = true; + + # Microcode + hardware.cpu.intel.updateMicrocode = true; + + # Garbage Collector + nix.gc.automatic = true; + nix.gc.dates = "weekly"; + nix.gc.options = "--delete-older-than 30d"; + + # Power Management + powerManagement.enable = true; + powerManagement.powertop.enable = true; + powerManagement.scsiLinkPolicy = "min_power"; + + # Auto Upgrades + system.autoUpgrade.enable = true; + system.autoUpgrade.channel = https://nixos.org/channels/nixos-unstable; +} diff --git a/packages.nix b/packages.nix new file mode 100644 index 0000000..e501767 --- /dev/null +++ b/packages.nix @@ -0,0 +1,113 @@ +{ config, pkgs, ...}: + +let + nixcfg = { + allowUnfree = true; + }; + + stable = import (fetchTarball https://github.com/nixos/nixpkgs-channels/archive/nixos-17.09.tar.gz) { config = nixcfg; }; + rolling = import (fetchTarball https://github.com/nixos/nixpkgs-channels/archive/nixos-unstable.tar.gz) { config = nixcfg; }; + edge = import (fetchTarball https://github.com/NixOS/nixpkgs/archive/master.tar.gz) { config = nixcfg; }; + pkgs = stable; + + base = (with stable; [ + file + curl + wget + fish + networkmanager + dbus + xclip + xst + git + busybox + ]) ++ (with rolling; [ + firefox + thunderbird + pcmanfm + google-play-music-desktop-player + file + i3status-rust + ]); + + extra = (with rolling; [ + # oomox + gdk_pixbuf + glib.dev + gtk-engine-murrine + gtk_engines + gtk3 + sassc + librsvg + bc + + compton + firefox + gimp + pcmanfm + emacs + evince + + feh + rofi + ]); + + games = (with stable; [ + xonotic + ]) ++ (with edge; [ + steam + ]); + + development = (with stable; [ + cargo + autoconf + automake + boot + cmake + gcc + ghc + gnumake + rustc + rustfmt + rustracer + sqlite + zeal + ]) ++ (with rolling; [ + python3 + ]); + + basefonts = (with pkgs; [ + roboto-mono + siji + tewi-font + ]); + + extrafonts = (with pkgs; [ + corefonts + dejavu_fonts + fantasque-sans-mono + fira + fira-code + font-awesome-ttf + font-droid + noto-fonts + powerline-fonts + roboto + roboto-slab + source-code-pro + ]); + +in +{ + environment.systemPackages = + base ++ + extra ++ + development ++ + games ++ + []; + + fonts.fonts = + basefonts ++ + extrafonts ++ + []; +} diff --git a/services.nix b/services.nix new file mode 100644 index 0000000..51d9930 --- /dev/null +++ b/services.nix @@ -0,0 +1,37 @@ +{ config, pkgs, ...}: + +{ + imports = [ + (import ./compton.nix {inherit config pkgs; }) + ]; + + services = { + xserver = { + enable = true; + layout = "us"; + + libinput = { + enable = true; + }; + + displayManager.sddm.enable = true; + + windowManager = { + i3.enable = true; + default = "i3"; + }; + }; + + printing = { + enable = true; + drivers = (with pkgs; [ gutenprint splix ]); + }; + + acpid.enable = true; + emacs.enable = true; + # todo : look into conf of ssh. + #openssh.enable = true; + }; + + +}