updgrade to 23.11

This commit is contained in:
Tim Schubert 2023-12-02 15:48:36 +01:00
parent 2c0f9dd7f8
commit eb9cd9d8cf
Signed by: dadada
SSH key fingerprint: SHA256:bFAjFH3hR8zRBaJjzQDjc3o4jqoq5EZ87l+KXEjxIz0
40 changed files with 18 additions and 621 deletions

16
flake.lock generated
View file

@ -239,16 +239,16 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1699748081, "lastModified": 1700814205,
"narHash": "sha256-MOmMapBydd7MTjhX4eeQZzKlCABWw8W6iSHSG4OeFKE=", "narHash": "sha256-lWqDPKHRbQfi+zNIivf031BUeyciVOtwCwTjyrhDB5g=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "04bac349d585c9df38d78e0285b780a140dc74a4", "rev": "aeb2232d7a32530d3448318790534d196bf9427a",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "nix-community",
"ref": "release-23.05", "ref": "release-23.11",
"repo": "home-manager", "repo": "home-manager",
"type": "github" "type": "github"
} }
@ -369,16 +369,16 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1699596684, "lastModified": 1701389149,
"narHash": "sha256-XSXP8zjBZJBVvpNb2WmY0eW8O2ce+sVyj1T0/iBRIvg=", "narHash": "sha256-rU1suTIEd5DGCaAXKW6yHoCfR1mnYjOXQFOaH7M23js=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "da4024d0ead5d7820f6bd15147d3fe2a0c0cec73", "rev": "5de0b32be6e85dc1a9404c75131316e4ffbc634c",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "nixos-23.05", "ref": "nixos-23.11",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }

View file

@ -2,13 +2,13 @@
description = "dadada's nix flake"; description = "dadada's nix flake";
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
flake-utils = { flake-utils = {
url = "github:numtide/flake-utils"; url = "github:numtide/flake-utils";
inputs.systems.follows = "systems"; inputs.systems.follows = "systems";
}; };
home-manager = { home-manager = {
url = "github:nix-community/home-manager/release-23.05"; url = "github:nix-community/home-manager/release-23.11";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
nixos-hardware.url = "github:NixOS/nixos-hardware/master"; nixos-hardware.url = "github:NixOS/nixos-hardware/master";

View file

@ -6,7 +6,6 @@ let
useFeatures = [ useFeatures = [
"alacritty" "alacritty"
#"emacs" #"emacs"
"vim"
"direnv" "direnv"
"git" "git"
"gpg" "gpg"

View file

@ -89,6 +89,7 @@ with pkgs; [
nmap nmap
nmon nmon
nodePackages.prettier nodePackages.prettier
map-cmd
obs-studio obs-studio
offlineimap offlineimap
openscad openscad

View file

@ -16,7 +16,6 @@
syncthing = import ./syncthing.nix; syncthing = import ./syncthing.nix;
termite = import ./termite.nix; termite = import ./termite.nix;
tmux = import ./tmux.nix; tmux = import ./tmux.nix;
vim = import ./vim;
xdg = import ./xdg.nix; xdg = import ./xdg.nix;
zsh = import ./zsh.nix; zsh = import ./zsh.nix;
} }

View file

@ -14,7 +14,6 @@
./syncthing.nix ./syncthing.nix
./termite.nix ./termite.nix
./tmux.nix ./tmux.nix
./vim
./xdg.nix ./xdg.nix
./zsh.nix ./zsh.nix
] ]

View file

@ -1,45 +0,0 @@
{ config
, pkgs
, lib
, ...
}:
with lib; let
cfg = config.dadada.home.vim;
vimPlugins = pkgs.callPackage ../../../pkgs/vimPlugins { };
in
{
options.dadada.home.vim = {
enable = mkEnableOption "Enable VIM config";
};
config = mkIf cfg.enable {
programs.vim = {
enable = true;
extraConfig = builtins.readFile ./vimrc;
plugins = [
pkgs.vimPlugins.vim-nix
#pkgs.vimPlugins.kotlin-vim
pkgs.vimPlugins.ale
pkgs.vimPlugins.fzf-vim
pkgs.vimPlugins.rust-vim
pkgs.vimPlugins.base16-vim
pkgs.vimPlugins.typescript-vim
pkgs.vimPlugins.vim-airline
pkgs.vimPlugins.vim-airline-themes
pkgs.vimPlugins.vim-fish
pkgs.vimPlugins.vim-gitgutter
vimPlugins.vim-buftabline
vimPlugins.spacemacsTheme
vimPlugins.filetype
pkgs.vimPlugins.vim-ledger
];
};
home.packages = with pkgs; [
languagetool
nixpkgs-fmt
shellcheck
perlPackages.PerlCritic
texlab
];
};
}

View file

@ -1,157 +0,0 @@
filetype plugin on
filetype indent on
set autoread
" :W sudo saves the file
" (useful for handling the permission-denied error)
command W w !sudo tee % > /dev/null
" no command execution from modeline
set nomodeline
" Turn on the Wild menu
set wildmenu
" Enable hidden buffers
set hidden
" Clipboard copy & paste
set clipboard=unnamedplus
" Always show current position
set ruler
" When searching try to be smart about cases
set smartcase
" Highlight search results
set hlsearch
" Inenteremental search
set incsearch
" Don't redraw while executing macros (good performance config)
set lazyredraw
" Do not show matching brackets when text indicator is over them
" set noshowmatch
" let loaded_matchparen = 1
" No annoying sound on errors
set noerrorbells
set novisualbell
set wrap
set linebreak
set nolist " list disables linebreak
set mouse=a
" Enable syntax highlighting
syntax enable
if (has("termguicolors"))
let &t_8f="\<Esc>[38;2;%lu;%lu;%lum"
let &t_8b="\<Esc>[48;2;%lu;%lu;%lum"
set termguicolors
endif
set t_Co=256
set background=dark
colorscheme spacemacs-theme
set tabstop=4
set softtabstop=4
set softtabstop=4
set expandtab
set smarttab
set smartindent
set autoindent
set copyindent
set preserveindent
set wildmode=longest,list,full
set wildmenu
set cursorline
set number
set relativenumber
" Transparency
"hi Normal guibg=NONE ctermbg=NONE
"set list!
"set listchars=trail:⛤,extends:⟩,precedes:⟨,nbsp:␣,conceal:…
" Map leader to do extra key combinations
let mapleader = " "
" Toggle paste mode on and off
map <leader>pp :setlocal paste!<Enter>
" Fast saving
nmap <leader>w :w<Enter>
" Buffer switching
nmap <leader>bl :Buffers<Enter>
nmap <leader>bd :bdelete<Enter>
nmap <leader>bn :bnext<Enter>
nmap <leader>bp :bprevious<Enter>
" List things
nmap <leader>hl :History/<Enter>
nmap <leader>ll :Lines<Enter>
nmap <leader>ml :Marks<Enter>
nmap <leader>rl :reg<Enter>
nmap <leader>wl :Windows<Enter>
" finding files
nmap <leader>ff :Files<Enter>
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
"let g:syntastic_always_populate_loc_list = 1
"let g:syntastic_auto_loc_list = 1
"let g:syntastic_check_on_open = 1
"let g:syntastic_check_on_wq = 0
nmap <leader>fr :ALEFindReferences<Enter>
nmap <leader>gd :ALEGoToDefinition<Enter>
nmap <leader>hh :ALEHover<Enter>
nmap <leader>ss :ALESymbolSearch <C-R><C-A><Enter>
nmap <leader>rn :ALERename<Enter>
nmap <leader>rf :ALERefactor<Enter>
nmap <leader>ca :ALE<Enter>
nmap <leader>fx :ALEFix<Enter>
" Enable completion where available.
" This setting must be set before ALE is loaded.
let g:ale_completion_enabled = 1
let g:ale_fix_on_save = 0
let g:ale_warn_about_trailing_whitespace = 1
let g:ale_warn_about_trailing_lines = 1
let g:ale_completion_autoimport = 1
let g:ale_languagetool_executable = 'languagetool-commandline'
let g:ale_set_quickfix = 1
"let g:ale_lint_on_text_changed = 'never'
" You can disable this option too
" if you don't want linters to run on opening a file
"let g:ale_lint_on_enter = 0
" Set airline theme
let g:airline_theme='base16_spacemacs'
" Load all plugins now.
" Plugins need to be added to runtimepath before helptags can be generated.
packloadall
" Load all of the helptags now, after plugins have been loaded.
" All messages and errors will be ignored.
silent! helptags ALL
set omnifunc=ale#completion#OmniFunc
"
" autocmd BufWritePost <buffer> RunBuf make
command! -nargs=1 RunBuf execute ':let job = job_start("<args>", {"out_io": "buffer", "out_name": "<args>"})'

View file

@ -18,7 +18,6 @@ with lib; let
"application/xhtml+xml" = "firefox.desktop"; "application/xhtml+xml" = "firefox.desktop";
"application/x-extension-xhtml" = "firefox.desktop"; "application/x-extension-xhtml" = "firefox.desktop";
"application/x-extension-xht" = "firefox.desktop"; "application/x-extension-xht" = "firefox.desktop";
"text/plain" = "vim.desktop";
"application/pdf" = "org.pwmt.zathura.desktop"; "application/pdf" = "org.pwmt.zathura.desktop";
}; };
cfg = config.dadada.home.xdg; cfg = config.dadada.home.xdg;

View file

@ -5,6 +5,7 @@ let
domain = "bs.dadada.li"; domain = "bs.dadada.li";
in in
{ {
networking.useDHCP = false;
systemd.network = { systemd.network = {
enable = true; enable = true;
links = { links = {

View file

@ -96,7 +96,7 @@ in
users.mutableUsers = mkDefault false; users.mutableUsers = mkDefault false;
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
vim helix
tmux tmux
]; ];

View file

@ -14,7 +14,6 @@
packages = import ./packages.nix; packages = import ./packages.nix;
secrets = import ./secrets.nix; secrets = import ./secrets.nix;
share = import ./share.nix; share = import ./share.nix;
soft-serve = import ./soft-serve.nix;
steam = import ./steam.nix; steam = import ./steam.nix;
sway = import ./sway.nix; sway = import ./sway.nix;
vpnServer = import ./vpnServer.nix; vpnServer = import ./vpnServer.nix;

View file

@ -20,7 +20,7 @@ with lib; {
age.identityPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; age.identityPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
fonts.fonts = mkDefault (with pkgs; [ fonts.packages = mkDefault (with pkgs; [
source-code-pro source-code-pro
]); ]);

View file

@ -1,212 +0,0 @@
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.services.soft-serve;
configFile = format.generate "config.yaml" cfg.settings;
exe = getExe cfg.package;
format = pkgs.formats.yaml { };
user = "soft-serve";
in
{
options = {
services.soft-serve = {
enable = mkEnableOption "Enable soft-serve service";
package = mkPackageOption pkgs "soft-serve" { };
stateDir = mkOption {
type = types.path;
default = "/var/lib/soft-serve";
description = lib.mdDoc ''
The absolute path to the data directory.
See <https://github.com/charmbracelet/soft-serve>.
'';
};
user = mkOption {
type = types.str;
default = user;
description = lib.mdDoc "User account under which soft-serve runs.";
};
group = mkOption {
type = types.str;
default = user;
description = lib.mdDoc "Group account under which soft-serve runs.";
};
settings = mkOption {
type = format.type;
default = { };
description = lib.mdDoc ''
The contents of the configuration file.
See <https://github.com/charmbracelet/soft-serve>.
'';
example = literalExpression ''
{
# Soft Serve Server configurations
# The name of the server.
# This is the name that will be displayed in the UI.
name = "Soft Serve";
# Log format to use. Valid values are "json", "logfmt", and "text".
log_format = "text";
# The SSH server configuration.
ssh = {
# The address on which the SSH server will listen.
listen_addr = ":23231";
# The public URL of the SSH server.
# This is the address that will be used to clone repositories.
public_url = "ssh://localhost:23231";
# The path to the SSH server's private key.
key_path = "ssh/soft_serve_host";
# The path to the SSH server's client private key.
# This key will be used to authenticate the server to make git requests to
# ssh remotes.
client_key_path = "ssh/soft_serve_client";
# The maximum number of seconds a connection can take.
# A value of 0 means no timeout.
max_timeout = 0;
# The number of seconds a connection can be idle before it is closed.
idle_timeout = 120;
};
# The Git daemon configuration.
git = {
# The address on which the Git daemon will listen.
listen_addr = ":9418";
# The maximum number of seconds a connection can take.
# A value of 0 means no timeout.
max_timeout = 0;
# The number of seconds a connection can be idle before it is closed.
idle_timeout = 3;
# The maximum number of concurrent connections.
max_connections = 32;
};
# The HTTP server configuration.
http = {
# The address on which the HTTP server will listen.
listen_addr = ":23232";
# The path to the TLS private key.
tls_key_path = "";
# The path to the TLS certificate.
tls_cert_path = "";
# The public URL of the HTTP server.
# This is the address that will be used to clone repositories.
# Make sure to use https:// if you are using TLS.
public_url = "http://localhost:23232";
};
# The stats server configuration.
stats = {
# The address on which the stats server will listen.
listen_addr = ":23233";
};
# Additional admin keys.
initial_admin_keys = [
"ssh-rsa AAAAB3NzaC1yc2..."
];
};
'';
};
};
};
config = let stateDir = cfg.stateDir; in mkIf cfg.enable {
users.users = mkIf (cfg.user == "soft-serve") {
soft-serve = {
description = "soft-serve service";
home = cfg.stateDir;
useDefaultShell = true;
group = cfg.group;
isSystemUser = true;
};
};
users.groups = mkIf (cfg.group == "soft-serve") {
soft-serve = { };
};
systemd.tmpfiles.rules = [
"d '${stateDir}' 0750 ${cfg.user} ${cfg.group} - -"
];
systemd.services.soft-serve = {
description = "Soft Serve git server 🍦";
documentation = [ "https://github.com/charmbracelet/soft-serve" ];
requires = [ "network-online.target" ];
after = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];
environment = {
SOFT_SERVE_DATA_PATH = stateDir;
};
preStart = ''
# Link the settings file into the data directory.
ln -fs ${configFile} ${stateDir}/config.yaml
'';
serviceConfig = {
Type = "simple";
User = cfg.user;
Group = cfg.group;
Restart = "always";
RestartSec = "1";
ExecStart = "${exe} serve";
WorkingDirectory = stateDir;
RuntimeDirectory = "soft-serve";
RuntimeDirectoryMode = "0750";
ProcSubset = "pid";
ProtectProc = "invisible";
ReadWritePaths = [ stateDir ];
UMask = "0027";
CapabilityBoundingSet = "";
NoNewPrivileges = true;
ProtectSystem = "strict";
ProtectHome = true;
PrivateTmp = true;
PrivateDevices = true;
PrivateUsers = true;
ProtectHostname = true;
ProtectClock = true;
ProtectKernelTunables = true;
ProtectKernelModules = true;
ProtectKernelLogs = true;
ProtectControlGroups = true;
RestrictAddressFamilies = [ "AF_UNIX" "AF_INET" "AF_INET6" ];
RestrictNamespaces = true;
LockPersonality = true;
MemoryDenyWriteExecute = true;
RestrictRealtime = true;
RestrictSUIDSGID = true;
RemoveIPC = true;
PrivateMounts = true;
SystemCallArchitectures = "native";
SystemCallFilter = [
"@system-service"
"~@cpu-emulation @debug @keyring @module @mount @obsolete @privileged @raw-io @reboot @setuid @swap"
];
};
};
};
meta.maintainers = [ maintainers.dadada ];
}

View file

@ -378,6 +378,7 @@ in
services.resolved.enable = true; services.resolved.enable = true;
networking.networkmanager.enable = false; networking.networkmanager.enable = false;
networking.useDHCP = false;
# Desktop things for media playback # Desktop things for media playback

View file

@ -60,6 +60,8 @@ in
location = "/var/backup/postgresql"; location = "/var/backup/postgresql";
}; };
networking.useDHCP = false;
systemd.network = { systemd.network = {
enable = true; enable = true;
networks = { networks = {

View file

@ -38,12 +38,4 @@
}; };
}); });
}; };
soft-serve = final: prev: {
soft-serve = prev.callPackage ./pkgs/soft-serve.nix { };
};
map = final: prev: {
map = prev.callPackage ./pkgs/map.nix { };
};
} }

View file

@ -1,4 +1,2 @@
{ pkgs }: { pkgs }:
{ { }
map = pkgs.callPackage ./map.nix { };
}

View file

@ -1,32 +0,0 @@
{ lib, stdenv, fetchFromGitHub }:
stdenv.mkDerivation rec {
pname = "map";
version = "0.1.1";
src = fetchFromGitHub {
owner = "soveran";
repo = pname;
rev = "0.1.1";
sha256 = "sha256-yGzmhZwv1qKy0JNcSzqL996APQO8OGWQ1GBkEkKTOXA=";
};
makefile = "makefile";
installPhase = ''
export PREFIX="$out";
mkdir -p "$out"
make install
'';
checkPhase = ''
make test
'';
meta = with lib; {
description = "Map lines from stdin to commands";
license = licenses.bsd2;
homepage = "https://github.com/soveran/map";
platforms = platforms.all;
maintainers = with maintainers; [ dadada ];
};
}

View file

@ -1,37 +0,0 @@
# Borrowed from nixpkgs.
# See https://github.com/NixOS/nixpkgs/issues/86349
{ lib, buildGoModule, fetchFromGitHub, makeWrapper, git, bash }:
buildGoModule rec {
pname = "soft-serve";
version = "0.7.1";
src = fetchFromGitHub {
owner = "charmbracelet";
repo = "soft-serve";
rev = "v${version}";
sha256 = "sha256-PY/BHfuDRHXpzyUawzZhDr1m0c1tWqawW7GP9muhYAs=";
};
vendorHash = "sha256-jtEiikjEOThTSrd+UIEInxQmt2z5YVyksuTC17VmdkA=";
doCheck = false;
ldflags = [ "-s" "-w" "-X=main.Version=${version}" ];
nativeBuildInputs = [ makeWrapper ];
postInstall = ''
wrapProgram $out/bin/soft \
--prefix PATH : "${lib.makeBinPath [ git bash ]}"
'';
meta = with lib; {
description = "A tasty, self-hosted Git server for the command line";
homepage = "https://github.com/charmbracelet/soft-serve";
changelog = "https://github.com/charmbracelet/soft-serve/releases/tag/v${version}";
mainProgram = "soft";
license = licenses.mit;
maintainers = with maintainers; [ penguwin ];
};
}

View file

@ -1,34 +0,0 @@
{ pkgs
, lib
, fetchFromGitHub
, ...
}:
with lib; {
filetype = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "dadadaVimFiletype";
version = "0.2";
src = ./filetype;
};
spacemacsTheme = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "spacemacs-theme";
version = "2.0.1";
src = pkgs.fetchFromGitHub {
owner = "colepeters";
repo = "spacemacs-theme.vim";
rev = "056bba9bd05a2c97c63c28216a1c232cfb91529e";
sha256 = "0iy3i6waigk759p2z59mrxkjc0p412y7d8zf3cjak4a9sh1sh6qz";
};
};
vim-buftabline = pkgs.vimUtils.buildVimPluginFrom2Nix {
pname = "vim-buftabline";
version = "master";
src = pkgs.fetchFromGitHub {
owner = "ap";
repo = "vim-buftabline";
rev = "73b9ef5dcb6cdf6488bc88adb382f20bc3e3262a";
sha256 = "1vs4km7fb3di02p0771x42y2bsn1hi4q6iwlbrj0imacd9affv5y";
};
};
}

View file

@ -1,3 +0,0 @@
setlocal expandtab
setlocal shiftwidth=2
setlocal softtabstop=2

View file

@ -1,11 +0,0 @@
let b:ale_fixers = ['clang-format', 'remove_trailing_lines', 'trim_whitespace']
let b:ale_linters = ['clangd']
"setlocal tabstop=8 expandtab shiftwidth=2 smarttab
" GNU Coding Standards
setlocal cindent
setlocal cinoptions=>4,n-2,{2,^-2,:2,=2,g0,h2,p5,t0,+2,(0,u0,w1,m1
setlocal shiftwidth=2
setlocal softtabstop=2
setlocal textwidth=79
setlocal fo-=ro fo+=cql

View file

@ -1,3 +0,0 @@
setlocal expandtab
setlocal shiftwidth=2
setlocal softtabstop=2

View file

@ -1,2 +0,0 @@
" Set up :make to use fish for syntax checking.
compiler fish

View file

@ -1,3 +0,0 @@
class Foo {
fun
}

View file

@ -1,3 +0,0 @@
set expandtab&
setlocal shiftwidth=4
setlocal softtabstop=4

View file

@ -1,3 +0,0 @@
setlocal expandtab
setlocal shiftwidth=2
setlocal softtabstop=2

View file

@ -1,5 +0,0 @@
let b:ale_fixers = ['prettier', 'eslint']
setlocal expandtab
setlocal shiftwidth=2
setlocal softtabstop=2

View file

@ -1,5 +0,0 @@
setlocal expandtab
setlocal shiftwidth=4
setlocal softtabstop=4
let g:ale_kotlin_languageserver_executable = "/home/tim/src/kotlin-language-server/server/build/install/server/bin/kotlin-language-server"

View file

@ -1,3 +0,0 @@
setlocal expandtab
setlocal shiftwidth=4
setlocal softtabstop=4

View file

@ -1,2 +0,0 @@
let b:ale_linters = {'markdown': ['languagetool']}
let b:ale_fixers = {'markdown': ['languagetool']}

View file

@ -1,5 +0,0 @@
setlocal expandtab
setlocal shiftwidth=2
setlocal softtabstop=2
let b:ale_fixers = [ 'nixpkgs-fmt', 'remove_trailing_lines', 'trim_whitespace']

View file

@ -1,3 +0,0 @@
setlocal expandtab
setlocal shiftwidth=2
setlocal softtabstop=2

View file

@ -1,4 +0,0 @@
" Check Python files with flake8 and pylint.
let b:ale_linters = ['flake8', 'pylint']
" Fix Python files with autopep8 and yapf.
let b:ale_fixers = ['autopep8', 'yapf', 'add_blank_lines_for_python_control_statements', 'autopep8', 'remove_trailing_lines', 'reorder-python-imports', 'trim_whitespace']

View file

@ -1,2 +0,0 @@
let b:ale_linters = {'rust': ['rustc', 'rls', 'rust-analyzer']}
let b:ale_fixers = {'rust': ['rustfmt']}

View file

@ -1,3 +0,0 @@
setlocal expandtab
setlocal shiftwidth=2
setlocal softtabstop=2

View file

@ -1,7 +0,0 @@
setlocal tabstop=2
setlocal shiftwidth=2
setlocal expandtab
setlocal textwidth=79
let b:ale_linters = {'tex': ['texlab']}
let b:ale_fixers = {'tex': ['remove_trailing_lines', 'trim_whitespace', 'texlab']}

View file

@ -1,5 +0,0 @@
let b:ale_fixers = ['prettier', 'eslint', 'tsserver']
setlocal expandtab
setlocal shiftwidth=2
setlocal softtabstop=2

View file

@ -1,4 +0,0 @@
setlocal expandtab
setlocal shiftwidth=2
setlocal softtabstop=2