From e20fd36a84618017615c54c84760dc8a971b938b Mon Sep 17 00:00:00 2001 From: stubbfel Date: Thu, 15 Feb 2018 20:33:05 +0100 Subject: [PATCH] init --- .gitignore | 2 ++ boot.nix | 10 ++++++++++ configuration.nix | 33 +++++++++++++++++++++++++++++++++ desktop.nix | 16 ++++++++++++++++ i18n.nix | 12 ++++++++++++ network.nix | 5 +++++ programs/devel_progs.nix | 9 +++++++++ programs/installed.nix | 13 +++++++++++++ programs/zsh.nix | 14 ++++++++++++++ services/enabled.nix | 8 ++++++++ services/sshd.nix | 6 ++++++ setup.nix | 6 ++++++ users.nix | 13 +++++++++++++ 13 files changed, 147 insertions(+) create mode 100644 .gitignore create mode 100644 boot.nix create mode 100644 configuration.nix create mode 100644 desktop.nix create mode 100644 i18n.nix create mode 100644 network.nix create mode 100644 programs/devel_progs.nix create mode 100644 programs/installed.nix create mode 100644 programs/zsh.nix create mode 100644 services/enabled.nix create mode 100644 services/sshd.nix create mode 100644 setup.nix create mode 100644 users.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..714ca05 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +hardware-configuration.nix +result diff --git a/boot.nix b/boot.nix new file mode 100644 index 0000000..552d323 --- /dev/null +++ b/boot.nix @@ -0,0 +1,10 @@ +{ config, pkgs, ... }: + +{ + # Use the GRUB 2 boot loader. + boot.loader.grub = { + enable = true; + version = 2; + device = "/dev/sda"; + }; +} diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..523da4c --- /dev/null +++ b/configuration.nix @@ -0,0 +1,33 @@ +# 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 = + [ + ./hardware-configuration.nix + ./boot.nix + ./i18n.nix + ./network.nix + ./programs/installed.nix + ./services/enabled.nix + ./users.nix + ./desktop.nix + ./setup.nix + ]; + + nixpkgs.config.allowUnfree = true; + nix.gc.automatic = true; + nix.gc.dates = "03:15"; + + # This value determines the NixOS release with which your system is to be + # compatible, in order to avoid breaking some software such as database + # servers. You should change this only after NixOS release notes say you + # should. + system = { + stateVersion = "17.09"; # Did you read the comment? + autoUpgrade.enable = true; + }; +} diff --git a/desktop.nix b/desktop.nix new file mode 100644 index 0000000..c617e15 --- /dev/null +++ b/desktop.nix @@ -0,0 +1,16 @@ +{ config, pkgs, ... }: + +{ + services.xserver.enable = true; + services.xserver.displayManager.lightdm = { + enable = true; + autoLogin = { + enable = true; + user = "devel"; + }; + }; + services.xserver.desktopManager = { + xfce.enable = true; + default = "xfce"; + }; +} diff --git a/i18n.nix b/i18n.nix new file mode 100644 index 0000000..ea31ed4 --- /dev/null +++ b/i18n.nix @@ -0,0 +1,12 @@ +{ config, pkgs, ... }: + +{ + # Select internationalisation properties. + i18n = { + consoleKeyMap = "de"; + defaultLocale = "de_DE.UTF-8"; + }; + + # Set your time zone. + time.timeZone = "Europe/Amsterdam"; +} diff --git a/network.nix b/network.nix new file mode 100644 index 0000000..091e7aa --- /dev/null +++ b/network.nix @@ -0,0 +1,5 @@ +{ config, pkgs, ... }: + +{ + networking.hostName = "develnix"; +} diff --git a/programs/devel_progs.nix b/programs/devel_progs.nix new file mode 100644 index 0000000..f7bb401 --- /dev/null +++ b/programs/devel_progs.nix @@ -0,0 +1,9 @@ +{ config, pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ + firefox gitAndTools.gitFull git-cola git-crecord gitAndTools.git-extras git-lfs + gitAndTools.gitflow zsh-git-prompt cmakeWithGui qtcreator codeblocksFull eclipses.eclipse-cpp eclipses.eclipse-sdk clang gcc + gcc_multi automake atom kmod linuxHeaders linuxPackages.kernel.dev linuxPackages.kernel tilix tmux screen bash + ]; +} diff --git a/programs/installed.nix b/programs/installed.nix new file mode 100644 index 0000000..fc6f0a9 --- /dev/null +++ b/programs/installed.nix @@ -0,0 +1,13 @@ +{ config, pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ + wget curl vim nano zsh fzf + ]; + + imports = + [ + ./zsh.nix + ./devel_progs.nix + ]; +} diff --git a/programs/zsh.nix b/programs/zsh.nix new file mode 100644 index 0000000..7cf7947 --- /dev/null +++ b/programs/zsh.nix @@ -0,0 +1,14 @@ +{ config, pkgs, ... }: + +{ + programs.zsh = { + ohMyZsh = { + enable = true; + plugins = ["git" "git-extras" "git-flow"]; + }; + enable = true; + enableAutosuggestions = true; + enableCompletion = true; + syntaxHighlighting.enable = true; + }; +} diff --git a/services/enabled.nix b/services/enabled.nix new file mode 100644 index 0000000..73ef3e1 --- /dev/null +++ b/services/enabled.nix @@ -0,0 +1,8 @@ +{ config, pkgs, ... }: + +{ + imports = + [ + ./sshd.nix + ]; +} diff --git a/services/sshd.nix b/services/sshd.nix new file mode 100644 index 0000000..8b6f631 --- /dev/null +++ b/services/sshd.nix @@ -0,0 +1,6 @@ +{ config, pkgs, ... }: + +{ + services.openssh.forwardX11 = true; + services.openssh.enable = true; +} diff --git a/setup.nix b/setup.nix new file mode 100644 index 0000000..5ece109 --- /dev/null +++ b/setup.nix @@ -0,0 +1,6 @@ +{ config, pkgs, ... }: + +{ + services.openssh.permitRootLogin = "yes"; + environment.systemPackages = [pkgs.nix-repl]; +} diff --git a/users.nix b/users.nix new file mode 100644 index 0000000..921829c --- /dev/null +++ b/users.nix @@ -0,0 +1,13 @@ +{ config, pkgs, ... }: + +let +myPublicSshKeys = {openssh.authorizedKeys.keys = ["ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKShnz3ceVcg3axVXv/GGcjyFAfcjuDR1i5o6JzVvnmlWpWvClnYSBNb/oEDDq5pSPSBvCYp2HwZpmkYEV/C3lBbUsmLtOlUrzkm0ibgHraTVyHUq3OSYckXEvUYRCCtGqvRRehERrhPZV6oXBE8aBUk26xTpOJpLFPy7spF4sBwKPSE2igTIYtJSfJYi3wn2KoW1q1RLMasC4fdvgNCVIxxBq72uMcRUcPc4jL8n11UFfepJrwSQ7Z7KxsZXdz5JFVl6QEE6cVSSEAuuEefNYANrp5S3h/lUowrUOcu0ml2c7CJWPpaOb4GvFlio4woc0lCATrA2341V0xshl40Xd dev@stubbfe"];}; +in +{ + security.sudo.enable = true; + security.sudo.wheelNeedsPassword = false; + users = { + defaultUserShell = pkgs.zsh; + extraUsers.devel = myPublicSshKeys // { isNormalUser = true; home = "/home/devel"; extraGroups = [ "wheel"]; password = "devel";}; + }; +}