This commit is contained in:
foosinn 2020-06-11 19:13:58 +02:00
commit 8c98e8bd14
10 changed files with 633 additions and 0 deletions

67
roles/base.nix Normal file
View file

@ -0,0 +1,67 @@
# 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, ... }:
{
environment.systemPackages = with pkgs; [
bash
bat
emacs-nox
fd
fzf
git
htop
jq
ripgrep
z-lua
# (import ../packages/vim.nix)
(import ../packages/neovim.nix)
];
programs.bash = {
interactiveShellInit = ''
pw () {
len=''${1:-$(( $RANDOM % 24 + 8 ))}
tr -dc a-zA-Z0-9 < /dev/urandom | head -c $len
echo
}
cdg() {
gitroot=$(until [ -d .git ]; do [ "$PWD" == "/" ] && exit 1; cd ..; done; echo $PWD)
if [ $? == 0 ]; then
cd $gitroot
else
echo "gitroot not found."
return 1
fi
}
git_branch(){
branch=$(git branch 2> /dev/null) || exit 0
branch=$(sed -n '/^*/ s/* \(.*\)/\1/p' <<< $branch)
status=$(git status 2> /dev/null \
| grep -q "nothing to commit, working tree clean" || e cho -n '*')
echo "$branch$status "
}
. "$(fzf-share)/key-bindings.bash"
. "$(fzf-share)/completion.bash"
eval $(z --init bash)
'';
shellAliases = {
cat = "bat -pp";
less = "bat -p";
ls = "ls --color=auto";
vim = "nvim";
};
};
users.users.stefan = {
extraGroups = [ "wheel" ];
home = "/home/stefan";
isNormalUser = true;
uid = 1000;
};
}

75
roles/desktop.nix Normal file
View file

@ -0,0 +1,75 @@
# 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, ... }:
{
programs.sway = {
enable = true;
extraPackages = with pkgs; [
bemenu
grim
i3status-rust
kanshi
mako
slurp
swayidle
swaylock
];
};
environment = {
etc = {
"sway/config".source = ../dotfiles/sway/config;
"sway/status.toml".source = ../dotfiles/sway/status.toml;
};
};
sound.enable = true;
hardware.pulseaudio.enable = true;
fonts.enableDefaultFonts = true;
fonts.fontconfig.antialias = true;
fonts.fonts = with pkgs; [
cascadia-code
font-awesome
noto-fonts
noto-fonts-emoji
];
environment.systemPackages = with pkgs; [
alacritty
firefox
keepassxc
neofetch
pulseaudio
pulsemixer
(
pkgs.writeTextFile {
name = "startsway";
destination = "/bin/startsway";
executable = true;
text = ''
#! ${pkgs.bash}/bin/bash
export MOZ_ENABLE_WAYLAND=1
export QT_QPA_PLATFORM=wayland-egl
export QT_WAYLAND_FORCE_DPI=physical
export SDL_VIDEODRIVER=wayland
export _JAVA_AWT_WM_NOREPARENTING=1
exec ${pkgs.dbus}/bin/dbus-run-session ${pkgs.sway}/bin/sway
'';
}
)
];
services.syncthing = {
enable = true;
openDefaultPorts = true;
user = "stefan";
group = "users";
dataDir = "/home/stefan";
};
services.printing.enable = true;
}

21
roles/dev.nix Normal file
View file

@ -0,0 +1,21 @@
# 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, ... }:
let
unstable = import <nixos-unstable> {};
mozilla_overlay = import <mozilla> {};
in {
environment.systemPackages = with pkgs; [
go
python37
python37Packages.pyls-black
python37Packages.pyls-isort
python37Packages.pyls-mypy
rustup
unstable.gopls
unstable.rust-analyzer
];
}