refactor: use inputs.self instead of rel. paths

This commit is contained in:
Swarsel 2024-12-05 02:36:25 +01:00
parent 83bc6af1f6
commit 33046cb4a3
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
19 changed files with 1067 additions and 1711 deletions

View file

@ -1,6 +1,7 @@
{ lib, pkgs, config, ... }:
_:
{
imports = [
imports = [
./settings.nix
./packages.nix
./custom-packages.nix
./sops.nix
@ -34,28 +35,4 @@
./zellij.nix
./tmux.nix
];
nix = {
package = lib.mkDefault pkgs.nix;
settings = {
experimental-features = [
"nix-command"
"flakes"
"ca-derivations"
];
};
};
programs.home-manager.enable = lib.mkIf (!config.swarselsystems.isNixos) true;
home = {
username = lib.mkDefault "swarsel";
homeDirectory = lib.mkDefault "/home/${config.home.username}";
stateVersion = lib.mkDefault "23.05";
keyboard.layout = "us";
sessionVariables = {
FLAKE = "$HOME/.dotfiles";
};
};
}

View file

@ -1,11 +1,11 @@
{ pkgs, ... }:
{ self, pkgs, ... }:
{
# enable emacs overlay for bleeding edge features
# also read init.el file and install use-package packages
programs.emacs = {
enable = true;
package = pkgs.emacsWithPackagesFromUsePackage {
config = ../../../programs/emacs/init.el;
config = self + /programs/emacs/init.el;
package = pkgs.emacs-pgtk;
alwaysEnsure = true;
alwaysTangle = true;

View file

@ -1,11 +1,11 @@
{ pkgs, ... }:
{ self, pkgs, ... }:
{
programs.nix-index =
let
commandNotFound = pkgs.runCommandLocal "command-not-found.sh" { } ''
mkdir -p $out/etc/profile.d
substitute ${../../../scripts/command-not-found.sh} \
$out/etc/profile.d/command-not-found.sh \
substitute ${self + /scripts/command-not-found.sh} \
$out/etc/profile.d/command-not-found.sh \
--replace @nix-locate@ ${pkgs.nix-index}/bin/nix-locate \
--replace @tput@ ${pkgs.ncurses}/bin/tput
'';

View file

@ -0,0 +1,25 @@
{ lib, config, pkgs, ... }:
{
nix = {
package = lib.mkDefault pkgs.nix;
settings = {
experimental-features = [
"nix-command"
"flakes"
"ca-derivations"
];
};
};
programs.home-manager.enable = lib.mkIf (!config.swarselsystems.isNixos) true;
home = {
username = lib.mkDefault "swarsel";
homeDirectory = lib.mkDefault "/home/${config.home.username}";
stateVersion = lib.mkDefault "23.05";
keyboard.layout = "us";
sessionVariables = {
FLAKE = "$HOME/.dotfiles";
};
};
}

View file

@ -1,31 +1,31 @@
_:
{ self, ... }:
{
home.file = {
"init.el" = {
source = ../../../programs/emacs/init.el;
source = self + /programs/emacs/init.el;
target = ".emacs.d/init.el";
};
"early-init.el" = {
source = ../../../programs/emacs/early-init.el;
source = self + /programs/emacs/early-init.el;
target = ".emacs.d/early-init.el";
};
# on NixOS, Emacs does not find the aspell dicts easily. Write the configuration manually
".aspell.conf" = {
source = ../../../programs/config/.aspell.conf;
source = self + /programs/config/.aspell.conf;
target = ".aspell.conf";
};
".gitmessage" = {
source = ../../../programs/git/.gitmessage;
source = self + /programs/git/.gitmessage;
target = ".gitmessage";
};
"swayidle/config" = {
source = ../../../programs/swayidle/config;
source = self + /programs/swayidle/config;
target = ".config/swayidle/config";
};
};
xdg.configFile = {
"tridactyl/tridactylrc".source = ../../../programs/firefox/tridactyl/tridactylrc;
"tridactyl/themes/base16-codeschool.css".source = ../../../programs/firefox/tridactyl/themes/base16-codeschool.css;
"tridactyl/tridactylrc".source = self + /programs/firefox/tridactyl/tridactylrc;
"tridactyl/themes/base16-codeschool.css".source = self + /programs/firefox/tridactyl/themes/base16-codeschool.css;
};
}

View file

@ -1,4 +1,4 @@
{ config, lib, ... }:
{ self, config, lib, ... }:
{
programs.waybar = {
@ -259,6 +259,6 @@
};
};
};
style = builtins.readFile ../../../programs/waybar/style.css;
style = builtins.readFile (self + /programs/waybar/style.css);
};
}