changed structure

dev-docs
Moritz Böhme 2021-09-05 17:01:40 +02:00
parent 35c3aa63e5
commit abde473aa6
7 changed files with 314 additions and 0 deletions

4
apply-system.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
pushd ~/.dotfiles
sudo nixos-rebuild switch -I nixos-config=./system/configuration.nix
popd

4
apply-users.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
pushd ~/.dotfiles
home-manager switch -f ./users/moritz/home.nix
popd

98
system/configuration.nix Normal file
View File

@ -0,0 +1,98 @@
# 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
];
# BOOT
boot.supportedFilesystems = [ "btrfs" ];
boot.loader = {
grub = {
enable = true;
version = 2;
device = "nodev";
efiSupport = true;
};
efi.canTouchEfiVariables = true;
};
# NETWORKING
networking = {
hostName = "nixos";
networkmanager.enable = true;
useDHCP = false;
interfaces.wlp1s0.useDHCP = true;
};
# LOCALS
i18n.defaultLocale = "en_US.UTF-8";
console = {
font = "firacode-14";
keyMap = "de";
};
time.timeZone = "Europe/Berlin";
# SERVICES
services = {
xserver = {
enable = true;
layout = "de";
displayManager = {
defaultSession = "none+bspwm";
autoLogin = {
enable = true;
user = "moritz";
};
lightdm = {
enable = true;
};
};
windowManager.bspwm.enable = true;
};
printing.enable = true;
};
# HOMEMANAGER
# Enable sound.
sound.enable = true;
hardware.pulseaudio.enable = true;
# USERS
users.users.moritz = {
shell = pkgs.zsh;
isNormalUser = true;
home = "/home/moritz";
extraGroups = [ "wheel" "networkmanager" "video" ]; # Enable sudo for the user.
};
fonts.fonts = with pkgs; [
(nerdfonts.override { fonts = [ "FiraCode" "DroidSansMono" ];})
];
# PACKAGES
environment.systemPackages = with pkgs; [
vim
wget
firefox
];
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "21.05"; # Did you read the comment?
}

View File

@ -0,0 +1,58 @@
# 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, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/4a91d3eb-1633-42d9-8304-c10e49a61154";
fsType = "btrfs";
options = [ "subvol=root" ];
};
boot.initrd.luks.devices."enc".device = "/dev/disk/by-uuid/078b81ba-238e-471d-9951-b743588532b8";
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/4a91d3eb-1633-42d9-8304-c10e49a61154";
fsType = "btrfs";
options = [ "subvol=home" ];
};
fileSystems."/nix" =
{ device = "/dev/disk/by-uuid/4a91d3eb-1633-42d9-8304-c10e49a61154";
fsType = "btrfs";
options = [ "subvol=nix" ];
};
fileSystems."/persist" =
{ device = "/dev/disk/by-uuid/4a91d3eb-1633-42d9-8304-c10e49a61154";
fsType = "btrfs";
options = [ "subvol=persist" ];
};
fileSystems."/log" =
{ device = "/dev/disk/by-uuid/4a91d3eb-1633-42d9-8304-c10e49a61154";
fsType = "btrfs";
options = [ "subvol=log" ];
neededForBoot = true;
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/938D-F813";
fsType = "vfat";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/29ebf65f-e6ca-4625-9f72-a9321152be1b"; }
];
}

2
update-system.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
sudo nix-channel --update

2
update-users.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
nix-channel --update

146
users/moritz/home.nix Normal file
View File

@ -0,0 +1,146 @@
{ config, pkgs, ... }:
{
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
# paths it should manage.
home.username = "moritz";
home.homeDirectory = "/home/moritz";
programs.git = {
enable = true;
userName = "MoritzBoehme";
userEmail = "mr.x@moritzboeh.me";
};
# Zathura
programs.zathura = {
enable = true;
options = {
recolor = true;
completion-bg = "#282a36";
completion-fg = "#ff79c6";
default-bg = "#44475a";
default-fg = "#bd93f9";
inputbar-bg = "#282a36";
inputbar-fg = "#8be9fd";
statusbar-bg = "#282a36";
statusbar-fg = "#bd93f9";
font = "Jetbrains Mono 9";
recolor-lightcolor = "#282a36";
recolor-darkcolor = "#f8f8f2";
};
};
# Zsh
programs.zsh = {
enable = true;
shellGlobalAliases = {
ls = "exa -lh";
cat = "bat";
};
plugins = [
{
name = "zsh-autosuggestions";
src = pkgs.fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-autosuggestions";
rev = "v0.4.0";
sha256 = "0z6i9wjjklb4lvr7zjhbphibsyx51psv50gm07mbb0kj9058j6kc";
};
}
{
name = "zsh-syntax-highlighting";
src = pkgs.fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-syntax-highlighting";
rev = "0e1bb14452e3fc66dcc81531212e1061e02c1a61";
sha256 = "09ncmyqlk9a3h470z0wgbkrznb5zyc9dj96011wm89rdxc1irxk2";
};
}
];
};
# Kitty
programs.kitty = {
enable = true;
settings = {
scrollback_lines = 10000;
enable_audio_bell = false;
cursor_shape = "underline";
};
extraConfig = builtins.readFile ~/.dotfiles/config/kitty/dracula.conf;
font = {
name = "FiraCode Nerd Font";
size = 10;
};
};
programs.exa.enable = true;
programs.bat.enable = true;
programs.starship = {
enable = true;
enableZshIntegration = true;
};
services.polybar = {
enable = true;
script = ''
# Terminate already running bar instances
killall -q polybar
# Wait until the processes have been shut down
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
while ! pgrep -x bspwm >/dev/null; do sleep 1; done
# Launch Polybar
for m in $(polybar --list-monitors | cut -d":" -f1); do
MONITOR=$m polybar --reload bottom &
done
'';
config = {
"bar/bottom" = {
monitor = "\${env:MONITOR}";
bottom = true;
fixed-center = true;
width = "100%";
height = 25;
background = "\${color.background-alt}";
foreground = "\${color.foreground}";
line-size = 3;
border-size = 0;
padding-left = 1;
padding-right = 1;
module-margin-left = 3;
module-margin-right = 3;
font-0 = "NotoSans Nerd Font:size=11;0";
modules-left = "cpu memory wlan eth battery";
modules-center = "bspwm";
modules-right = "pulseaudio date powermenu";
tray-position = "right";
tray-background = "\${color.background-alt}";
tray-padding = 2;
wm-restack = "bspwm";
cursor-click = "pointer";
};
};
};
home.packages = with pkgs; [
neofetch
];
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "21.05";
}