From b644d30f65ed94388a9359bfc33d0a4abea75a40 Mon Sep 17 00:00:00 2001 From: Gabriel Ebner Date: Thu, 21 May 2015 16:13:47 +0200 Subject: [PATCH] Refactoring common parts. --- archachatina.nix | 175 +---------------------------------------------- common.nix | 122 +++++++++++++++++++++++++++++++++ gnome3.nix | 36 ++++++++++ theba.nix | 160 +------------------------------------------ uefi.nix | 9 +++ 5 files changed, 173 insertions(+), 329 deletions(-) create mode 100644 common.nix create mode 100644 gnome3.nix create mode 100644 uefi.nix diff --git a/archachatina.nix b/archachatina.nix index 3d0c323..8629b42 100644 --- a/archachatina.nix +++ b/archachatina.nix @@ -1,184 +1,15 @@ -# 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 + [ + ./common.nix + ./uefi.nix ]; - # Use the gummiboot efi boot loader. - boot.loader.gummiboot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - boot.initrd.luks.devices = [ { name = "sda2_crypt"; device = "/dev/disk/by-uuid/663dcfda-081e-40d5-9ba4-62ad73dc5098"; preLVM = true; } ]; - boot.initrd.kernelModules = [ "fbcon" ]; - - boot.kernelPackages = pkgs.linuxPackages_latest; networking.hostName = "archachatina"; # Define your hostname. networking.hostId = "cc7ea3ba"; - # nix.binaryCaches = [ https://hydra.nixos.org https://cache.nixos.org http://hydra.cryp.to/ ]; - # nix.trustedBinaryCaches = [ https://hydra.nixos.org https://cache.nixos.org http://hydra.cryp.to/ ]; - nix.binaryCaches = [ https://hydra.nixos.org https://cache.nixos.org ]; - nix.trustedBinaryCaches = [ https://hydra.nixos.org https://cache.nixos.org ]; - - networking.networkmanager.enable = true; - networking.firewall.enable = true; - - # networking.extraHosts = '' - # 127.1.0.80 compile compile.logic.tuwien.ac.at - # ''; - - time.timeZone = "Europe/Vienna"; - - # Select internationalisation properties. - # i18n = { - # consoleFont = "lat9w-16"; - # consoleKeyMap = "us"; - # defaultLocale = "en_US.UTF-8"; - # }; - - programs.ibus.enable = true; - programs.ibus.plugins = [ pkgs.ibus-anthy pkgs.mozc ]; - - environment.systemPackages = with pkgs; with haskellngPackages; [ - stdenv - nox - wget - vim_configurable - zsh - gitFull gitAndTools.hub tig gitg - gnumake - m4 - openjdk8 - # icedtea7_jdk - sbt scala - idea.idea-community - screen - psmisc - firefoxWrapper - thunderbird - gnupg - pass xclip - gcc - # remmina - silver-searcher - tree - python - python34 - python34Packages.ipython - ledger - hledger - hledger-diff - cmake - vimPlugins.YouCompleteMe - gdb - mpv - xlibs.xwininfo # for gnome maximus extension - dstat - which - zip - file - unzip - elinks - ctags - mutt - nix-prefetch-scripts - - #texLiveFull biber - androidsdk_4_4 - gimp - inkscape - # libreoffice - jabref - - # haskell dev - cabal2nix - cabal-install - # ghc-mod - - gnome3.libgweather - ]; - - environment.gnome3.packageSet = pkgs.gnome3_16; - nixpkgs.config.packageOverrides = pkgs: rec { - # gtk3 = pkgs.gtk3_16; - gnome3 = pkgs.gnome3_16; - jre = pkgs.openjdk8; - jdk = pkgs.openjdk8; - # vim_configurable = pkgs.vim_configurable.override { source = "vim-nox"; }; - }; - - fonts = { - fonts = with pkgs; [ - inconsolata - dejavu_fonts - ipafont - unifont - ubuntu_font_family - ]; - }; - - environment.variables.EDITOR = "${pkgs.vim}/bin/vim"; - - # List services that you want to enable: - - # Enable the OpenSSH daemon. - services.openssh = { - enable = true; - permitRootLogin = "no"; - passwordAuthentication = false; - }; - programs.ssh.startAgent = false; - - # Enable CUPS to print documents. - services.avahi.enable = true; # cups browsing support - services.printing.enable = true; - - # Enable the X11 windowing system. - services.xserver.enable = true; - services.xserver.displayManager.gdm.enable = true; - services.xserver.displayManager.desktopManagerHandlesLidAndPower = false; - services.xserver.desktopManager.gnome3.enable = true; - services.xserver.xkbOptions = "ctrl:nocaps"; - # services.xserver.displayManager.lightdm.enable = true; - # services.xserver.desktopManager.kde5.enable = true; - # services.xserver.layout = "us"; - # services.xserver.xkbOptions = "eurosign:e"; - services.dbus.packages = [ pkgs.colord ]; - - # services.jenkins.enable = true; - # services.jenkinsSlave.enable = true; - # services.jenkins.port = 8888; - # services.jenkins.packages = with pkgs; [ stdenv gitFull jdk openssh sbt prover9 minisat veriT bash gnutar gzip ]; - - # TODO: ntp enabled anyhow - # services.timesyncd.enable = true; - - # IntelliJ - boot.kernel.sysctl."fs.inotify.max_user_watches" = 524288; - - fileSystems."/mnt/vaccaria" = { - device = "//vaccaria.mtlaa.gebner.org/export"; - fsType = "cifs"; - options = "x-systemd.automount,credentials=/etc/smbcredentials/vaccaria"; - }; - - fileSystems."/mnt/aruanus" = { - device = "//aruanus.htdf.gebner.org/export"; - fsType = "cifs"; - options = "x-systemd.automount,credentials=/etc/smbcredentials/aruanus"; - }; - - users.extraUsers.gebner = { - isNormalUser = true; - extraGroups = [ "wheel" "networkmanager" ]; - shell = "${pkgs.zsh}/bin/zsh"; - }; - } diff --git a/common.nix b/common.nix new file mode 100644 index 0000000..6487b52 --- /dev/null +++ b/common.nix @@ -0,0 +1,122 @@ +{ config, pkgs, ... }: + +{ + imports = + [ + /etc/nixos/hardware-configuration.nix + ./gnome3.nix + ]; + + boot.kernelPackages = pkgs.linuxPackages_latest; + + nix.binaryCaches = [ https://hydra.nixos.org https://cache.nixos.org ]; + nix.trustedBinaryCaches = [ https://hydra.nixos.org https://cache.nixos.org ]; + + networking.networkmanager.enable = true; + networking.firewall.enable = true; + + time.timeZone = "Europe/Vienna"; + + # Select internationalisation properties. + # i18n = { + # consoleFont = "lat9w-16"; + # consoleKeyMap = "us"; + # defaultLocale = "en_US.UTF-8"; + # }; + + environment.systemPackages = with pkgs; with haskellngPackages; [ + stdenv + nox + wget + vim_configurable + zsh + gitFull gitAndTools.hub tig gitg + gnumake + m4 + openjdk8 + sbt scala + idea.idea-community + screen + psmisc + firefoxWrapper + thunderbird + gnupg + pass xclip + gcc + # remmina + silver-searcher + tree + python + python34 + python34Packages.ipython + ledger + hledger + hledger-diff + cmake + vimPlugins.YouCompleteMe + gdb + mpv + dstat + which + zip + file + unzip + elinks + ctags + mutt + nix-prefetch-scripts + + texLiveFull biber + androidsdk_4_4 + gimp + inkscape + # libreoffice + jabref + + # haskell dev + cabal2nix + cabal-install + # ghc-mod + ]; + + nixpkgs.config.packageOverrides = pkgs: rec { + jre = pkgs.openjdk8; + jdk = pkgs.openjdk8; + }; + + environment.variables.EDITOR = "${pkgs.vim}/bin/vim"; + + # Enable the OpenSSH daemon. + services.openssh = { + enable = true; + permitRootLogin = "no"; + passwordAuthentication = false; + }; + programs.ssh.startAgent = false; + + # Enable CUPS to print documents. + services.avahi.enable = true; # cups browsing support + services.printing.enable = true; + + # IntelliJ + boot.kernel.sysctl."fs.inotify.max_user_watches" = 524288; + + fileSystems."/mnt/vaccaria" = { + device = "//vaccaria.mtlaa.gebner.org/export"; + fsType = "cifs"; + options = "x-systemd.automount,credentials=/etc/smbcredentials/vaccaria"; + }; + + fileSystems."/mnt/aruanus" = { + device = "//aruanus.htdf.gebner.org/export"; + fsType = "cifs"; + options = "x-systemd.automount,credentials=/etc/smbcredentials/aruanus"; + }; + + users.extraUsers.gebner = { + isNormalUser = true; + extraGroups = [ "wheel" "networkmanager" ]; + shell = "${pkgs.zsh}/bin/zsh"; + }; + +} diff --git a/gnome3.nix b/gnome3.nix new file mode 100644 index 0000000..a09b0b8 --- /dev/null +++ b/gnome3.nix @@ -0,0 +1,36 @@ +{ config, pkgs, ... }: + +{ + programs.ibus.enable = true; + programs.ibus.plugins = [ pkgs.ibus-anthy pkgs.mozc ]; + + environment.systemPackages = with pkgs; with haskellngPackages; [ + xlibs.xwininfo # for gnome maximus extension + unzip + gnome3.libgweather + ]; + + environment.gnome3.packageSet = pkgs.gnome3_16; + nixpkgs.config.packageOverrides = pkgs: rec { + gnome3 = pkgs.gnome3_16; + }; + + fonts = { + fonts = with pkgs; [ + inconsolata + dejavu_fonts + ipafont + unifont + ubuntu_font_family + ]; + }; + + services.xserver.enable = true; + services.xserver.displayManager.gdm.enable = true; + services.xserver.displayManager.desktopManagerHandlesLidAndPower = false; + services.xserver.desktopManager.gnome3.enable = true; + services.xserver.layout = "us"; + services.xserver.xkbVariant = "altgr-intl"; + services.xserver.xkbOptions = "caps:ctrl_modifier"; + services.dbus.packages = [ pkgs.colord ]; +} diff --git a/theba.nix b/theba.nix index b3a5378..53477ac 100644 --- a/theba.nix +++ b/theba.nix @@ -1,23 +1,13 @@ -# 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 + [ + ./common.nix + ./uefi.nix ]; - # Use the gummiboot efi boot loader. - boot.loader.gummiboot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - boot.initrd.luks.devices = [ { name = "sda2_crypt"; device = "/dev/disk/by-uuid/a7482f34-1d7b-4181-9f3c-f6bbbdb8679d"; preLVM = true; } ]; - boot.initrd.kernelModules = [ "fbcon" ]; - - boot.kernelPackages = pkgs.linuxPackages_latest; # workaround until trackpad is supported properly boot.extraModprobeConfig = '' @@ -47,148 +37,4 @@ networking.hostName = "theba"; # Define your hostname. networking.hostId = "b29b900f"; - # nix.binaryCaches = [ https://hydra.nixos.org https://cache.nixos.org http://hydra.cryp.to/ ]; - # nix.trustedBinaryCaches = [ https://hydra.nixos.org https://cache.nixos.org http://hydra.cryp.to/ ]; - nix.binaryCaches = [ https://hydra.nixos.org https://cache.nixos.org ]; - nix.trustedBinaryCaches = [ https://hydra.nixos.org https://cache.nixos.org ]; - - networking.networkmanager.enable = true; - networking.firewall.enable = true; - - # networking.extraHosts = '' - # 127.1.0.80 compile compile.logic.tuwien.ac.at - # ''; - - time.timeZone = "Europe/Vienna"; - - # Select internationalisation properties. - # i18n = { - # consoleFont = "lat9w-16"; - # consoleKeyMap = "us"; - # defaultLocale = "en_US.UTF-8"; - # }; - - programs.ibus.enable = true; - programs.ibus.plugins = [ pkgs.ibus-anthy pkgs.mozc ]; - - environment.systemPackages = with pkgs; with haskellngPackages; [ - stdenv - nox - wget - vim_configurable - zsh - gitFull gitAndTools.hub tig gitg - gnumake - m4 - openjdk8 - # icedtea7_jdk - sbt scala - idea.idea-community - screen - psmisc - firefoxWrapper - thunderbird - gnupg - pass xclip - gcc - remmina - silver-searcher - tree - python - python34 - python34Packages.ipython - ledger - hledger - hledger-diff - cmake - vimPlugins.YouCompleteMe - gdb - mpv - xlibs.xwininfo # for gnome maximus extension - dstat - which - zip - file - unzip - elinks - ctags - mutt - nix-prefetch-scripts - - texLiveFull biber - androidsdk_4_4 - gimp - inkscape - # libreoffice - jabref - - # haskell dev - cabal2nix - cabal-install - # ghc-mod - - gnome3.libgweather - ]; - - nixpkgs.config.packageOverrides = pkgs: rec { - # sbt = pkgs.sbt.override { jre = pkgs.openjdk8; }; - jre = pkgs.openjdk8; - jdk = pkgs.openjdk8; - # vim_configurable = pkgs.vim_configurable.override { source = "vim-nox"; }; - }; - - fonts = { - fonts = with pkgs; [ - inconsolata - dejavu_fonts - ipafont - unifont - ubuntu_font_family - ]; - }; - - environment.variables.EDITOR = "${pkgs.vim}/bin/vim"; - - # List services that you want to enable: - - # Enable the OpenSSH daemon. - services.openssh = { - enable = true; - permitRootLogin = "no"; - passwordAuthentication = false; - }; - programs.ssh.startAgent = false; - - # Enable CUPS to print documents. - services.avahi.enable = true; # cups browsing support - services.printing.enable = true; - - # Enable the X11 windowing system. - services.xserver.enable = true; - services.xserver.displayManager.gdm.enable = true; - services.xserver.displayManager.desktopManagerHandlesLidAndPower = false; - services.xserver.desktopManager.gnome3.enable = true; - # services.xserver.displayManager.lightdm.enable = true; - # services.xserver.desktopManager.kde5.enable = true; - # services.xserver.layout = "us"; - # services.xserver.xkbOptions = "eurosign:e"; - services.dbus.packages = [ pkgs.colord ]; - - # services.jenkins.enable = true; - # services.jenkinsSlave.enable = true; - # services.jenkins.port = 8888; - # services.jenkins.packages = with pkgs; [ stdenv gitFull jdk openssh sbt prover9 minisat veriT bash gnutar gzip ]; - - # TODO: ntp enabled anyhow - # services.timesyncd.enable = true; - - # IntelliJ - boot.kernel.sysctl."fs.inotify.max_user_watches" = 524288; - - users.extraUsers.gebner = { - isNormalUser = true; - extraGroups = [ "wheel" "networkmanager" ]; - shell = "${pkgs.zsh}/bin/zsh"; - }; - } diff --git a/uefi.nix b/uefi.nix new file mode 100644 index 0000000..b571644 --- /dev/null +++ b/uefi.nix @@ -0,0 +1,9 @@ +{ config, pkgs, ... }: + +{ + # Use the gummiboot efi boot loader. + boot.loader.gummiboot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + boot.initrd.kernelModules = [ "fbcon" ]; +}