Compare commits

..

4 Commits

3 changed files with 38 additions and 22 deletions

View File

@ -521,6 +521,7 @@ cmp.setup {
{ name = 'luasnip' },
{ name = 'buffer' },
{ name = 'path' },
{ name = "conjure" },
-- { name = 'cmp_tabnine' },
},
}

View File

@ -77,22 +77,24 @@
};
};
};
# NOTE: This is never actually tested
"ubuntu_admin" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
./home.nix
];
extraSpecialArgs = {
myLib = lib;
myHome = {
username = "ubuntu_admin";
homeDirectory = "/home/ubuntu_admin";
shellInitExtra = ''
'' + x11_wsl;
};
};
};
# NOTE: This is never actually tested. This is for Ubuntu@Felia
# "ubuntu_admin" = home-manager.lib.homeManagerConfiguration {
# inherit pkgs;
# modules = [
# ./home.nix
# ];
# extraSpecialArgs = {
# myLib = lib;
# myHome = {
# username = "ubuntu_admin";
# homeDirectory = "/home/ubuntu_admin";
# shellInitExtra = ''
# '' + x11_wsl;
# };
# };
# };
# Personal laptop
hwtr = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [

View File

@ -1,6 +1,6 @@
# myHome is injected from extraSpecialArgs in flake.nix
{ config
, pkgs
, pkgs # This is by default just ``= import <nixpkgs>{}`
, myHome
, ...
}:
@ -28,7 +28,19 @@ let
# ]))
];
proj_root = builtins.toString ./../..;
# TODO: put this in a seperate library
# callPackage supports both PATH and function as first param!
# TODO: support yaml string with writeTextFile (provided by callPackge)
yamlToJsonDrv = yamlContent: outputPath: pkgs.callPackage ({ runCommand }:
# runCommand source: https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/trivial-builders.nix#L33
runCommand outputPath { inherit yamlContent; nativeBuildInputs = [ pkgs.yq ]; }
# run yq which outputs '.' (no filter) on file at yamlPath
# note that $out is passed onto the bash/sh script for execution
''
echo "$yamlContent" | yq >$out
'') { };
# fromYamlPath = yamlPath: builtins.fromJSON (builtins.readFile (yamlToJsonDrv yamlPath "any-output.json"));
fromYaml = yamlContent: builtins.fromJSON (builtins.readFile (yamlToJsonDrv yamlContent "any_output.json"));
in
{
home = {
@ -63,9 +75,9 @@ in
] ++ (myHome.packages or [ ]) ++ nvim_pkgs);
## Configs ##
xdg.configFile."nvim/init.lua".text = builtins.readFile "${proj_root}//neovim/init.lua";
xdg.configFile."starship.toml".text = builtins.readFile "${proj_root}//starship/starship.toml";
xdg.configFile."zk/config.toml".text = builtins.readFile "${proj_root}//zk/config.toml";
xdg.configFile."nvim/init.lua".source = "${proj_root}//neovim/init.lua";
xdg.configFile."starship.toml".source = "${proj_root}//starship/starship.toml";
xdg.configFile."zk/config.toml".source = "${proj_root}//zk/config.toml";
## Programs ##
programs.jq = {
@ -74,6 +86,7 @@ in
programs.alacritty = myHome.programs.alacritty or {
enable = true;
# settings = myLib.fromYaml (builtins.readFile "${proj_root}/alacritty/alacritty.yml");
settings = fromYaml (builtins.readFile "${proj_root}//alacritty/alacritty.yml");
};
# nix: Propagates the environment with packages and vars when enter (children of)
# a directory with shell.nix-compatible and .envrc