Merge branch 'main' into chore/update-infra-07-23
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
Benjamin Bädorf 2023-07-13 18:16:02 +02:00
commit d909f093b2
No known key found for this signature in database
GPG key ID: 4406E80E13CD656C
20 changed files with 110 additions and 195 deletions

View file

@ -15,6 +15,8 @@ steps:
commands: commands:
- 'echo DEBUG: Using NIX_FLAGS: $NIX_FLAGS' - 'echo DEBUG: Using NIX_FLAGS: $NIX_FLAGS'
- nix $$NIX_FLAGS develop --command nix flake show - nix $$NIX_FLAGS develop --command nix flake show
- nix $$NIX_FLAGS develop --command treefmt --fail-on-change
- nix $$NIX_FLAGS develop --command editorconfig-checker
- nix $$NIX_FLAGS build ".#nixosConfigurations.flora-6.config.system.build.toplevel" - nix $$NIX_FLAGS build ".#nixosConfigurations.flora-6.config.system.build.toplevel"
--- ---
@ -147,6 +149,6 @@ volumes:
--- ---
kind: signature kind: signature
hmac: 5c2b65a2c015f5f11e6d61349693246e3e3c2e88d6aa97d04cb935b13b48b80b hmac: 17811add241edae457584ba78389886df02b5e51820d826ef5fb2d97de2430e2
... ...

View file

@ -15,6 +15,9 @@ end_of_line = unset
insert_final_newline = unset insert_final_newline = unset
trim_trailing_whitespace = unset trim_trailing_whitespace = unset
indent_size = unset indent_size = unset
charset = unset
indent_style = unset
indent_size = unset
[{.*,secrets}/**] [{.*,secrets}/**]
end_of_line = unset end_of_line = unset

33
CONTRIBUTING.md Normal file
View file

@ -0,0 +1,33 @@
# Quick branch overview
We work with several branches in this repo. This document aims to explain how
to contribute changes to the existing branches.
### `main` branch
- Changes to `modules` and `profiles` should go [the main branch](https://git.pub.solar/pub-solar/os/src/branch/main)
- Changes can get accepted via: Pull Request
- Branch protected from direct `git push`
### `infra` branch
- Changes to the [pub.solar](https://pub.solar) infrastructure should be merged [into this branch](https://git.pub.solar/pub-solar/os/src/branch/infra)
- Changes can get accepted via: Pull Request
- Branch protected from direct `git push`
### `momo/main` branch
- Changes to the [Momo](https://momo.koeln) infrastructure should be merged [into this branch](https://git.pub.solar/pub-solar/os/src/branch/momo/main)
- Changes can get accepted via: Pull Request
- Deployment of changes is [automatic via CI pipeline](https://git.pub.solar/pub-solar/os/src/commit/43bd7421509f7cc9ba06d7c740f3f536a4a2af76/.drone.yml#L20-L38)
- Branch protected from direct `git push`
### `$USER` branches
- User's custom hosts and changes can be worked on in these branches
- Direct `git push` possible
- Examples:
- [hensoko](https://git.pub.solar/pub-solar/os/src/branch/hensoko)
- [b12f](https://git.pub.solar/pub-solar/os/src/branch/b12f)
- [axeman](https://git.pub.solar/pub-solar/os/src/branch/axeman)
- [teutat3s](https://git.pub.solar/pub-solar/os/src/branch/teutat3s)

View file

@ -30,11 +30,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1688145780, "lastModified": 1688307440,
"narHash": "sha256-dNUINvO7qM7fItWSeqL2nE/F3IHCGZEeERMkm1i4pP4=", "narHash": "sha256-7PTjbN+/+b799YN7Tk2SS5Vh8A0L3gBo8hmB7Y0VXug=",
"owner": "LnL7", "owner": "LnL7",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "43587cdb726f73b962f12028055520dbd1d7233f", "rev": "b06bab83bdf285ea0ae3c8e145a081eb95959047",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -195,7 +195,7 @@
# profilesOrder = ["system" "direnv"]; # profilesOrder = ["system" "direnv"];
# profiles.direnv = { # profiles.direnv = {
# user = "bartender"; # user = "bartender";
# path = self.channels.nixos.deploy-rs.lib.x86_64-linux.activate.home-manager self.homeConfigurationsPortable.x86_64-linux.bartender; # path = self.pkgs.x86_64-linux.nixos.deploy-rs.lib.x86_64-linux.activate.home-manager self.homeConfigurationsPortable.x86_64-linux.bartender;
# }; # };
#}; #};
}; };

View file

@ -1,12 +0,0 @@
{
config,
pkgs,
lib,
...
}:
with lib; {
# Both things below are for
# https://github.com/NixOS/nixpkgs/issues/124215
documentation.info.enable = lib.mkForce false;
nix.settings.extra-sandbox-paths = ["/bin/sh=${pkgs.bash}/bin/sh"];
}

View file

@ -19,7 +19,7 @@ in {
# Run when initializing an interactive shell # Run when initializing an interactive shell
initExtra = '' initExtra = ''
# Show current directory at the top in Alacritty # Show current directory at the top in Alacritty
PROMPT_COMMAND='echo -e -n "\e]2;$(basename "$PWD")\e\\"' PROMPT_COMMAND='echo -e -n "\e]2;$(basename "$PWD" | sed "s/${psCfg.user.name}/~/")\e\\"'
# If a command is not found, show me where it is # If a command is not found, show me where it is
source ${pkgs.nix-index}/etc/profile.d/command-not-found.sh source ${pkgs.nix-index}/etc/profile.d/command-not-found.sh
@ -34,7 +34,7 @@ in {
# Syntax highlighting, auto suggestions, vim modes, etc. # Syntax highlighting, auto suggestions, vim modes, etc.
# https://github.com/akinomyoga/ble.sh/wiki/Manual-A1-Installation#user-content-nixpkgs # https://github.com/akinomyoga/ble.sh/wiki/Manual-A1-Installation#user-content-nixpkgs
source "$(blesh-share)" --attach=none source "$(blesh-share)"/ble.sh --attach=none
# ctrl + space to accept autocomplete suggestion # ctrl + space to accept autocomplete suggestion
ble-bind -m 'auto_complete' -f 'C-@' 'auto_complete/insert-on-end' ble-bind -m 'auto_complete' -f 'C-@' 'auto_complete/insert-on-end'
# Meta (Alt) + Backspace to delete a word # Meta (Alt) + Backspace to delete a word
@ -59,6 +59,7 @@ in {
} }
blehook/eval-after-load complete my/complete-load-hook blehook/eval-after-load complete my/complete-load-hook
bleopt exec_elapsed_mark=
bleopt exec_errexit_mark= bleopt exec_errexit_mark=
bleopt filename_ls_colors="$LS_COLORS" bleopt filename_ls_colors="$LS_COLORS"
@ -84,6 +85,11 @@ in {
fi fi
# end of .bashrc # end of .bashrc
# Somehow we need to ensure starship starts later than ble.sh
# (possible packaging issue?)
# https://github.com/akinomyoga/ble.sh/issues/333
eval "$(${pkgs.starship}/bin/starship init bash)"
[[ ''${BLE_VERSION-} ]] && ble-attach [[ ''${BLE_VERSION-} ]] && ble-attach
''; '';

View file

@ -10,8 +10,5 @@
"--color=fg:#d3d1d4,header:#7accd7,info:#e5c463,pointer:#ef9062" "--color=fg:#d3d1d4,header:#7accd7,info:#e5c463,pointer:#ef9062"
"--color=marker:#ef9062,fg+:#303030,prompt:#e5c463,hl+:#7accd7" "--color=marker:#ef9062,fg+:#303030,prompt:#e5c463,hl+:#7accd7"
]; ];
# Use ble.sh for completions, see enableBashIntegration = true;
# modules/terminal-life/bash/default.nix -> bleopt complete_menu_style=desc
# and https://github.com/akinomyoga/ble.sh/wiki/Manual-%C2%A77-Completion
enableBashIntegration = false;
} }

View file

@ -5,8 +5,8 @@
let g:clipboard = { let g:clipboard = {
\ 'name': 'wayland-strip-carriage', \ 'name': 'wayland-strip-carriage',
\ 'copy': { \ 'copy': {
\ '+': 'wl-copy --foreground --type text/plain', \ '+': 'wl-copy --foreground --type text/plain --trim-newline',
\ '*': 'wl-copy --foreground --type text/plain --primary', \ '*': 'wl-copy --foreground --type text/plain --primary --trim-newline',
\ }, \ },
\ 'paste': { \ 'paste': {
\ '+': {-> systemlist('wl-paste --no-newline | tr -d "\r"')}, \ '+': {-> systemlist('wl-paste --no-newline | tr -d "\r"')},

View file

@ -25,6 +25,7 @@ in {
ansible-language-server ansible-language-server
ccls ccls
gopls gopls
nixd
nodejs nodejs
nodePackages.bash-language-server nodePackages.bash-language-server
nodePackages.dockerfile-language-server-nodejs nodePackages.dockerfile-language-server-nodejs
@ -37,9 +38,8 @@ in {
nodePackages.yaml-language-server nodePackages.yaml-language-server
python3Packages.python-lsp-server python3Packages.python-lsp-server
python3Full python3Full
solargraph
rnix-lsp
rust-analyzer rust-analyzer
solargraph
terraform-ls terraform-ls
universal-ctags universal-ctags
]; ];

View file

@ -122,9 +122,9 @@ lua <<EOF
} }
} }
}, },
'nixd', --------------------------------- Nix
'phpactor', ----------------------------- PHP 'phpactor', ----------------------------- PHP
'pylsp', -------------------------------- Python 'pylsp', -------------------------------- Python
'rnix', --------------------------------- Nix
'solargraph', --------------------------- Ruby 'solargraph', --------------------------- Ruby
'rust_analyzer', ------------------------ Rust 'rust_analyzer', ------------------------ Rust
['sqlls'] = { ['sqlls'] = {

View file

@ -1,5 +1,32 @@
final: prev: { final: prev: {
blesh = prev.blesh.overrideAttrs (oldAttrs: rec { blesh = prev.blesh.overrideAttrs (oldAttrs: rec {
inherit (prev.sources.blesh-nvfetcher) version src; inherit (prev.sources.blesh-nvfetcher) version src;
dontBuild = false;
buildInputs = [prev.git];
patchPhase = ''
substituteInPlace GNUmakefile \
--replace "git submodule update --init --recursive" ""
'';
nativeCheckInputs = oldAttrs.nativeCheckInputs ++ [prev.busybox];
installPhase = ''
runHook preInstall
mkdir -p "$out/share/blesh/lib"
cat <<EOF >"$out/share/blesh/lib/_package.sh"
_ble_base_package_type=nix
function ble/base/package:nix/update {
echo "Ble.sh is installed by Nix. You can update it there." >&2
return 1
}
EOF
make install INSDIR=$out/share/blesh
runHook postInstall
'';
}); });
} }

View file

@ -3,6 +3,7 @@ channels: final: prev: {
inherit inherit
(channels.latest) (channels.latest)
nixd
; ;
haskellPackages = haskellPackages =
@ -18,4 +19,6 @@ channels: final: prev: {
; ;
}); });
}); });
vimPlugins = prev.vimPlugins // {inherit (channels.latest.vimPlugins) nvim-lspconfig;};
} }

View file

@ -3,17 +3,17 @@
{ {
blesh-nvfetcher = { blesh-nvfetcher = {
pname = "blesh-nvfetcher"; pname = "blesh-nvfetcher";
version = "f16c0d807c8e1fe26fa5d990b561829382cbdc72"; version = "1afc616b890e487926897e5b3e3a33e0ad833cb3";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "akinomyoga"; owner = "akinomyoga";
repo = "ble.sh"; repo = "ble.sh";
rev = "f16c0d807c8e1fe26fa5d990b561829382cbdc72"; rev = "1afc616b890e487926897e5b3e3a33e0ad833cb3";
fetchSubmodules = true; fetchSubmodules = true;
deepClone = false; deepClone = false;
leaveDotGit = true; leaveDotGit = true;
sha256 = "sha256-+tcM1z9uD7WXA7CfHmTbcPRcZfmXZ+Y7y6Bj4QA3f+4="; sha256 = "sha256-gDxx7nDleS2HWIJWc208gcTzuRUEu/JCyepTuOJDAGo=";
}; };
date = "2023-06-12"; date = "2023-06-29";
}; };
instant-nvim-nvfetcher = { instant-nvim-nvfetcher = {
pname = "instant-nvim-nvfetcher"; pname = "instant-nvim-nvfetcher";
@ -111,16 +111,4 @@
}; };
date = "2022-07-03"; date = "2022-07-03";
}; };
waybar-nvfetcher = {
pname = "waybar-nvfetcher";
version = "41164905351436db3a124207261f9dd759c6fa1b";
src = fetchFromGitHub {
owner = "Alexays";
repo = "Waybar";
rev = "41164905351436db3a124207261f9dd759c6fa1b";
fetchSubmodules = false;
sha256 = "sha256-aogiOj4pe2AJYxQFh8Dw6xQ2Tb6v4W9zwbGX4t2mStI=";
};
date = "2023-06-27";
};
} }

View file

@ -31,10 +31,6 @@ fetch.github = "zeekay/vim-beautify"
src.git = "https://github.com/romainl/Apprentice" src.git = "https://github.com/romainl/Apprentice"
fetch.github = "romainl/Apprentice" fetch.github = "romainl/Apprentice"
[waybar-nvfetcher]
src.git = "https://github.com/Alexays/Waybar"
fetch.github = "Alexays/Waybar"
[blesh-nvfetcher] [blesh-nvfetcher]
src.git = "https://github.com/akinomyoga/ble.sh" src.git = "https://github.com/akinomyoga/ble.sh"
fetch.github = "akinomyoga/ble.sh" fetch.github = "akinomyoga/ble.sh"

View file

@ -1,6 +1,7 @@
self: self:
with self; '' with self; ''
#!/usr/bin/env bash #!/usr/bin/env bash
# terminal application launcher for sway, using fzf
# original command: # original command:
# Based on: https://github.com/swaywm/sway/issues/1367 # Based on: https://github.com/swaywm/sway/issues/1367
# bindsym $altkey+space exec termite --name=launcher -e \ # bindsym $altkey+space exec termite --name=launcher -e \

View file

@ -1,111 +0,0 @@
*
!*.nix
!/.gitignore
!/.zshrc
!/.Xdefaults
!/.Xresources
!/.xinitrc
!/.config
!/assets
!/assets/wallpaper.jpg
!/.config/dircolors
!/.config/xmodmap
!/.config/environment.d
!/.config/environment.d/profile.conf
!/.config/environment.d/drone.conf
!/.config/environment.d/restic.conf
!/.config/user-dirs.dirs
!/.config/user-dirs.locale
!/.config/gtk-2.0
!/.config/gtk-2.0/gtkrc
!/.config/gtk-3.0
!/.config/gtk-3.0/settings.ini
!/.config/xsettingsd
!/.config/xsettingsd/xsettingsd.conf
!/.config/mako
!/.config/mako/config
!/.config/alacritty
!/.config/alacritty/alacritty.yml
!/.config/git
!/.config/git/config
!/.config/vifm
!/.config/vifm/vifmrc
!/.config/vifm/scripts
!/.config/vifm/colors
!/.config/vifm/colors/base16.vifm
!/.config/nvim
!/.config/nvim/init.vim
!/.config/nvim/clipboard.vim
!/.config/nvim/lsp.vim
!/.config/nvim/quickfixopenall.vim
!/.config/nvim/ui.vim
!/.config/mimeapps.list
!/.config/libinput-gestures.conf
!/.config/sway
!/.config/sway/config
!/.config/sway/config.d
!/.config/sway/config.d/applications.conf
!/.config/sway/config.d/autostart.conf
!/.config/sway/config.d/colorscheme.conf
!/.config/sway/config.d/custom-keybindings.conf
!/.config/sway/config.d/gaps.conf
!/.config/sway/config.d/input-defaults.conf
!/.config/sway/config.d/systemd.conf
!/.config/sway/config.d/theme.conf
!/.config/sway/config.d/biolimo
!/.config/sway/config.d/biolimo/screens.conf
!/.config/sway/config.d/biolimo/inputs.conf
!/.config/sway/config.d/chocolatebar
!/.config/sway/config.d/chocolatebar/screens.conf
!/.config/waybar
!/.config/waybar/colorscheme.css
!/.config/waybar/config
!/.config/waybar/style.css
!/.config/mutt
!/.config/mutt/muttrc
!/.config/mutt/base16.muttrc
!/.config/mutt/mailcap
!/.config/offlineimap
!/.config/offlineimap/functions.py
!/.local
!/.local/bin
!/.local/bin/install-base
!/.local/bin/swaylock-bg
!/.local/bin/sway-launcher
!/.local/bin/sway-service
!/.local/bin/toggle-kbd-layout
!/.local/bin/wcwd
!/.local/bin/vifmrun
!/.local/bin/vifmimg
!/.local/bin/s
!/.local/bin/windows
!/.local/bin/import-gtk-settings
!/.local/bin/mailto-mutt
!/.local/bin/setup-host-conf
!/.local/bin/steam-xdg
!/.local/share
!/.local/share/applications
!/.local/share/applications/userapp-Firefox.desktop

View file

@ -21,11 +21,12 @@ in {
isNormalUser = true; isNormalUser = true;
description = psCfg.user.description; description = psCfg.user.description;
extraGroups = [ extraGroups = [
"wheel"
"input" "input"
"networkmanager"
"lp" "lp"
"networkmanager"
"scanner" "scanner"
"video"
"wheel"
]; ];
initialHashedPassword = initialHashedPassword =
if psCfg.user.password != null if psCfg.user.password != null

View file

@ -27,6 +27,16 @@ in {
programs.dircolors.enable = true; programs.dircolors.enable = true;
programs.less = {
enable = true;
keys = ''
k forw-line
i back-line
K forw-scroll
I back-scroll
'';
};
home.file."xinitrc".source = ./.xinitrc; home.file."xinitrc".source = ./.xinitrc;
xdg.enable = true; xdg.enable = true;

View file

@ -1,38 +1,9 @@
#!/usr/bin/env bash #!/usr/bin/env bash
if git rev-parse --verify HEAD >/dev/null 2>&1; then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=$(${git}/bin/git hash-object -t tree /dev/null)
fi
# Stash only unstaged changes, keeping staged changes
old_stash=$(git rev-parse --quiet --verify refs/stash)
git stash push --quiet --keep-index -m 'Unstaged changes before pre-commit hook'
new_stash=$(git rev-parse --quiet --verify refs/stash)
diff="git diff-index --name-only --cached $against --diff-filter d"
mapfile -t all_files < <($diff)
# Format staged files
if ((${#all_files[@]} != 0)); then
treefmt "${all_files[@]}" &&
git add "${all_files[@]}"
fi
# If unstaged changes were stashed re-apply to working tree
if [ "$old_stash" != "$new_stash" ]; then
git stash pop --quiet
fi
# Check editorconfig # Check editorconfig
if ((${#all_files[@]} != 0)); then if ! editorconfig-checker; then
if ! editorconfig-checker -- "${all_files[@]}"; then
printf "%b\n" \ printf "%b\n" \
"\nCode is not aligned with .editorconfig" \ "\nCode is not aligned with .editorconfig" \
"Review the output and commit your fixes" >&2 "Review the output and commit your fixes" >&2
exit 1 exit 1
fi fi
fi