2022-11-06 20:23:10 +00:00
|
|
|
{
|
2023-01-15 09:54:40 +00:00
|
|
|
nixConfig = {
|
|
|
|
accept-flake-config = true;
|
|
|
|
experimental-features = "nix-command flakes";
|
2023-01-19 21:30:25 +00:00
|
|
|
extra-substituters = [
|
|
|
|
"https://nix-community.cachix.org"
|
|
|
|
"https://cache.nixos.org"
|
|
|
|
];
|
|
|
|
extra-trusted-public-keys = [
|
|
|
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
|
|
|
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
|
|
|
|
];
|
2023-03-24 16:39:29 +00:00
|
|
|
max-jobs = 12;
|
2023-01-15 09:54:40 +00:00
|
|
|
};
|
2022-11-06 20:23:10 +00:00
|
|
|
description = "simple home-manager config";
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
2023-06-13 06:58:03 +00:00
|
|
|
nixpkgs-latest.url = "github:nixos/nixpkgs";
|
2022-11-06 20:23:10 +00:00
|
|
|
home-manager = {
|
2023-04-02 06:35:11 +00:00
|
|
|
url = "github:nix-community/home-manager";
|
2023-06-16 23:12:54 +00:00
|
|
|
# url = "github:pegasust/home-manager/starship-config-type";
|
|
|
|
follows = "nixpkgs";
|
2022-11-06 20:23:10 +00:00
|
|
|
};
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
2023-01-03 20:10:04 +00:00
|
|
|
nixgl.url = "path:./../../out-of-tree/nixGL";
|
2022-11-09 11:35:28 +00:00
|
|
|
rust-overlay.url = "github:oxalica/rust-overlay";
|
2022-12-14 20:39:13 +00:00
|
|
|
# Allows default.nix to call onto flake.nix. Useful for nix eval and automations
|
|
|
|
flake-compat = {
|
2023-01-15 08:45:51 +00:00
|
|
|
url = "path:../../out-of-tree/flake-compat";
|
2022-12-14 20:39:13 +00:00
|
|
|
flake = false;
|
|
|
|
};
|
2023-03-24 16:39:29 +00:00
|
|
|
nix-boost.url = "git+https://git.pegasust.com/pegasust/nix-boost.git";
|
2022-12-30 14:10:55 +00:00
|
|
|
kpcli-py = {
|
|
|
|
url = "github:rebkwok/kpcli";
|
|
|
|
flake = false;
|
|
|
|
};
|
2023-01-12 01:55:28 +00:00
|
|
|
neovim-nightly-overlay = {
|
2023-05-16 16:26:57 +00:00
|
|
|
url = "github:nix-community/neovim-nightly-overlay?rev=88a6c749a7d126c49f3374f9f28ca452ea9419b8";
|
2023-01-12 01:55:28 +00:00
|
|
|
};
|
2023-01-14 12:42:40 +00:00
|
|
|
nix-index-database = {
|
|
|
|
url = "github:mic92/nix-index-database";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2022-11-06 20:23:10 +00:00
|
|
|
};
|
|
|
|
|
2023-06-18 00:46:31 +00:00
|
|
|
outputs = flake_inputs @ {
|
|
|
|
nixpkgs,
|
|
|
|
home-manager,
|
|
|
|
nixgl,
|
|
|
|
rust-overlay,
|
|
|
|
flake-utils,
|
|
|
|
kpcli-py,
|
|
|
|
neovim-nightly-overlay,
|
|
|
|
nix-boost,
|
|
|
|
nixpkgs-latest,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
# config_fn:: system -> config
|
|
|
|
cross_platform = config_fn: {
|
|
|
|
packages =
|
|
|
|
builtins.foldl'
|
|
|
|
(prev: system:
|
|
|
|
prev
|
|
|
|
// {
|
2023-01-13 06:42:21 +00:00
|
|
|
"${system}" = config_fn system;
|
|
|
|
})
|
2023-06-18 00:46:31 +00:00
|
|
|
{}
|
|
|
|
flake-utils.lib.defaultSystems;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
cross_platform (system: let
|
|
|
|
overlays = import ./overlays.nix (flake_inputs // {inherit system;});
|
2022-11-09 11:35:28 +00:00
|
|
|
# pkgs = nixpkgs.legacyPackages.${system}.appendOverlays overlays;
|
2022-12-01 02:17:06 +00:00
|
|
|
pkgs = import nixpkgs {
|
|
|
|
inherit system overlays;
|
2023-06-18 00:46:31 +00:00
|
|
|
config = {allowUnfree = true;};
|
2022-12-01 02:17:06 +00:00
|
|
|
};
|
2022-12-11 00:00:49 +00:00
|
|
|
# lib = (import ../lib { inherit pkgs; lib = pkgs.lib; });
|
2023-01-15 09:54:40 +00:00
|
|
|
base = import ./base flake_inputs;
|
2022-12-11 01:46:05 +00:00
|
|
|
inherit (base) mkModuleArgs;
|
2023-01-13 06:42:21 +00:00
|
|
|
|
2023-06-18 00:46:31 +00:00
|
|
|
nerd_font_module = {
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: {
|
2022-12-21 11:18:01 +00:00
|
|
|
fonts.fontconfig.enable = true;
|
2022-12-21 22:49:03 +00:00
|
|
|
home.packages = [
|
2023-06-12 04:21:01 +00:00
|
|
|
# list of fonts are available at https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/data/fonts/nerdfonts/shas.nix
|
2023-06-18 00:46:31 +00:00
|
|
|
(pkgs.nerdfonts.override {fonts = ["Hack"];})
|
2022-12-21 22:49:03 +00:00
|
|
|
];
|
2023-06-12 04:21:01 +00:00
|
|
|
base.alacritty.font.family = "Hack Nerd Font Mono";
|
2022-12-21 11:18:01 +00:00
|
|
|
};
|
2023-06-18 00:46:31 +00:00
|
|
|
in {
|
2022-12-30 08:45:15 +00:00
|
|
|
debug = {
|
|
|
|
inherit overlays pkgs base;
|
|
|
|
};
|
2023-06-18 00:46:31 +00:00
|
|
|
homeConfigurations = let
|
|
|
|
x11_wsl = ''
|
|
|
|
# x11 output for WSL
|
|
|
|
export DISPLAY=$(ip route list default | awk '{print $3}'):0
|
|
|
|
export LIBGL_ALWAYS_INDIRECT=1
|
|
|
|
'';
|
|
|
|
in {
|
|
|
|
"hungtr" = home-manager.lib.homeManagerConfiguration {
|
|
|
|
inherit pkgs;
|
|
|
|
modules =
|
|
|
|
base.modules
|
|
|
|
++ [
|
2022-11-14 20:56:23 +00:00
|
|
|
./home.nix
|
|
|
|
];
|
2023-06-18 00:46:31 +00:00
|
|
|
# optionally pass inarguments to module
|
|
|
|
# we migrate this from in-place modules to allow flexibility
|
|
|
|
# in this case, we can add "home" to input arglist of home.nix
|
|
|
|
extraSpecialArgs = mkModuleArgs {
|
|
|
|
inherit pkgs;
|
|
|
|
myHome = {
|
|
|
|
username = "hungtr";
|
|
|
|
homeDirectory = "/home/hungtr";
|
2022-11-14 20:56:23 +00:00
|
|
|
};
|
2022-11-14 07:50:02 +00:00
|
|
|
};
|
2023-06-18 00:46:31 +00:00
|
|
|
};
|
|
|
|
"hungtr@bao" = home-manager.lib.homeManagerConfiguration {
|
|
|
|
inherit pkgs;
|
|
|
|
modules =
|
|
|
|
base.modules
|
|
|
|
++ [
|
2022-12-21 11:18:01 +00:00
|
|
|
./home.nix
|
2023-01-14 14:37:40 +00:00
|
|
|
nerd_font_module
|
2022-12-28 02:08:07 +00:00
|
|
|
./base/productive_desktop.nix
|
2023-01-13 00:33:53 +00:00
|
|
|
{
|
|
|
|
# since home.nix forces us to use keepass, and base.keepass.path
|
|
|
|
# defaults to a bad value (on purpose), we should configure a
|
|
|
|
# it to be the proper path
|
|
|
|
base.keepass.path = "/perso/garden/keepass.kdbx";
|
2023-01-13 07:24:32 +00:00
|
|
|
base.graphics.useNixGL.defaultPackage = "nixGLNvidia";
|
2023-01-14 12:42:40 +00:00
|
|
|
base.graphics.useNixGL.enable = true;
|
2023-01-13 00:33:53 +00:00
|
|
|
}
|
2022-12-21 11:18:01 +00:00
|
|
|
];
|
2023-06-18 00:46:31 +00:00
|
|
|
# optionally pass inarguments to module
|
|
|
|
# we migrate this from in-place modules to allow flexibility
|
|
|
|
# in this case, we can add "home" to input arglist of home.nix
|
|
|
|
extraSpecialArgs = mkModuleArgs {
|
|
|
|
inherit pkgs;
|
|
|
|
myHome = {
|
|
|
|
username = "hungtr";
|
|
|
|
homeDirectory = "/home/hungtr";
|
2022-12-21 11:18:01 +00:00
|
|
|
};
|
|
|
|
};
|
2023-06-18 00:46:31 +00:00
|
|
|
};
|
|
|
|
# Personal darwin, effectively serves as the Darwin edge channel
|
|
|
|
"hungtran" = home-manager.lib.homeManagerConfiguration {
|
|
|
|
inherit pkgs;
|
|
|
|
modules =
|
|
|
|
base.modules
|
|
|
|
++ [
|
2023-01-15 08:45:51 +00:00
|
|
|
./home.nix
|
|
|
|
{
|
|
|
|
base.graphics.enable = false;
|
|
|
|
# don't want to deal with GL stuffs on mac yet :/
|
|
|
|
base.graphics.useNixGL.defaultPackage = null;
|
|
|
|
# NOTE: this actually does not exist
|
2023-01-19 15:28:54 +00:00
|
|
|
base.keepass.path = "/Users/hungtran/keepass.kdbx";
|
2023-01-15 08:45:51 +00:00
|
|
|
base.alacritty.font.size = 11.0;
|
|
|
|
}
|
|
|
|
nerd_font_module
|
2023-01-19 15:28:54 +00:00
|
|
|
./base/productive_desktop.nix
|
|
|
|
{
|
|
|
|
base.private_chromium.enable = false;
|
|
|
|
}
|
2023-03-20 04:25:41 +00:00
|
|
|
{
|
|
|
|
home.packages = [
|
|
|
|
pkgs.postman
|
|
|
|
];
|
|
|
|
}
|
2023-01-15 08:45:51 +00:00
|
|
|
];
|
2023-06-18 00:46:31 +00:00
|
|
|
extraSpecialArgs = mkModuleArgs {
|
|
|
|
inherit pkgs;
|
|
|
|
myHome = {
|
|
|
|
username = "hungtran";
|
|
|
|
homeDirectory = "/Users/hungtran";
|
2023-01-15 08:45:51 +00:00
|
|
|
};
|
|
|
|
};
|
2023-06-18 00:46:31 +00:00
|
|
|
};
|
|
|
|
# Work darwin
|
|
|
|
"htran" = home-manager.lib.homeManagerConfiguration {
|
|
|
|
inherit pkgs;
|
|
|
|
modules =
|
|
|
|
base.modules
|
|
|
|
++ [
|
2023-01-13 06:47:43 +00:00
|
|
|
./home.nix
|
2023-02-04 21:48:08 +00:00
|
|
|
./base/productive_desktop.nix
|
2023-06-15 19:46:01 +00:00
|
|
|
./base/darwin-spotlight.nix
|
2023-02-04 21:48:08 +00:00
|
|
|
{
|
|
|
|
base.private_chromium.enable = false;
|
|
|
|
}
|
2023-06-12 04:21:01 +00:00
|
|
|
nerd_font_module
|
2023-01-13 06:47:43 +00:00
|
|
|
{
|
|
|
|
base.graphics.enable = false;
|
2023-01-14 14:37:40 +00:00
|
|
|
# don't want to deal with GL stuffs on mac yet :/
|
2023-01-13 06:56:58 +00:00
|
|
|
base.graphics.useNixGL.defaultPackage = null;
|
2023-01-14 14:37:40 +00:00
|
|
|
base.alacritty.font.size = 11.0;
|
2023-01-19 21:32:03 +00:00
|
|
|
base.git.name = "Hung";
|
|
|
|
base.git.email = "htran@egihosting.com";
|
2023-01-13 06:47:43 +00:00
|
|
|
}
|
2023-02-28 19:04:25 +00:00
|
|
|
{
|
|
|
|
home.packages = [
|
|
|
|
pkgs.postman
|
|
|
|
];
|
|
|
|
}
|
2023-06-18 00:46:31 +00:00
|
|
|
{base.keepass.enable = pkgs.lib.mkForce false;}
|
2023-01-13 06:47:43 +00:00
|
|
|
];
|
2023-06-18 00:46:31 +00:00
|
|
|
extraSpecialArgs = mkModuleArgs {
|
|
|
|
inherit pkgs;
|
|
|
|
myHome = {
|
|
|
|
username = "htran";
|
|
|
|
homeDirectory = "/Users/htran";
|
2023-01-13 06:47:43 +00:00
|
|
|
};
|
|
|
|
};
|
2023-06-18 00:46:31 +00:00
|
|
|
};
|
|
|
|
"nixos@Felia" = home-manager.lib.homeManagerConfiguration {
|
|
|
|
inherit pkgs;
|
|
|
|
modules = [
|
|
|
|
./home.nix
|
|
|
|
{
|
|
|
|
base.shells = {
|
|
|
|
shellInitExtra =
|
|
|
|
''
|
|
|
|
''
|
|
|
|
+ x11_wsl;
|
2022-11-14 20:56:23 +00:00
|
|
|
};
|
2023-06-18 00:46:31 +00:00
|
|
|
}
|
|
|
|
];
|
|
|
|
# optionally pass inarguments to module
|
|
|
|
# we migrate this from in-place modules to allow flexibility
|
|
|
|
# in this case, we can add "home" to input arglist of home.nix
|
|
|
|
extraSpecialArgs = mkModuleArgs {
|
|
|
|
inherit pkgs;
|
|
|
|
myHome = {
|
|
|
|
username = "nixos";
|
|
|
|
homeDirectory = "/home/nixos";
|
2022-11-14 20:56:23 +00:00
|
|
|
};
|
2022-11-08 19:14:47 +00:00
|
|
|
};
|
2023-06-18 00:46:31 +00:00
|
|
|
};
|
|
|
|
# Personal laptop
|
|
|
|
hwtr = home-manager.lib.homeManagerConfiguration {
|
|
|
|
inherit pkgs;
|
|
|
|
modules =
|
|
|
|
base.modules
|
|
|
|
++ [
|
2022-11-14 20:56:23 +00:00
|
|
|
./home.nix
|
2022-12-30 08:45:15 +00:00
|
|
|
./base/graphics.nix
|
2022-12-11 00:00:49 +00:00
|
|
|
{
|
2022-12-30 08:45:15 +00:00
|
|
|
base.graphics.enable = true;
|
2022-12-11 00:00:49 +00:00
|
|
|
base.alacritty.font.family = "BitstreamVeraSansMono Nerd Font";
|
2022-12-30 14:10:55 +00:00
|
|
|
base.keepass.path = "/media/homelab/f/PersistentHotStorage/keepass.kdbx";
|
2022-12-11 00:00:49 +00:00
|
|
|
}
|
2023-01-12 19:34:30 +00:00
|
|
|
./base/productive_desktop.nix
|
2022-11-14 20:56:23 +00:00
|
|
|
];
|
2023-01-13 06:42:21 +00:00
|
|
|
|
2023-06-18 00:46:31 +00:00
|
|
|
extraSpecialArgs = mkModuleArgs {
|
|
|
|
inherit pkgs;
|
|
|
|
myHome = {
|
|
|
|
username = "hwtr";
|
|
|
|
homeDirectory = "/home/hwtr";
|
|
|
|
packages = [
|
|
|
|
pkgs.postman
|
|
|
|
];
|
2022-11-08 19:14:47 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2023-06-18 00:46:31 +00:00
|
|
|
};
|
2023-01-13 06:42:21 +00:00
|
|
|
});
|
2022-11-06 20:23:10 +00:00
|
|
|
}
|