Skip to content

Commit

Permalink
add gbrowse shortcut and reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
vinnymeller committed May 2, 2024
1 parent 2eec0b9 commit 49a4b8f
Show file tree
Hide file tree
Showing 46 changed files with 1,090 additions and 811 deletions.
2 changes: 1 addition & 1 deletion dotfiles/nvim/lua/plugins/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ local languages = {
require("efmls-configs.formatters.rustfmt"),
},
nix = {
require("efmls-configs.formatters.alejandra"),
require("efmls-configs.formatters.nixfmt"),
},
sh = {
require("efmls-configs.formatters.shfmt"),
Expand Down
2 changes: 2 additions & 0 deletions dotfiles/nvim/lua/plugins/vim-fugitive.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ map("n", "<leader>g<C-s>", "<cmd>Git status<CR>", { desc = "[G]it [S]tatus" })
map("n", "<leader>gr", "<cmd>Git restore %<CR>", { desc = "[G]it [R]estore current file" })
map("n", "<leader>gR", "<cmd>Git restore .<CR>", { desc = "[G]it [R]estore all files" })
map("n", "<leader>gP", "<cmd>Git pull<CR>", { desc = "[G]it [P]ull" })
map("n", "<leader>go", "<cmd>GBrowse!<CR>:GBrowse<CR>", { desc = "[G]it [O]pen in browser" })
map("v", "<leader>go", "<cmd>GBrowse!<CR>gv:GBrowse<CR>", { desc = "[G]it [O]pen in browser" })
43 changes: 28 additions & 15 deletions dotfiles/qtile/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,32 @@

inputs.flake-utils.url = "github:numtide/flake-utils";

outputs = {
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
python-pkgs =
pkgs.python3.withPackages (ps: with ps; [black mypy qtile]);
in {
devShells.default = pkgs.mkShell rec {
name = "qtileDevEnv";
packages = with pkgs; [python-pkgs qtile];
};
});
outputs =
{
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
python-pkgs = pkgs.python3.withPackages (
ps: with ps; [
black
mypy
qtile
]
);
in
{
devShells.default = pkgs.mkShell rec {
name = "qtileDevEnv";
packages = with pkgs; [
python-pkgs
qtile
];
};
}
);
}
97 changes: 49 additions & 48 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,55 +47,56 @@
};
};

outputs = inputs @ {
self,
flake-utils,
nixpkgs,
nixpkgs-master,
nixpkgs-stable,
nix-index-database,
home-manager,
lanzaboote,
nixCats,
...
}: let
inherit (self) outputs;

forAllSystems =
nixpkgs.lib.genAttrs
flake-utils.lib.defaultSystems; # change this if i need some weird systems

myNixCats = import ./programs/ncvim {inherit inputs;};
in {
myNixCats = myNixCats;

packages =
forAllSystems (
system: let
outputs =
inputs@{
self,
flake-utils,
nixpkgs,
nixpkgs-master,
nixpkgs-stable,
nix-index-database,
home-manager,
lanzaboote,
nixCats,
...
}:
let
inherit (self) outputs;

forAllSystems = nixpkgs.lib.genAttrs flake-utils.lib.defaultSystems; # change this if i need some weird systems

myNixCats = import ./programs/ncvim { inherit inputs; };
in
{
myNixCats = myNixCats;

packages =
forAllSystems (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
import ./pkgs { inherit pkgs; }
)
// myNixCats.packages;

devShells = forAllSystems (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
import ./pkgs {inherit pkgs;}
)
// myNixCats.packages;

devShells = forAllSystems (
system: let
pkgs = nixpkgs.legacyPackages.${system};
in
import ./shell.nix {inherit pkgs;}
);

overlays = import ./overlays {inherit inputs;};

nixosConfigurations = {
vinnix = import ./hosts/vinnix {inherit inputs outputs;};
vindows = import ./hosts/home-wsl {inherit inputs outputs;};
import ./shell.nix { inherit pkgs; }
);

overlays = import ./overlays { inherit inputs; };

nixosConfigurations = {
vinnix = import ./hosts/vinnix { inherit inputs outputs; };
vindows = import ./hosts/home-wsl { inherit inputs outputs; };
};
homeConfigurations = {
"vinny@wdtech-eos" = import ./hosts/wdtech-eos { inherit inputs outputs; };
"vinny@camovinny" = import ./hosts/camovinny { inherit inputs outputs; };
};
};
homeConfigurations = {
"vinny@wdtech-eos" =
import ./hosts/wdtech-eos {inherit inputs outputs;};
"vinny@camovinny" =
import ./hosts/camovinny {inherit inputs outputs;};
};
};
}
8 changes: 6 additions & 2 deletions hosts/camovinny/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
inputs.home-manager.lib.homeManagerConfiguration {
pkgs = import inputs.nixpkgs {
system = "aarch64-darwin";
config = { allowUnfree = true; };
config = {
allowUnfree = true;
};
};
extraSpecialArgs = {
inherit inputs outputs;
};
extraSpecialArgs = { inherit inputs outputs; };
modules = [ ./home.nix ];
}
22 changes: 15 additions & 7 deletions hosts/camovinny/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
outputs,
pkgs,
...
}: let
cust_pkgs = import ../../pkgs {inherit pkgs;};
in {
}:
let
cust_pkgs = import ../../pkgs { inherit pkgs; };
in
{
imports = [
../../programs/zsh
../../programs/git
Expand All @@ -22,15 +24,21 @@ in {
allowUnfree = true;
};
nix.package = pkgs.nixFlakes;
nix.settings.experimental-features = ["nix-command" "flakes"];
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
nix.settings.auto-optimise-store = true;
nix.settings.require-sigs = false;
nix.settings.trusted-users = ["vinny" "root"];
nix.settings.trusted-public-keys = ["vinnix:xCPWQjVNXvqsEJgdEhUMpmVIyJseAPAcZEm3b6HU8vk="];
nix.settings.trusted-users = [
"vinny"
"root"
];
nix.settings.trusted-public-keys = [ "vinnix:xCPWQjVNXvqsEJgdEhUMpmVIyJseAPAcZEm3b6HU8vk=" ];

nixCats = {
enable = true;
packageNames = ["nixCats"];
packageNames = [ "nixCats" ];
};

home.packages = with pkgs; [
Expand Down
21 changes: 15 additions & 6 deletions hosts/home-wsl/configuration.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
modulesPath,
...
}:
with lib; let
with lib;
let
nixos-wsl = import ./nixos-wsl;
in {
in
{
imports = [
"${modulesPath}/profiles/minimal.nix"

Expand Down Expand Up @@ -37,22 +39,25 @@ in {
nixpkgs.config.allowBroken = true;
# Enable nix flakes
nix.package = pkgs.nixFlakes;
nix.settings.experimental-features = ["nix-command" "flakes"];
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
nix.gc.automatic = true;
nix.settings.auto-optimise-store = true;
nix.gc.options = "--delete-older-than 14d";

boot.kernelPackages = pkgs.linuxPackages_latest;

services.xserver.videoDrivers = ["nvidia"];
services.xserver.videoDrivers = [ "nvidia" ];
hardware.opengl.enable = true;

security.polkit.enable = true;

users.users.vinny = {
isNormalUser = true;
initialPassword = "passwordington";
extraGroups = ["wheel"];
extraGroups = [ "wheel" ];
shell = pkgs.zsh;
};
programs.zsh = {
Expand All @@ -61,7 +66,11 @@ in {
};
networking.hostName = "home-nix-wsl"; # Define your hostname.

environment.systemPackages = with pkgs; [git vim neovim];
environment.systemPackages = with pkgs; [
git
vim
neovim
];
nixpkgs.config.allowUnfree = true;
system.stateVersion = "22.05";
}
8 changes: 6 additions & 2 deletions hosts/home-wsl/default.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
{ inputs, outputs, ... }:

inputs.nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs; };
specialArgs = {
inherit inputs outputs;
};
modules = [
./configuration.nix
inputs.home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.vinny = import ./home.nix;
home-manager.extraSpecialArgs = {inherit inputs outputs;};
home-manager.extraSpecialArgs = {
inherit inputs outputs;
};
}
];
}
25 changes: 18 additions & 7 deletions hosts/home-wsl/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
lib,
outputs,
...
}: let
cust_pkgs = import ../../pkgs {inherit pkgs;};
in {
}:
let
cust_pkgs = import ../../pkgs { inherit pkgs; };
in
{
imports = [
../../programs/zsh
../../programs/git
Expand All @@ -16,11 +18,18 @@ in {

nixCats = {
enable = true;
packageNames = ["nixCats"];
packageNames = [ "nixCats" ];
};

home.packages = with pkgs;
[openvpn mesa kubectl helm] ++ builtins.attrValues cust_pkgs;
home.packages =
with pkgs;
[
openvpn
mesa
kubectl
helm
]
++ builtins.attrValues cust_pkgs;

programs.direnv.enable = true;
programs.direnv.nix-direnv.enable = true;
Expand All @@ -31,5 +40,7 @@ in {

programs.home-manager.enable = true;

programs.zsh.sessionVariables = {TMUX_TMPDIR = "/tmp";};
programs.zsh.sessionVariables = {
TMUX_TMPDIR = "/tmp";
};
}
16 changes: 10 additions & 6 deletions hosts/home-wsl/nixos-wsl/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
(import (let lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in fetchTarball {
url =
"https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}) { src = ./.; }).defaultNix
(import (
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in
fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}
) { src = ./.; }).defaultNix

Loading

0 comments on commit 49a4b8f

Please sign in to comment.