feat: add nixgl which allows alacritty to be invoked for hwtr

nix-components
pegasust 2022-11-08 12:14:47 -07:00
parent 1df2c89a5a
commit 15c86c575f
5 changed files with 92 additions and 35 deletions

View File

@ -15,6 +15,21 @@
"type": "github"
}
},
"flake-utils_2": {
"locked": {
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@ -36,7 +51,41 @@
"type": "github"
}
},
"nixgl": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1661367362,
"narHash": "sha256-Qc8MXcV+YCPREu8kk6oggk23ZBKLqeQRAIsLbHEviPE=",
"owner": "guibou",
"repo": "nixGL",
"rev": "7165ffbccbd2cf4379b6cd6d2edd1620a427e5ae",
"type": "github"
},
"original": {
"owner": "guibou",
"repo": "nixGL",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1660551188,
"narHash": "sha256-a1LARMMYQ8DPx1BgoI/UN4bXe12hhZkCNqdxNi6uS0g=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "441dc5d512153039f19ef198e662e4f3dbb9fd65",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1667629849,
"narHash": "sha256-P+v+nDOFWicM4wziFK9S/ajF2lc0N2Rg9p6Y35uMoZI=",
@ -56,7 +105,8 @@
"inputs": {
"flake-utils": "flake-utils",
"home-manager": "home-manager",
"nixpkgs": "nixpkgs"
"nixgl": "nixgl",
"nixpkgs": "nixpkgs_2"
}
},
"utils": {

View File

@ -7,49 +7,57 @@
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
nixgl.url = "github:guibou/nixGL";
};
outputs = { nixpkgs, home-manager, ... }:
outputs = { nixpkgs, home-manager, nixgl, ... }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
pkgs = nixpkgs.legacyPackages.${system}.appendOverlays [nixgl.overlay];
in
{
homeConfigurations.nixos = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
./home.nix
{
home = {
];
# 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 = {
myHome = {
username = "nixos";
homeDirectory = "/home/nixos";
};
}
];
};
};
homeConfigurations.ubuntu_admin = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
./home.nix
{
home = {
];
extraSpecialArgs = {
myHome = {
username = "ubuntu_admin";
homeDirectory = "/home/ubuntu_admin";
};
}
];
};
};
homeConfigurations.hwtr = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
./home.nix
{
home = {
];
extraSpecialArgs = {
myHome = {
username = "hwtr";
homeDirectory = "/home/hwtr";
packages = [pkgs.nixgl.nixGLIntel];
shellAliases = {
nixGL = "nixGLIntel";
};
};
};
}
];
};
};
}

View File

@ -1,13 +1,15 @@
{ config, pkgs,... }:
# myHome is injected from extraSpecialArgs in flake.nix
{ config, pkgs, myHome, ... }:
{
home.username = "nixos";
home.homeDirectory = "/home/nixos";
home = {
username = myHome.username;
homeDirectory = myHome.homeDirectory;
stateVersion = myHome.stateVersion or "22.05";
};
home.packages = [
pkgs.htop pkgs.ripgrep pkgs.gcc pkgs.fd pkgs.zk pkgs.unzip
pkgs.rustc pkgs.cargo pkgs.nodejs-18_x
];
home.stateVersion = "22.05";
] ++ (myHome.packages or []);
nixpkgs.config.allowUnfree = true;
## Configs ##
@ -15,7 +17,7 @@
xdg.configFile."starship.toml".text = builtins.readFile ../starship/starship.toml;
## Programs ##
programs.alacritty = {
programs.alacritty = myHome.programs.alacritty or {
enable = true;
};
programs.direnv = {
@ -56,7 +58,7 @@
shellAliases = {
nix-rebuild = "sudo nixos-rebuild switch";
hm-switch = "home-manager switch --flake";
};
} // (myHome.shellAliases or {});
history = {
size = 10000;
path = "${config.xdg.dataHome}/zsh/history";

View File

@ -1,6 +0,0 @@
{ config, pkgs,... }@input:
{
home.user = "hwtr";
home.homeDirectory = "/home/hwtr";
module = [./../common];
}

3
home-nix/hwtr/nix.conf Normal file
View File

@ -0,0 +1,3 @@
accept-flake-config = true
experimental-features = nix-command flakes