mirror of
https://github.com/jbowdre/dotfiles.git
synced 2024-11-26 02:52:18 +00:00
Compare commits
No commits in common. "f853ed8e8f1f4da70dcb73ab2a3006fbda856d2c" and "fde8393c214f0c83a341325a6da6c5fb54f09afc" have entirely different histories.
f853ed8e8f
...
fde8393c21
14 changed files with 173 additions and 213 deletions
47
flake.lock
47
flake.lock
|
@ -7,27 +7,42 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1687871164,
|
"lastModified": 1690084763,
|
||||||
"narHash": "sha256-bBFlPthuYX322xOlpJvkjUBz0C+MOBjZdDOOJJ+G2jU=",
|
"narHash": "sha256-Nw680m/pyVoosSgXZW415Z657mfVM2BxaxDPjEk48Z0=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "07c347bb50994691d7b0095f45ebd8838cf6bc38",
|
"rev": "fb03fa5516d4e86059d24ab35a611ffa3a359547",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"ref": "release-23.05",
|
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1690271650,
|
"lastModified": 1690083312,
|
||||||
"narHash": "sha256-qwdsW8DBY1qH+9luliIH7VzgwvL+ZGI3LZWC0LTiDMI=",
|
"narHash": "sha256-I3egwgNXavad1eIjWu1kYyi0u73di/sMmlnQIuzQASk=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "6dc93f0daec55ee2f441da385aaf143863e3d671",
|
"rev": "af8cd5ded7735ca1df1a1174864daab75feeb64a",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs-23_05": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1689956312,
|
||||||
|
"narHash": "sha256-NV9yamMhE5jgz+ZSM2IgXeYqOvmGIbIIJ+AFIhfD7Ek=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "6da4bc6cb07cba1b8e53d139cbf1d2fb8061d967",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -37,27 +52,11 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs-unstable": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1690272529,
|
|
||||||
"narHash": "sha256-MakzcKXEdv/I4qJUtq/k/eG+rVmyOZLnYNC2w1mB59Y=",
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "ef99fa5c5ed624460217c31ac4271cfb5cb2502c",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nixos",
|
|
||||||
"ref": "nixos-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"nixpkgs-unstable": "nixpkgs-unstable"
|
"nixpkgs-23_05": "nixpkgs-23_05"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
97
flake.nix
97
flake.nix
|
@ -2,58 +2,89 @@
|
||||||
description = "A Very Flakey Home Manager";
|
description = "A Very Flakey Home Manager";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||||
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs-23_05.url = "github:nixos/nixpkgs/nixos-23.05";
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager/release-23.05";
|
url = "github:nix-community/home-manager";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, home-manager, ... }@inputs:
|
outputs = {nixpkgs, home-manager, ...} @inputs:
|
||||||
let
|
let
|
||||||
inherit (self) outputs;
|
# Overlays enable you to customize the Nixpkgs attribute set
|
||||||
forAllSystems = nixpkgs.lib.genAttrs [
|
overlays = [
|
||||||
|
(self: super:
|
||||||
|
let
|
||||||
|
system = self.stdenv.system;
|
||||||
|
in {
|
||||||
|
pkgs_2305 = inputs.nixpkgs-23_05.legacyPackages.${system};
|
||||||
|
pkgs_aarch64 = import nixpkgs {
|
||||||
|
system = "aarch64-${builtins.head (builtins.match ".+-([[:lower:]]+)" system)}";
|
||||||
|
};
|
||||||
|
pkgs_x86_64 = nixpkgs.legacyPackages.${"x86_64-${builtins.head (builtins.match ".+-([[:lower:]]+)" system)}"};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
# Systems supported
|
||||||
|
allSystems = [
|
||||||
"aarch64-linux"
|
"aarch64-linux"
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
importPkgs = (system: import nixpkgs {
|
||||||
|
inherit overlays system;
|
||||||
|
config.allowUnfree = true;
|
||||||
|
});
|
||||||
|
|
||||||
|
# Helper to provide system-specific attributes
|
||||||
|
forAllSystems = f: nixpkgs.lib.genAttrs allSystems (system: f {
|
||||||
|
inherit system;
|
||||||
|
pkgs = (importPkgs system);
|
||||||
|
});
|
||||||
|
|
||||||
in
|
in
|
||||||
rec {
|
rec {
|
||||||
packages = forAllSystems (system:
|
inherit allSystems importPkgs forAllSystems home-manager;
|
||||||
let pkgs = nixpkgs.legacyPackages.${system};
|
|
||||||
in import ./nix/pkgs { inherit pkgs; }
|
|
||||||
);
|
|
||||||
|
|
||||||
devShells = forAllSystems (system:
|
overlays = { };
|
||||||
let pkgs = nixpkgs.legacyPackages.${system};
|
|
||||||
in import ./nix/shell.nix { inherit pkgs; }
|
|
||||||
);
|
|
||||||
|
|
||||||
overlays = import ./nix/overlays { inherit inputs; };
|
packages = forAllSystems
|
||||||
nixosModules = import ./nix/modules/nixos;
|
({ pkgs, system }: rec {
|
||||||
homeManagerModules = import ./nix/modules/home-manager;
|
home-penguin-fw = homeConfigurations."john@penguin-fw".activationPackage;
|
||||||
|
home-penguin-duet = homeConfigurations."john@penguin-duet".activationPackage;
|
||||||
nixosConfigurations = {
|
home-pixnix = homeConfigurations."john@pixnix".activationPackage;
|
||||||
pixnix = nixpkgs.lib.nixosSystem {
|
all = pkgs.symlinkJoin {
|
||||||
specialArgs = { inherit inputs outputs; };
|
name = "all";
|
||||||
modules = [
|
paths = [
|
||||||
./nix/nixos/configuration.nix
|
home-penguin-fw
|
||||||
|
home-penguin-duet
|
||||||
|
home-pixnix
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
default = all;
|
||||||
|
});
|
||||||
|
|
||||||
homeConfigurations = {
|
homeConfigurations = {
|
||||||
"john@penguin-fw" = home-manager.lib.homeManagerConfiguration {
|
"john@penguin-fw" = home-manager.lib.homeManagerConfiguration {
|
||||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
pkgs = importPkgs "x86_64-linux";
|
||||||
extraSpecialArgs = { inherit inputs outputs; };
|
|
||||||
modules = [
|
modules = [
|
||||||
./nix/home/penguin-fw.nix
|
./nix/machines/penguin-fw/home.nix
|
||||||
{
|
];
|
||||||
home = {
|
};
|
||||||
username = "john";
|
"john@penguin-duet" = home-manager.lib.homeManagerConfiguration {
|
||||||
homeDirectory = "/home/john";
|
pkgs = importPkgs "aarch64-linux";
|
||||||
};
|
|
||||||
}
|
modules = [
|
||||||
|
./nix/machines/penguin-duet/home.nix
|
||||||
|
];
|
||||||
|
};
|
||||||
|
"john@pixnix" = home-manager.lib.homeManagerConfiguration {
|
||||||
|
pkgs = importPkgs "x86_64-linux";
|
||||||
|
|
||||||
|
modules = [
|
||||||
|
./nix/common/home.nix
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
78
nix/common/home.nix
Normal file
78
nix/common/home.nix
Normal file
|
@ -0,0 +1,78 @@
|
||||||
|
{ pkgs, lib, config, ... }: {
|
||||||
|
imports = [
|
||||||
|
../lib/tmux.nix
|
||||||
|
../lib/vim.nix
|
||||||
|
];
|
||||||
|
# home-manager config
|
||||||
|
home.username = "john";
|
||||||
|
home.homeDirectory = "/home/john";
|
||||||
|
home.stateVersion = "23.05"; # Please read the comment before changing.
|
||||||
|
programs.home-manager.enable = true;
|
||||||
|
targets.genericLinux.enable = true;
|
||||||
|
|
||||||
|
# home files
|
||||||
|
home.file = {
|
||||||
|
# # Building this configuration will create a copy of 'dotfiles/screenrc' in
|
||||||
|
# # the Nix store. Activating the configuration will then make '~/.screenrc' a
|
||||||
|
# # symlink to the Nix store copy.
|
||||||
|
# ".screenrc".source = dotfiles/screenrc;
|
||||||
|
|
||||||
|
# # You can also set the file content immediately.
|
||||||
|
# ".gradle/gradle.properties".text = ''
|
||||||
|
# org.gradle.console=verbose
|
||||||
|
# org.gradle.daemon.idletimeout=3600000
|
||||||
|
# '';
|
||||||
|
};
|
||||||
|
|
||||||
|
# env vars
|
||||||
|
home.sessionVariables = {
|
||||||
|
EDITOR = "vim";
|
||||||
|
};
|
||||||
|
|
||||||
|
# packages
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
babelfish
|
||||||
|
fish
|
||||||
|
htop
|
||||||
|
hugo
|
||||||
|
packer
|
||||||
|
powershell
|
||||||
|
terraform
|
||||||
|
tldr
|
||||||
|
vault
|
||||||
|
|
||||||
|
# # It is sometimes useful to fine-tune packages, for example, by applying
|
||||||
|
# # overrides. You can do that directly here, just don't forget the
|
||||||
|
# # parentheses. Maybe you want to install Nerd Fonts with a limited number of
|
||||||
|
# # fonts?
|
||||||
|
# (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; })
|
||||||
|
|
||||||
|
# # You can also create simple shell scripts directly inside your
|
||||||
|
# # configuration. For example, this adds a command 'my-hello' to your
|
||||||
|
# # environment:
|
||||||
|
# (pkgs.writeShellScriptBin "my-hello" ''
|
||||||
|
# echo "Hello, ${config.home.username}!"
|
||||||
|
# '')
|
||||||
|
];
|
||||||
|
|
||||||
|
# Fish shell settings
|
||||||
|
programs.fish = {
|
||||||
|
enable = true;
|
||||||
|
shellInit = "source ${config.home.homeDirectory}/.nix-profile/etc/profile.d/nix.fish";
|
||||||
|
functions = {
|
||||||
|
switch-home = "home-manager switch -b backup --flake ${config.home.homeDirectory}/.dotfiles";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# git settings
|
||||||
|
programs.git = {
|
||||||
|
enable = true;
|
||||||
|
delta.enable = true;
|
||||||
|
userEmail = "john@bowdre.net";
|
||||||
|
userName = "John Bowdre";
|
||||||
|
extraConfig = {
|
||||||
|
init.defaultBranch = "main";
|
||||||
|
pull.rebase = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,70 +0,0 @@
|
||||||
{ inputs, outputs, lib, config, pkgs, ... }: {
|
|
||||||
imports = [
|
|
||||||
../lib/tmux.nix
|
|
||||||
../lib/vim.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
nixpkgs.config = {
|
|
||||||
allowUnfree = true;
|
|
||||||
allowUnfreePredicate = (_: true);
|
|
||||||
};
|
|
||||||
|
|
||||||
home = {
|
|
||||||
homeDirectory = lib.mkDefault "/home/${config.home.username}";
|
|
||||||
stateVersion = lib.mkDefault "23.05";
|
|
||||||
|
|
||||||
file = {
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
packages = with pkgs; [
|
|
||||||
babelfish
|
|
||||||
hugo
|
|
||||||
packer
|
|
||||||
powershell
|
|
||||||
terraform
|
|
||||||
tldr
|
|
||||||
vault
|
|
||||||
];
|
|
||||||
|
|
||||||
sessionVariables = {
|
|
||||||
EDITOR = "vim";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
programs = {
|
|
||||||
home-manager.enable = true;
|
|
||||||
|
|
||||||
# direnv = {
|
|
||||||
# enable = lib.mkDefault true;
|
|
||||||
# # enableFishIntegration = true;
|
|
||||||
# nix-direnv.enable = true;
|
|
||||||
# };
|
|
||||||
|
|
||||||
fish = {
|
|
||||||
enable = true;
|
|
||||||
shellInit = "source ${config.home.homeDirectory}/.nix-profile/etc/profile.d/nix.fish";
|
|
||||||
functions = {
|
|
||||||
switch-home = "home-manager switch -b backup --flake ${config.home.homeDirectory}/.dotfiles#$USER@$(hostname -s)";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
git = {
|
|
||||||
enable = lib.mkDefault true;
|
|
||||||
delta.enable = true;
|
|
||||||
userEmail = lib.mkDefault "john@bowdre.net";
|
|
||||||
userName = lib.mkDefault "John Bowdre";
|
|
||||||
extraConfig = {
|
|
||||||
init.defaultBranch = "main";
|
|
||||||
pull.rebase = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
htop.enable = lib.mkDefault true;
|
|
||||||
|
|
||||||
jq.enable = lib.mkDefault true;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
targets.genericLinux.enable = true;
|
|
||||||
}
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ pkgs, lib, ... }: {
|
{ pkgs, lib, ...}: {
|
||||||
programs.tmux = {
|
programs.tmux = {
|
||||||
enable = true;
|
enable = true;
|
||||||
baseIndex = 1;
|
baseIndex = 1;
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
{ pkgs, lib, ... }: {
|
{ pkgs, lib, ...}: {
|
||||||
|
|
||||||
nixpkgs.config = {
|
|
||||||
allowUnfree = true;
|
|
||||||
allowUnfreePredicate = (_: true);
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.vscode = {
|
programs.vscode = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableExtensionUpdateCheck = false;
|
enableExtensionUpdateCheck = false;
|
||||||
|
|
|
@ -1,13 +1,8 @@
|
||||||
{ pkgs, lib, config, ... }: {
|
{ pkgs, lib, config, ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
./home/common.nix
|
../../common/home.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs.config = {
|
|
||||||
allowUnfree = true;
|
|
||||||
allowUnfreePredicate = (_: true);
|
|
||||||
};
|
|
||||||
|
|
||||||
# packages
|
# packages
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
obsidian
|
obsidian
|
|
@ -1,14 +1,9 @@
|
||||||
{ pkgs, lib, config, ... }: {
|
{ pkgs, lib, config, ... }: {
|
||||||
imports = [
|
imports = [
|
||||||
./common.nix
|
../../common/home.nix
|
||||||
../lib/vscode.nix
|
../../lib/vscode.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs.config = {
|
|
||||||
allowUnfree = true;
|
|
||||||
allowUnfreePredicate = (_: true);
|
|
||||||
};
|
|
||||||
|
|
||||||
# packages
|
# packages
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
firefox-esr
|
firefox-esr
|
|
@ -1,7 +0,0 @@
|
||||||
# Add your reusable home-manager modules to this directory, on their own file (https://nixos.wiki/wiki/Module).
|
|
||||||
# These should be stuff you would like to share with others, not your personal configurations.
|
|
||||||
|
|
||||||
{
|
|
||||||
# List your module files here
|
|
||||||
# my-module = import ./my-module.nix;
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
# Add your reusable NixOS modules to this directory, on their own file (https://nixos.wiki/wiki/Module).
|
|
||||||
# These should be stuff you would like to share with others, not your personal configurations.
|
|
||||||
|
|
||||||
{
|
|
||||||
# List your module files here
|
|
||||||
# my-module = import ./my-module.nix;
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
# This file defines overlays
|
|
||||||
{ inputs, ... }:
|
|
||||||
{
|
|
||||||
# This one brings our custom packages from the 'pkgs' directory
|
|
||||||
additions = final: _prev: import ../pkgs { pkgs = final; };
|
|
||||||
|
|
||||||
# This one contains whatever you want to overlay
|
|
||||||
# You can change versions, add patches, set compilation flags, anything really.
|
|
||||||
# https://nixos.wiki/wiki/Overlays
|
|
||||||
modifications = final: prev: {
|
|
||||||
# example = prev.example.overrideAttrs (oldAttrs: rec {
|
|
||||||
# ...
|
|
||||||
# });
|
|
||||||
};
|
|
||||||
|
|
||||||
# When applied, the unstable nixpkgs set (declared in the flake inputs) will
|
|
||||||
# be accessible through 'pkgs.unstable'
|
|
||||||
unstable-packages = final: _prev: {
|
|
||||||
unstable = import inputs.nixpkgs-unstable {
|
|
||||||
system = final.system;
|
|
||||||
config.allowUnfree = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,6 +0,0 @@
|
||||||
# Custom packages, that can be defined similarly to ones from nixpkgs
|
|
||||||
# You can build them using 'nix build .#example' or (legacy) 'nix-build -A example'
|
|
||||||
|
|
||||||
{ pkgs ? (import ../nixpkgs.nix) { } }: {
|
|
||||||
# example = pkgs.callPackage ./example { };
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
# Shell for bootstrapping flake-enabled nix and home-manager
|
|
||||||
# You can enter it through 'nix develop' or (legacy) 'nix-shell'
|
|
||||||
|
|
||||||
{ pkgs ? (import ./nixpkgs.nix) { } }: {
|
|
||||||
default = pkgs.mkShell {
|
|
||||||
# Enable experimental features without having to specify the argument
|
|
||||||
NIX_CONFIG = "experimental-features = nix-command flakes";
|
|
||||||
nativeBuildInputs = with pkgs; [ nix home-manager git ];
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
# A nixpkgs instance that is grabbed from the pinned nixpkgs commit in the lock file
|
|
||||||
# This is useful to avoid using channels when using legacy nix commands
|
|
||||||
let lock = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.nixpkgs.locked;
|
|
||||||
in
|
|
||||||
import (fetchTarball {
|
|
||||||
url = "https://github.com/nixos/nixpkgs/archive/${lock.rev}.tar.gz";
|
|
||||||
sha256 = lock.narHash;
|
|
||||||
})
|
|
Loading…
Reference in a new issue