Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 45f23db173 | |||
| eb9c8b6b2e | |||
| 9c79023fad | |||
| ec4b5bf1f6 |
@@ -1181,12 +1181,6 @@ in
|
|||||||
|
|
||||||
# Use the .zshrc file from assets
|
# Use the .zshrc file from assets
|
||||||
xdg.configFile."zsh/.zshrc".source = "${assetsDir}/.zshrc";
|
xdg.configFile."zsh/.zshrc".source = "${assetsDir}/.zshrc";
|
||||||
|
|
||||||
# Create symlinks or copy files from assets to XDG config
|
|
||||||
xdg.configFile."zsh/custom.zsh".source = "${assetsDir}/custom.zsh";
|
|
||||||
xdg.configFile."zsh/aliases.zsh".source = "${assetsDir}/aliases.zsh";
|
|
||||||
xdg.configFile."zsh/history.zsh".source = "${assetsDir}/history.zsh";
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
##############################################
|
||||||
|
# These files are just for reference.
|
||||||
|
# If you want to change anything, edit the source files in:
|
||||||
|
# ~/henrovnix/assets/conf
|
||||||
|
#
|
||||||
|
# After that, run:
|
||||||
|
# cd ~/henrovnix && emacs README.org --batch -f org-babel-tangle && git add . && git commit -m "Adjusted conf files" && sudo nixos-rebuild switch --flake .#<yourhost>
|
||||||
|
#
|
||||||
|
# If everything still works, you can use the same command but:
|
||||||
|
# - keep "switch"
|
||||||
|
# - and add a reboot:
|
||||||
|
#
|
||||||
|
# cd ~/henrovnix && sudo nixos-rebuild switch --flake .#<yourhost> && systemctl reboot
|
||||||
|
#
|
||||||
|
# NOTE:
|
||||||
|
# Make sure the lines starting with: cd ~/henrovnix
|
||||||
|
# are written as ONE single line.
|
||||||
|
##############################################
|
||||||
|
#app.zen_browser.zen
|
||||||
|
com.github.tchx84.Flatseal
|
||||||
|
eu.betterbird.Betterbird
|
||||||
|
com.todoist.Todoist
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
#productivity
|
||||||
|
todoist
|
||||||
|
|
||||||
|
# browsers
|
||||||
|
brave
|
||||||
|
vivaldi
|
||||||
|
chromium
|
||||||
|
|
||||||
|
# utils
|
||||||
|
wget
|
||||||
|
kdePackages.kdeconnect-kde
|
||||||
|
_1password-gui
|
||||||
|
tree
|
||||||
|
gparted
|
||||||
|
file
|
||||||
|
htop
|
||||||
|
wev
|
||||||
|
solaar
|
||||||
|
baobab
|
||||||
|
duf
|
||||||
|
zed-editor
|
||||||
|
|
||||||
|
# office
|
||||||
|
obsidian
|
||||||
|
onlyoffice-desktopeditors
|
||||||
|
|
||||||
|
# development
|
||||||
|
postman
|
||||||
|
tea
|
||||||
|
|
||||||
|
#jetbrains.pycharm
|
||||||
|
python3
|
||||||
|
|
||||||
|
# communication
|
||||||
|
nextcloud-talk-desktop
|
||||||
|
signal-desktop
|
||||||
|
openssl
|
||||||
|
|
||||||
|
# multimedia
|
||||||
|
audacity
|
||||||
|
handbrake
|
||||||
|
spotify
|
||||||
|
vlc
|
||||||
@@ -73,11 +73,11 @@ if [ -n "$DIRENV_HOOK" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Aliases
|
# Aliases
|
||||||
alias -- la='eza -a'
|
# alias -- la='eza -a'
|
||||||
alias -- ll='eza -l'
|
# alias -- ll='eza -l'
|
||||||
alias -- lla='eza -la'
|
# alias -- lla='eza -la'
|
||||||
alias -- ls='eza'
|
# alias -- ls='eza'
|
||||||
alias -- lt='eza --tree'
|
# alias -- lt='eza --tree'
|
||||||
|
|
||||||
# Eat shell integration
|
# Eat shell integration
|
||||||
[ -n "$EAT_SHELL_INTEGRATION_DIR" ] && source "$EAT_SHELL_INTEGRATION_DIR/zsh"
|
[ -n "$EAT_SHELL_INTEGRATION_DIR" ] && source "$EAT_SHELL_INTEGRATION_DIR/zsh"
|
||||||
|
|||||||
@@ -0,0 +1,111 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
flakeRoot,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
moduleName = "install-flatpaks";
|
||||||
|
flatpakConfPath = flakeRoot.outPath + "/assets/common/apps/flatpaks.conf";
|
||||||
|
raw = builtins.readFile flatpakConfPath;
|
||||||
|
# Explicit "\n" so we never accidentally split into characters
|
||||||
|
rawLines = lib.splitString "\n" raw;
|
||||||
|
|
||||||
|
# Guard: if we accidentally split into characters, rawLines length ~= stringLength raw
|
||||||
|
_guard =
|
||||||
|
assert !(builtins.stringLength raw > 1 && builtins.length rawLines == builtins.stringLength raw);
|
||||||
|
true;
|
||||||
|
|
||||||
|
cleanLine =
|
||||||
|
l:
|
||||||
|
let
|
||||||
|
noCR = lib.replaceStrings [ "\r" ] [ "" ] l;
|
||||||
|
noInlineComment = lib.head (lib.splitString "#" noCR);
|
||||||
|
in
|
||||||
|
lib.strings.trim noInlineComment;
|
||||||
|
|
||||||
|
entries = builtins.filter (l: l != "") (map cleanLine rawLines);
|
||||||
|
|
||||||
|
# Flatpak app IDs are reverse-DNS style like org.example.App (at least 2 dots).
|
||||||
|
# We'll validate and fail early with a clear message.
|
||||||
|
dotCount = s: builtins.length (lib.splitString "." s) - 1;
|
||||||
|
|
||||||
|
isValidId = s: (dotCount s) >= 2; # matches the error you're seeing: "at least 2 periods"
|
||||||
|
|
||||||
|
_validate = builtins.seq _guard (
|
||||||
|
builtins.map (
|
||||||
|
id:
|
||||||
|
if isValidId id then
|
||||||
|
true
|
||||||
|
else
|
||||||
|
throw ''
|
||||||
|
${moduleName}: invalid Flatpak ID in flatpaks.conf (needs reverse-DNS with at least 2 dots)
|
||||||
|
|
||||||
|
Token : ${builtins.toJSON id}
|
||||||
|
flatpaks.conf : ${toString flatpakConfPath}
|
||||||
|
|
||||||
|
Fix: remove stray tokens/headers, or comment them out with '#'.
|
||||||
|
''
|
||||||
|
) entries
|
||||||
|
);
|
||||||
|
|
||||||
|
# Use validated entries
|
||||||
|
flatpakApps = builtins.seq _validate entries;
|
||||||
|
|
||||||
|
syncFlatpaks = pkgs.writeShellScript "sync-flatpaks" ''
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# Use the deployed config path (matches environment.etc below)
|
||||||
|
CONF="/etc/flatpak/flatpaks.conf"
|
||||||
|
if [[ -f "$CONF" ]]; then
|
||||||
|
echo "flatpak-sync: using $CONF"
|
||||||
|
else
|
||||||
|
echo "flatpak-sync: WARNING: $CONF not found, using embedded list"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! flatpak remotes --system --columns=name | grep -qx flathub; then
|
||||||
|
flatpak remote-add --system --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
|
||||||
|
fi
|
||||||
|
|
||||||
|
desired_apps=(
|
||||||
|
${lib.concatStringsSep "\n" (map (a: ''"${a}"'') flatpakApps)}
|
||||||
|
)
|
||||||
|
|
||||||
|
for app in "''${desired_apps[@]}"; do
|
||||||
|
if ! flatpak info --system "$app" >/dev/null 2>&1; then
|
||||||
|
flatpak install --system -y --noninteractive flathub "$app"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
{
|
||||||
|
services.flatpak.enable = true;
|
||||||
|
|
||||||
|
xdg.portal = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Deploy the config file for runtime visibility/debugging
|
||||||
|
environment.etc."flatpak/flatpaks.conf".source = lib.mkForce flatpakConfPath;
|
||||||
|
|
||||||
|
systemd.services.flatpak-sync = {
|
||||||
|
description = "Install Flatpak apps listed in flatpaks.conf";
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
wants = [ "network-online.target" ];
|
||||||
|
after = [ "network-online.target" ];
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
ExecStart = syncFlatpaks;
|
||||||
|
};
|
||||||
|
|
||||||
|
restartTriggers = [ flatpakConfPath ];
|
||||||
|
path = [
|
||||||
|
pkgs.flatpak
|
||||||
|
pkgs.coreutils
|
||||||
|
pkgs.gnugrep
|
||||||
|
pkgs.gnused
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
flakeRoot,
|
||||||
|
inputs,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
packagesConfPath = flakeRoot.outPath + "/assets/common/apps/packages.conf";
|
||||||
|
raw = builtins.readFile packagesConfPath;
|
||||||
|
# IMPORTANT: explicit "\n" so we never accidentally split into characters
|
||||||
|
rawLines = lib.splitString "\n" raw;
|
||||||
|
# Guard: if we accidentally split into characters, rawLines length ~= stringLength raw
|
||||||
|
_guard =
|
||||||
|
assert !(builtins.stringLength raw > 1 && builtins.length rawLines == builtins.stringLength raw);
|
||||||
|
true;
|
||||||
|
cleanLine =
|
||||||
|
l:
|
||||||
|
let
|
||||||
|
noCR = lib.replaceStrings [ "\r" ] [ "" ] l;
|
||||||
|
noInlineComment = lib.head (lib.splitString "#" noCR);
|
||||||
|
in
|
||||||
|
lib.strings.trim noInlineComment;
|
||||||
|
entries = builtins.filter (l: l != "") (map cleanLine rawLines);
|
||||||
|
resolvePkg =
|
||||||
|
name:
|
||||||
|
let
|
||||||
|
parts = lib.splitString "." name;
|
||||||
|
found = lib.attrByPath parts null pkgs;
|
||||||
|
in
|
||||||
|
if found == null then
|
||||||
|
throw ''
|
||||||
|
packages.nix: package not found in pkgs
|
||||||
|
Token : ${builtins.toJSON name}
|
||||||
|
packages.conf : ${toString packagesConfPath}
|
||||||
|
Hint : check the attribute name on search.nixos.org/packages
|
||||||
|
''
|
||||||
|
else
|
||||||
|
found;
|
||||||
|
packages = builtins.seq _guard (map resolvePkg entries);
|
||||||
|
zenBrowser = inputs.zen-browser.packages.${pkgs.stdenv.hostPlatform.system}.default;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
environment.systemPackages = packages ++ [ zenBrowser ];
|
||||||
|
}
|
||||||
@@ -35,10 +35,4 @@ in
|
|||||||
|
|
||||||
# Use the .zshrc file from assets
|
# Use the .zshrc file from assets
|
||||||
xdg.configFile."zsh/.zshrc".source = "${assetsDir}/.zshrc";
|
xdg.configFile."zsh/.zshrc".source = "${assetsDir}/.zshrc";
|
||||||
|
|
||||||
# Create symlinks or copy files from assets to XDG config
|
|
||||||
xdg.configFile."zsh/custom.zsh".source = "${assetsDir}/custom.zsh";
|
|
||||||
xdg.configFile."zsh/aliases.zsh".source = "${assetsDir}/aliases.zsh";
|
|
||||||
xdg.configFile."zsh/history.zsh".source = "${assetsDir}/history.zsh";
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,16 @@
|
|||||||
{ config, pkgs, lib, user, inputs, flakeRoot,... }:
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
user,
|
||||||
|
inputs,
|
||||||
|
flakeRoot,
|
||||||
|
...
|
||||||
|
}:
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
|
./flatpaks.nix
|
||||||
|
./packages.nix
|
||||||
./accessibility/top.nix
|
./accessibility/top.nix
|
||||||
./file_management/top.nix
|
./file_management/top.nix
|
||||||
./gaming/top.nix
|
./gaming/top.nix
|
||||||
|
|||||||
Reference in New Issue
Block a user