Compare commits

..

No commits in common. "126059e9ed8163bafd489e3d2a3a4df796f6d96c" and "4f056049c4ed85b1bedffcf1c23c69223e4e31b5" have entirely different histories.

21 changed files with 160 additions and 381 deletions

View file

@ -1,58 +1,5 @@
{ {
"nodes": { "nodes": {
"firefox-addons": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"dir": "pkgs/firefox-addons",
"lastModified": 1690516944,
"narHash": "sha256-MfrIP2efvDhGZHhkgcMwMygqK2USpwiO8I9EEFPYn/c=",
"owner": "rycee",
"repo": "nur-expressions",
"rev": "8c2d969a614c21e8d6f2fade01e31bd89dcb4d1d",
"type": "gitlab"
},
"original": {
"dir": "pkgs/firefox-addons",
"owner": "rycee",
"repo": "nur-expressions",
"type": "gitlab"
}
},
"flake-utils": {
"locked": {
"lastModified": 1629284811,
"narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c5d161cc0af116a2e17f54316f0bf43f0819785c",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"hardware": {
"locked": {
"lastModified": 1690200740,
"narHash": "sha256-aRkEXGmCbAGcvDcdh/HB3YN+EvoPoxmJMOaqRZmf6vM=",
"owner": "nixos",
"repo": "nixos-hardware",
"rev": "ba9650b14e83b365fb9e731f7d7c803f22d2aecf",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixos-hardware",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -108,8 +55,6 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"firefox-addons": "firefox-addons",
"hardware": "hardware",
"home-manager": "home-manager", "home-manager": "home-manager",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable" "nixpkgs-unstable": "nixpkgs-unstable"

View file

@ -1,11 +1,8 @@
{ {
description = "A Very Flakey Home Manager"; description = "A Very Flakey Home Manager";
# Initial layout shamelessly stolen from:
# - https://github.com/Misterio77/nix-starter-configs/
# - https://github.com/Misterio77/nix-config/
inputs = { inputs = {
# Nixpkgs
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
# You can access packages and modules from different nixpkgs revs # You can access packages and modules from different nixpkgs revs
# at the same time. Here's a working example: # at the same time. Here's a working example:
@ -18,60 +15,81 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
# Hardware # TODO: Add any other flake you might need
hardware.url = "github:nixos/nixos-hardware"; # hardware.url = "github.com/nixos/nixos-hardware";
# Firefox add-ons
firefox-addons = {
url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = { self, nixpkgs, home-manager, ... } @ inputs: outputs = { self, nixpkgs, home-manager, ... }@inputs:
let let
inherit (self) outputs; inherit (self) outputs;
lib = nixpkgs.lib // home-manager.lib; forAllSystems = nixpkgs.lib.genAttrs [
systems = [ "x86_64-linux" "aarch64-linux" ]; "aarch64-linux"
forEachSystem = f: lib.genAttrs systems (sys: f pkgsFor.${sys}); "x86_64-linux"
pkgsFor = nixpkgs.legacyPackages; ];
in in
{ rec {
inherit lib; # Your custom packages
# Accessible through 'nix build', 'nix shell', etc
packages = forAllSystems (system:
let pkgs = nixpkgs.legacyPackages.${system};
in import ./nix/pkgs { inherit pkgs; }
);
# Devshell for bootstrapping
# Accessible through 'nix develop' or 'nix-shell' (legacy)
devShells = forAllSystems (system:
let pkgs = nixpkgs.legacyPackages.${system};
in import ./nix/shell.nix { inherit pkgs; }
);
# Your custom packages and modifications, exported as overlays
overlays = import ./nix/overlays { inherit inputs; };
# Reusable nixos modules you might want to export
# These are usually stuff you would upstream into nixpkgs
nixosModules = import ./nix/modules/nixos; nixosModules = import ./nix/modules/nixos;
# Reusable home-manager modules you might want to export
# These are usually stuff you would upstream into home-manager
homeManagerModules = import ./nix/modules/home-manager; homeManagerModules = import ./nix/modules/home-manager;
overlays = import ./nix/overlays { inherit inputs outputs; }; # NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
packages = forEachSystem (pkgs: import ./nix/pkgs { inherit pkgs; });
devShells = forEachSystem (pkgs: import ./shell.nix { inherit pkgs; });
formatter = forEachSystem (pkgs: pkgs.nixpkgs-fmt);
nixosConfigurations = { nixosConfigurations = {
# Pixelbook converted to NixOS pixnix = nixpkgs.lib.nixosSystem {
pixnix = lib.nixosSystem {
modules = [ ./nix/hosts/pixnix ];
specialArgs = { inherit inputs outputs; }; specialArgs = { inherit inputs outputs; };
modules = [
# > Our main nixos configuration file <
./nix/nixos/configuration.nix
];
}; };
}; };
# Standalone home-manager configuration entrypoint # Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname' # Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = { homeConfigurations = {
"john@penguin-fw" = lib.homeManagerConfiguration { "john@penguin-fw" = home-manager.lib.homeManagerConfiguration {
modules = [ ./nix/home/penguin-fw.nix ]; pkgs = nixpkgs.legacyPackages.x86_64-linux;
pkgs = pkgsFor.x86_64-linux;
extraSpecialArgs = { inherit inputs outputs; }; extraSpecialArgs = { inherit inputs outputs; };
modules = [
./nix/home/penguin-fw.nix
{
home = {
username = "john";
homeDirectory = "/home/john";
};
}
];
}; };
"john@penguin-duet" = lib.homeManagerConfiguration { "john@penguin-duet" = home-manager.lib.homeManagerConfiguration {
modules = [ ./nix/home/penguin-duet.nix ]; pkgs = nixpkgs.legacyPackages.aarch64-linux;
pkgs = pkgsFor.aarch64-linux;
extraSpecialArgs = { inherit inputs outputs; };
};
"john@pixnix" = lib.homeManagerConfiguration {
modules = [ ./nix/home/pixnix.nix ];
pkgs = pkgsFor.x86_64-linux;
extraSpecialArgs = { inherit inputs outputs; }; extraSpecialArgs = { inherit inputs outputs; };
modules = [
./nix/home/penguin-duet.nix
{
home = {
username = "john";
homeDirectory = "/home/john";
};
}
];
}; };
}; };
}; };

69
nix/home/common.nix Normal file
View file

@ -0,0 +1,69 @@
{ 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;
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;
}

View file

@ -1,28 +0,0 @@
{ pkgs, ... }: {
# Common CLI apps
imports = [
./direnv.nix
./git.nix
./fish.nix
./tmux.nix
./vim.nix
];
home.packages = with pkgs; [
babelfish # Lets fish speak bash
bottom # Better top
httpie # Better curl
hugo # Static site generator
jq # JSON pretty printer and manipulator
nil # Nix LSP
# nix-inspect # See which pkgs are in your Path
nixfmt # Nix formatter
packer # Hashicorp packer
powershell # Powershell
terraform # Hashicorp terraform
tldr # TLDR pages
trekscii # Cute startrek cli printer
vault # Hashicorp vault
];
}

View file

@ -1,6 +0,0 @@
{
programs.direnv = {
enable = true;
nix-direnv.enable = true;
};
}

View file

@ -1,80 +0,0 @@
{ pkgs, lib, config, ... }:
let
inherit (lib) mkIf;
hasPackage = pname: lib.any (p: p ? pname && p.name == pname) config.home.packages;
hasExa = hasPackage "exa";
in
{
programs.fish = {
enable = true;
shellAbbrs = rec {
jqless = "jq -C | less -r";
ls = mkIf hasExa "exa";
vi = "vim";
v = "vim";
};
shellAliases = {
};
functions = {
# Disable greeting
fish_greeting = "";
# Rebuild home-manager
switch-home = "home-manager switch -b backup --flake ${config.home.homeDirectory}/.dotfiles#$USER@$(hostname -s)";
};
shellInit = "source ${config.home.homeDirectory}/.nix-profile/etc/profile.d/nix.fish";
interactiveShellInit =
# Open command buffer in vim when alt+e is pressed
''
bind \ee edit_command_buffer
'' +
# Use vim bindings and cursors
''
fish_vi_key_bindings
set fish_cursor_default block blink
set fish_cursor_insert line blink
set fish_cursor_replace_one underscore blink
set fish_cursor_visual block
'' +
# Restore ctrl+f to accept suggestions
''
bind -M insert \cf forward-char
bind -M default \cf forward-char
bind -M visual \cf forward-char
'' +
# Use terminal colors
''
set -U fish_color_autosuggestion brblack
set -U fish_color_cancel -r
set -U fish_color_command brgreen
set -U fish_color_comment brmagenta
set -U fish_color_cwd green
set -U fish_color_cwd_root red
set -U fish_color_end brmagenta
set -U fish_color_error brred
set -U fish_color_escape brcyan
set -U fish_color_history_current --bold
set -U fish_color_host normal
set -U fish_color_match --background=brblue
set -U fish_color_normal normal
set -U fish_color_operator cyan
set -U fish_color_param brblue
set -U fish_color_quote yellow
set -U fish_color_redirection bryellow
set -U fish_color_search_match 'bryellow' '--background=brblack'
set -U fish_color_selection 'white' '--bold' '--background=brblack'
set -U fish_color_status red
set -U fish_color_user brgreen
set -U fish_color_valid_path --underline
set -U fish_pager_color_completion normal
set -U fish_pager_color_description yellow
set -U fish_pager_color_prefix 'white' '--bold' '--underline'
set -U fish_pager_color_progress 'brwhite' '--background=cyan'
'';
};
}

View file

@ -1,16 +0,0 @@
{ lib, ... }: {
programs.git = {
enable = lib.mkDefault true;
delta.enable = true;
aliases = {
graph = "log --decorate --oneline --graph";
fast-forward = "merge --ff-only";
};
userEmail = lib.mkDefault "john@bowdre.net";
userName = lib.mkDefault "John Bowdre";
extraConfig = {
init.defaultBranch = "main";
pull.rebase = false;
};
};
}

View file

@ -1,12 +0,0 @@
{ pkgs, ... }: {
# Common GUI apps
imports = [
./firefox.nix
./vscode.nix
];
home.packages = with pkgs; [
obsidian
qFlipper
];
}

View file

@ -1,48 +0,0 @@
{ pkgs, lib, inputs, ... }:
let
addons = inputs.firefox-addons.packages.${pkgs.system};
in
{
programs.firefox = {
enable = true;
profiles.john = {
bookmarks = { };
# extensions = with addons; [
# bitwarden-password-manager
# privacy-badger17
# raindropio
# ];
bookmarks = { };
settings = {
"app.update.auto" = false;
"browser.disableResetPrompt" = true;
"browser.download.panel.shown" = true;
"browser.download.useDownloadDir" = true;
"browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
"browser.shell.checkDefaultBrowser" = false;
"browser.shell.defaultBrowserCheckCount" = 1;
"browser.startup.homepage" = "https://kagi.com/";
"dom.security.https_only_mode" = true;
"extensions.pocket.enabled" = false;
"identity.fxaccounts.enabled" = true;
"privacy.trackingprotection.enabled" = true;
"signon.rememberSignons" = false;
};
};
};
home = {
sessionVariables = {
# https://github.com/NixOS/nixpkgs/issues/238025
TZ = "/etc/localtime";
};
};
xdg.mimeApps.defaultApplications = {
"text/html" = [ "firefox.desktop" ];
"text/xml" = [ "firefox.desktop" ];
"x-scheme-handler/http" = [ "firefox.desktop" ];
"x-scheme-handler/https" = [ "firefox.desktop" ];
};
}

View file

@ -1,38 +0,0 @@
{ inputs, outputs, lib, config, pkgs, ... }: {
imports = [
../features/cli
] ++ (builtins.attrValues outputs.homeManagerModules);
nixpkgs = {
overlays = builtins.attrValues outputs.overlays;
config = {
allowUnfree = true;
allowUnfreePredicate = (_: true);
};
};
nix = {
package = lib.mkDefault pkgs.nix;
settings = {
experimental-features = ["nix-command" "flakes" "repl-flake" ];
warn-dirty = false;
};
};
home = {
username = lib.mkDefault "john";
homeDirectory = lib.mkDefault "/home/${config.home.username}";
stateVersion = lib.mkDefault "23.05";
sessionVariables = {
EDITOR = "vim";
};
};
programs = {
home-manager.enable = true;
};
targets.genericLinux.enable = true;
}

View file

@ -1,15 +0,0 @@
{ pkgs, lib, ... }: {
# ChromeOS integration
home.file.".config/systemd/user/cros-garcon.service.d/override.conf" = {
text = ''
[Service]
Environment="PATH=%h/.nix-profile/bin:/usr/local/sbin:/usr/local/bin:/usr/local/games:/usr/sbin:/usr/bin:/usr/games:/sbin:/bin"
Environment="XDG_DATA_DIRS=/nix/var/nix/profiles/default/share:%h/.nix-profile/share:%h/.local/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop:%h/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share"
'';
};
# XDG settings
xdg.enable = true;
xdg.mime.enable = true;
}

View file

@ -1,12 +1,20 @@
{ pkgs, lib, config, ... }: { { pkgs, lib, config, ... }: {
imports = [ imports = [
./global ./common.nix
./lib/chromeos.nix ../lib/vscode.nix
./features/desktop/vscode.nix
]; ];
nixpkgs.config = {
allowUnfree = true;
allowUnfreePredicate = (_: true);
};
# packages # packages
home.packages = with pkgs; [ home.packages = with pkgs; [
obsidian obsidian
]; ];
# XDG settings
xdg.enable = true;
xdg.mime.enable = true;
} }

View file

@ -1,13 +1,24 @@
{ inputs, outputs, lib, config, pkgs, ... }: { { pkgs, lib, config, ... }: {
imports = [ imports = [
./global ./common.nix
./features/desktop ../lib/vscode.nix
./lib/chromeos.nix
]; ];
nixpkgs.config = {
allowUnfree = true;
allowUnfreePredicate = (_: true);
};
# packages # packages
home.packages = with pkgs; [ home.packages = with pkgs; [
firefox-esr
libvirt libvirt
obsidian
qFlipper
vagrant vagrant
]; ];
# XDG settings
xdg.enable = true;
xdg.mime.enable = true;
} }

View file

@ -1,12 +0,0 @@
{ inputs, outputs, lib, config, pkgs, ... }: {
imports = [
./global
./features/desktop
];
# packages
home.packages = with pkgs; [
libvirt
vagrant
];
}

View file

@ -1,5 +1,12 @@
{ outputs, pkgs, lib, ... }: { { outputs, pkgs, lib, ... }: {
nixpkgs = {
config = {
allowUnfree = true;
allowUnfreePredicate = (_: true);
};
};
programs.vscode = { programs.vscode = {
enable = true; enable = true;
enableExtensionUpdateCheck = false; enableExtensionUpdateCheck = false;

View file

@ -3,5 +3,4 @@
{ pkgs ? (import ../nixpkgs.nix) { } }: { { pkgs ? (import ../nixpkgs.nix) { } }: {
# example = pkgs.callPackage ./example { }; # example = pkgs.callPackage ./example { };
trekscii = pkgs.callPackage ./trekscii { };
} }

View file

@ -1,23 +0,0 @@
{ lib, stdenv, fetchFromGitHub }:
let
pname = "trekscii";
in
stdenv.mkDerivation {
inherit pname;
version = "unstable-2022-06-27";
src = fetchFromGitHub {
owner = "k-vernooy";
repo = pname;
rev = "8b51971c4c62f49f886d59f2c8445ce8734b00e8";
hash = "sha256-Mn3wasplwXsDCBEpHLqdh0G+SqYIirj7lKvM3VehPH0=";
};
installPhase = ''
install -Dm 0755 bin/trekscii $out/bin/trekscii
'';
meta = with lib; {
platforms = platforms.all;
};
}