From 76a7a31ef6917f0b84f745116d095ff72014c8e7 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Tue, 4 Apr 2023 21:41:44 +0200 Subject: [PATCH] split files --- configuration.nix => common.nix | 125 +----------------- home.nix | 125 ++++++++++++++++++ ... => vinzenz-lpt-hardware-configuration.nix | 1 - vinzenz-lpt.nix | 8 ++ 4 files changed, 136 insertions(+), 123 deletions(-) rename configuration.nix => common.nix (60%) create mode 100644 home.nix rename hardware-configuration.nix => vinzenz-lpt-hardware-configuration.nix (99%) create mode 100644 vinzenz-lpt.nix diff --git a/configuration.nix b/common.nix similarity index 60% rename from configuration.nix rename to common.nix index 4e634e6..0e03e65 100644 --- a/configuration.nix +++ b/common.nix @@ -1,15 +1,12 @@ -# 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 # enable home manager + ./home.nix ]; nixpkgs.config = { @@ -34,8 +31,8 @@ }; }; + networking = { - hostName = "vinzenz-lpt"; # wireless.enable = true; # Enables wireless support via wpa_supplicant. # Configure network proxy if necessary @@ -62,6 +59,7 @@ }; }; + time.timeZone = "Europe/Berlin"; i18n = { @@ -183,121 +181,4 @@ pkgs.gnome-connections ]; }; - - # Define user account - users.users.vinzenz = { - isNormalUser = true; - description = "Vinzenz Schroeter"; - extraGroups = ["networkmanager" "wheel"]; - shell = pkgs.zsh; - # openssh.authorizedKeys.keys = [ "ssh-dss AAAAB3NzaC1kc3MAAACBAPIkGWVEt4..." ]; - }; - - # home manager - home-manager.useUserPackages = true; - home-manager.useGlobalPkgs = true; - home-manager.users.vinzenz = { - config, - pkgs, - ... - }: { - #imports = [ "${builtins.fetchTarball https://github.com/schuelermine/xhmm/archive/1608fa757cbd8fb4f11435a50610e44de3fc2223.tar.gz}/console/nano.nix" ]; - - home = { - username = "vinzenz"; - homeDirectory = "/home/vinzenz"; - stateVersion = "22.11"; - #editor = "nano"; - - sessionVariables = { - EDITOR = "nano"; - }; - - packages = with pkgs; [ - firefox - htop - btop - iotop - radeontop - powerline - powerline-fonts - thefuck - keepassxc - steam - wine-staging - nix-zsh-completions - tldr - my.insync-v3 - jetbrains.rider - alejandra - gnome-secrets - amberol - dotnet-sdk_7 - # gnome workbench - tdesktop - lutris - ]; - - file.".nanorc".text = '' - set linenumbers - set mouse - ''; - }; - - services = { - kdeconnect = { - enable = true; - indicator = true; - }; - }; - - programs = { - home-manager.enable = true; - zsh = { - enable = true; - shellAliases = { - my-update = "sudo nixos-rebuild switch"; - my-config = "sudo nano /etc/nixos/configuration.nix"; - my-fmt = "sudo alejandra /etc/nixos/configuration.nix"; - }; - history = { - size = 10000; - path = "${config.xdg.dataHome}/zsh/history"; - }; - oh-my-zsh = { - enable = true; - theme = "agnoster"; - plugins = ["git" "sudo" "docker" "systemadmin" "thefuck" "nix-zsh-completions"]; - }; - }; - - git = { - enable = true; - userName = "Vinzenz Schroeter"; - userEmail = "vinzenz.f.s@gmail.com"; - - #package = pkgs.gitFull; - #config.credential.helper = "libsecret"; - - aliases = { - prettylog = "log --pretty=oneline --graph"; - }; - extraConfig = { - pull = { - ff = "only"; - }; - init = { - defaultBranch = "main"; - }; - }; - }; - - vscode = { - enable = true; - package = pkgs.vscodium; - enableUpdateCheck = false; - extensions = [pkgs.vscode-extensions.bbenoist.nix]; - }; - }; - }; } diff --git a/home.nix b/home.nix new file mode 100644 index 0000000..53ca13b --- /dev/null +++ b/home.nix @@ -0,0 +1,125 @@ +{ + config, + pkgs, + ... +}: { + # Define user account + users.users.vinzenz = { + isNormalUser = true; + description = "Vinzenz Schroeter"; + extraGroups = ["networkmanager" "wheel"]; + shell = pkgs.zsh; + # openssh.authorizedKeys.keys = [ "ssh-dss AAAAB3NzaC1kc3MAAACBAPIkGWVEt4..." ]; + }; + + # home manager + home-manager.useUserPackages = true; + home-manager.useGlobalPkgs = true; + home-manager.users.vinzenz = { + config, + pkgs, + ... + }: { + #imports = [ "${builtins.fetchTarball https://github.com/schuelermine/xhmm/archive/1608fa757cbd8fb4f11435a50610e44de3fc2223.tar.gz}/console/nano.nix" ]; + + home = { + username = "vinzenz"; + homeDirectory = "/home/vinzenz"; + stateVersion = "22.11"; + #editor = "nano"; + + sessionVariables = { + EDITOR = "nano"; + }; + + packages = with pkgs; [ + firefox + htop + btop + iotop + radeontop + powerline + powerline-fonts + thefuck + keepassxc + steam + wine-staging + nix-zsh-completions + tldr + my.insync-v3 + jetbrains.rider + alejandra + gnome-secrets + amberol + dotnet-sdk_7 + # gnome workbench + tdesktop + lutris + ]; + + file.".nanorc".text = '' + set linenumbers + set mouse + ''; + }; + + services = { + kdeconnect = { + enable = true; + indicator = true; + }; + }; + + programs = { + home-manager.enable = true; + zsh = { + enable = true; + shellAliases = { + my-update = "sudo nixos-rebuild switch"; + my-config = "sudo nano /etc/nixos/configuration.nix"; + my-fmt = "sudo alejandra /etc/nixos/configuration.nix"; + }; + history = { + size = 10000; + path = "${config.xdg.dataHome}/zsh/history"; + }; + oh-my-zsh = { + enable = true; + theme = "agnoster"; + plugins = ["git" "sudo" "docker" "systemadmin" "thefuck" "nix-zsh-completions"]; + }; + }; + + git = { + enable = true; + userName = "Vinzenz Schroeter"; + userEmail = "vinzenz.f.s@gmail.com"; + + #package = pkgs.gitFull; + #config.credential.helper = "libsecret"; + + aliases = { + prettylog = "log --pretty=oneline --graph"; + }; + extraConfig = { + pull = { + ff = "only"; + }; + init = { + defaultBranch = "main"; + }; + }; + }; + + vscode = { + enable = true; + package = pkgs.vscodium; + enableUpdateCheck = false; + extensions = [pkgs.vscode-extensions.bbenoist.nix]; + userSettings = { + "files.insertFinalNewline" = true; + }; + }; + }; + }; +} diff --git a/hardware-configuration.nix b/vinzenz-lpt-hardware-configuration.nix similarity index 99% rename from hardware-configuration.nix rename to vinzenz-lpt-hardware-configuration.nix index 95a5f1b..79643cb 100644 --- a/hardware-configuration.nix +++ b/vinzenz-lpt-hardware-configuration.nix @@ -2,7 +2,6 @@ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. { config, lib, pkgs, modulesPath, ... }: - { imports = [ (modulesPath + "/installer/scan/not-detected.nix") diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix new file mode 100644 index 0000000..2ad0e9d --- /dev/null +++ b/vinzenz-lpt.nix @@ -0,0 +1,8 @@ +{...}: { + networking.hostName = "vinzenz-lpt"; + + imports = [ + ./common.nix + ./vinzenz-lpt-hardware-configuration.nix + ]; +}