Migrate explicit imports to home manager imports

That way I do not need to explicitly provide dependencies.
But home-manager will pass all the special args.
This commit is contained in:
Daniel Siepmann 2024-05-30 13:07:50 +02:00
parent 2df4d4eeae
commit d9ba963dad
Signed by: Daniel Siepmann
GPG key ID: 33D6629915560EF4
16 changed files with 751 additions and 754 deletions

View file

@ -5,10 +5,10 @@
,...
}:
let
{
_module.args = {
hostName = builtins.replaceStrings ["\n"] [""] (builtins.readFile /etc/hostname);
in {
};
imports = [
./home/modules/programs/cmus.nix
@ -16,6 +16,22 @@ in {
./home/modules/programs/languagetool.nix
./home/modules/programs/mailhog.nix
./home/modules/programs/my-pidgin.nix
./home/accounts.nix
./home/programs/nix.nix
./home/files.nix
./home/packages.nix
./home/packages/custom
./home/home.nix
./home/programs.nix
./home/xsession.nix
./home/windowManager/i3.nix
./home/xdg.nix
./home/dconf.nix
./home/qt.nix
./home/gtk.nix
./home/services.nix
./home/systemd.nix
];
disabledModules = [
@ -38,64 +54,16 @@ in {
# changes in each release.
stateVersion = "22.05";
packages = import ./home/packages.nix {
inherit pkgs hostName;
};
file = import ./home/files.nix { };
} // import ./home/home.nix {
inherit config pkgs hostName;
};
targets.genericLinux.enable = true;
accounts = import ./home/accounts.nix {
inherit config pkgs;
};
nix = import ./home/programs/nix.nix {
inherit pkgs;
};
programs = import ./home/programs.nix {
inherit config pkgs hostName;
};
fonts.fontconfig.enable = true;
xsession = import ./home/xsession.nix {
inherit config pkgs hostName;
};
xdg = import ./home/xdg.nix {
inherit pkgs;
};
dconf = import ./home/dconf.nix {
inherit lib;
};
qt = import ./home/qt.nix {
inherit pkgs;
};
gtk = import ./home/gtk.nix {
inherit config pkgs;
};
services = import ./home/services.nix {
inherit config hostName pkgs;
};
systemd.user = import ./home/systemd.nix {
inherit config pkgs;
};
nixpkgs.config = {
allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
];
permittedInsecurePackages = [
];
};
}

Binary file not shown.

View file

@ -1,8 +1,10 @@
{
lib
,...
}:
{
dconf = {
enable = true;
settings = {
"org/gtk/settings/file-chooser" = {
@ -31,4 +33,5 @@
volume = 1.0;
};
};
};
}

View file

@ -1,7 +1,9 @@
_:
{
home.file = {
".nix-channels".source = ./files/nix-channels;
".profile".source = ./files/profile;
".myclirc".source = ./files/myclirc;
};
}

View file

@ -1,6 +1,7 @@
{
config
,pkgs
,...
}:
# Possible alternatives:
@ -9,6 +10,7 @@
# And maybe use https://github.com/themix-project/oomox to adjust the color to follow my color scheme
{
gtk = {
enable = true;
theme = {
@ -43,5 +45,5 @@
gtk-application-prefer-dark-theme = 1;
gtk-enable-animations = 0;
};
};
}

View file

@ -2,6 +2,7 @@
config
,pkgs
,hostName
,...
}:
let
@ -9,7 +10,7 @@ let
deLocale = "de_DE.utf8";
in {
home = {
language = {
# English
@ -104,4 +105,5 @@ in {
};
enableNixpkgsReleaseCheck = true;
};
}

View file

@ -1,9 +1,11 @@
{
pkgs
,hostName
,...
}:
with pkgs; [
{
home.packages = with pkgs; [
nix
cacert
nvd
@ -96,6 +98,5 @@ with pkgs; [
# TODO: Right now only for Ubuntu (hikari2) system
(callPackage ./packages/custom/backup { })
(callPackage ./packages/custom/vpn-reuter-dynamics { })
]) ++ (callPackage ./packages/custom {
inherit hostName;
})
]);
}

View file

@ -1,19 +1,22 @@
{
callPackage
pkgs
,hostName
,...
}:
[
(callPackage ./dmenu-scripts { })
(callPackage ./update-system { })
(callPackage ./nextcloud-sync/from-local.nix { })
(callPackage ./nextcloud-sync/from-remote.nix { })
(callPackage ./typo3-documentation-rendering { })
(callPackage ./typo3-documentation-rendering-old { })
(callPackage ./typo3-serve-testing-instance { })
(callPackage ./typo3-push-core { })
(callPackage ./zcat-progress { })
(callPackage ./project {
{
home.packages = [
(pkgs.callPackage ./dmenu-scripts { })
(pkgs.callPackage ./update-system { })
(pkgs.callPackage ./nextcloud-sync/from-local.nix { })
(pkgs.callPackage ./nextcloud-sync/from-remote.nix { })
(pkgs.callPackage ./typo3-documentation-rendering { })
(pkgs.callPackage ./typo3-documentation-rendering-old { })
(pkgs.callPackage ./typo3-serve-testing-instance { })
(pkgs.callPackage ./typo3-push-core { })
(pkgs.callPackage ./zcat-progress { })
(pkgs.callPackage ./project {
inherit hostName;
})
]
];
}

View file

@ -2,6 +2,7 @@
config
,pkgs
,hostName
,...
}:
let
@ -10,6 +11,7 @@ let
};
in {
programs = {
# Let Home Manager install and manage itself.
home-manager.enable = true;
@ -61,4 +63,5 @@ in {
# Media
cmus.enable = true;
};
}

View file

@ -1,8 +1,10 @@
{
pkgs
,...
}:
{
nix = {
enable = true;
package = pkgs.nix;
@ -25,5 +27,5 @@
];
};
};
}

View file

@ -1,12 +1,15 @@
{
pkgs
,...
}:
{
qt = {
enable = true;
platformTheme = {
# Re use existing gtk theme
name = "gtk";
};
};
}

View file

@ -2,10 +2,11 @@
config
,hostName
,pkgs
,...
}:
{
services = {
dunst = import ./services/dunst.nix {
inherit config;
};
@ -21,8 +22,8 @@
languagetool.enable = true;
mailhog.enable = true;
} // (if hostName == "hikari" then {
network-manager-applet.enable = true;
} else {
})
});
}

View file

@ -1,9 +1,11 @@
{
config
,pkgs
,...
}:
{
systemd.user = {
services = {
batteryicon = import ./services/batteryicon.nix {
inherit pkgs;
@ -14,4 +16,5 @@
"L ${config.xdg.dataHome}/themes - - - - ${config.home.profileDirectory}/share/themes"
"L ${config.xdg.dataHome}/icons/${config.gtk.iconTheme.name} - - - - ${config.home.profileDirectory}/share/icons/${config.gtk.iconTheme.name}"
];
};
}

View file

@ -2,13 +2,14 @@
config
,pkgs
,hostName
,...
}:
# Use `xbindkeys --key` to find key name, see: https://wiki.archlinux.org/title/Xbindkeys
# Use `xset -dpms` to disable black out screen for power saving
let
modifier = config.xsession.windowManager.i3.config.modifier;
inherit(config.xsession.windowManager.i3.config) modifier;
soundSwitcherForHikari2 = if hostName == "hikari" then "" else "-D pulse";
keyboardBrightnessDevice = if hostName == "hikari" then "--device smc::kbd_backlight" else "";
@ -16,6 +17,7 @@ let
displayBuiltInOutput = if hostName == "hikari" then "eDP-1" else "eDP1";
displayDefaults = if hostName == "hikari" then "--output ${displayBuiltInOutput} --mode 1366x768 --scale 1.25x1.25" else "";
in {
xsession.windowManager.i3 = {
enable = true;
config = {
@ -378,4 +380,5 @@ in {
};
};
};
}

View file

@ -1,8 +1,10 @@
{
pkgs
,...
}:
{
xdg = {
enable = true;
configFile = {
@ -136,5 +138,5 @@
"video/quicktime" = [ "vlc.desktop" ];
};
};
};
}

View file

@ -2,6 +2,7 @@
config
,pkgs
,hostName
,...
}:
let
@ -21,6 +22,7 @@ let
xinput --set-prop 'DELL07E6:00 06CB:76AF Touchpad' 'libinput Natural Scrolling Enabled' 1
'';
in {
xsession = {
enable = true;
numlock.enable = true;
@ -38,8 +40,5 @@ in {
# Increase mouse speed
xinput --set-prop 13 'libinput Accel Speed' 1
'';
windowManager.i3 = import ./windowManager/i3.nix {
inherit config pkgs hostName;
};
}