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" "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": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -36,7 +51,41 @@
"type": "github" "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": { "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": { "locked": {
"lastModified": 1667629849, "lastModified": 1667629849,
"narHash": "sha256-P+v+nDOFWicM4wziFK9S/ajF2lc0N2Rg9p6Y35uMoZI=", "narHash": "sha256-P+v+nDOFWicM4wziFK9S/ajF2lc0N2Rg9p6Y35uMoZI=",
@ -56,7 +105,8 @@
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"home-manager": "home-manager", "home-manager": "home-manager",
"nixpkgs": "nixpkgs" "nixgl": "nixgl",
"nixpkgs": "nixpkgs_2"
} }
}, },
"utils": { "utils": {

View File

@ -7,49 +7,57 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
nixgl.url = "github:guibou/nixGL";
}; };
outputs = { nixpkgs, home-manager, ... }: outputs = { nixpkgs, home-manager, nixgl, ... }:
let let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system}.appendOverlays [nixgl.overlay];
in in
{ {
homeConfigurations.nixos = home-manager.lib.homeManagerConfiguration { homeConfigurations.nixos = home-manager.lib.homeManagerConfiguration {
inherit pkgs; inherit pkgs;
modules = [ modules = [
./home.nix ./home.nix
{
home = {
username = "nixos";
homeDirectory = "/home/nixos";
};
}
]; ];
# 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 { homeConfigurations.ubuntu_admin = home-manager.lib.homeManagerConfiguration {
inherit pkgs; inherit pkgs;
modules = [ modules = [
./home.nix ./home.nix
{
home = {
username = "ubuntu_admin";
homeDirectory = "/home/ubuntu_admin";
};
}
]; ];
extraSpecialArgs = {
myHome = {
username = "ubuntu_admin";
homeDirectory = "/home/ubuntu_admin";
};
};
}; };
homeConfigurations.hwtr = home-manager.lib.homeManagerConfiguration { homeConfigurations.hwtr = home-manager.lib.homeManagerConfiguration {
inherit pkgs; inherit pkgs;
modules = [ modules = [
./home.nix ./home.nix
{
home = {
username = "hwtr";
homeDirectory = "/home/hwtr";
};
}
]; ];
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 = {
home.homeDirectory = "/home/nixos"; username = myHome.username;
homeDirectory = myHome.homeDirectory;
stateVersion = myHome.stateVersion or "22.05";
};
home.packages = [ home.packages = [
pkgs.htop pkgs.ripgrep pkgs.gcc pkgs.fd pkgs.zk pkgs.unzip pkgs.htop pkgs.ripgrep pkgs.gcc pkgs.fd pkgs.zk pkgs.unzip
pkgs.rustc pkgs.cargo pkgs.nodejs-18_x pkgs.rustc pkgs.cargo pkgs.nodejs-18_x
]; ] ++ (myHome.packages or []);
home.stateVersion = "22.05";
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
## Configs ## ## Configs ##
@ -15,7 +17,7 @@
xdg.configFile."starship.toml".text = builtins.readFile ../starship/starship.toml; xdg.configFile."starship.toml".text = builtins.readFile ../starship/starship.toml;
## Programs ## ## Programs ##
programs.alacritty = { programs.alacritty = myHome.programs.alacritty or {
enable = true; enable = true;
}; };
programs.direnv = { programs.direnv = {
@ -56,7 +58,7 @@
shellAliases = { shellAliases = {
nix-rebuild = "sudo nixos-rebuild switch"; nix-rebuild = "sudo nixos-rebuild switch";
hm-switch = "home-manager switch --flake"; hm-switch = "home-manager switch --flake";
}; } // (myHome.shellAliases or {});
history = { history = {
size = 10000; size = 10000;
path = "${config.xdg.dataHome}/zsh/history"; 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