more packages, more modular

This commit is contained in:
John Bowdre 2023-07-28 17:15:33 -05:00
parent 2e628b7c4d
commit b4116247ca
15 changed files with 144 additions and 113 deletions

View File

@ -1,5 +1,20 @@
{
"nodes": {
"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": {
"inputs": {
"nixpkgs": [
@ -55,6 +70,7 @@
},
"root": {
"inputs": {
"hardware": "hardware",
"home-manager": "home-manager",
"nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable"

View File

@ -1,8 +1,11 @@
{
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 = {
# Nixpkgs
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
# You can access packages and modules from different nixpkgs revs
# at the same time. Here's a working example:
@ -15,81 +18,49 @@
inputs.nixpkgs.follows = "nixpkgs";
};
# TODO: Add any other flake you might need
# hardware.url = "github.com/nixos/nixos-hardware";
# Hardware
hardware.url = "github:nixos/nixos-hardware";
};
outputs = { self, nixpkgs, home-manager, ... }@inputs:
outputs = { self, nixpkgs, home-manager, ... } @ inputs:
let
inherit (self) outputs;
forAllSystems = nixpkgs.lib.genAttrs [
"aarch64-linux"
"x86_64-linux"
];
lib = nixpkgs.lib // home-manager.lib;
systems = [ "x86_64-linux" "aarch64-linux" ];
forEachSystem = f: lib.genAttrs systems (sys: f pkgsFor.${sys});
pkgsFor = nixpkgs.legacyPackages;
in
rec {
# 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
{
inherit lib;
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;
# NixOS configuration entrypoint
# Available through 'nixos-rebuild --flake .#your-hostname'
overlays = import ./nix/overlays { inherit inputs outputs; };
packages = forEachSystem (pkgs: import ./nix/pkgs { inherit pkgs; });
devShells = forEachSystem (pkgs: import ./shell.nix { inherit pkgs; });
formatter = forEachSystem (pkgs: pkgs.nixpkgs-fmt);
nixosConfigurations = {
pixnix = nixpkgs.lib.nixosSystem {
# Pixelbook converted to NixOS
pixnix = lib.nixosSystem {
modules = [ ./nix/hosts/pixnix ];
specialArgs = { inherit inputs outputs; };
modules = [
# > Our main nixos configuration file <
./nix/nixos/configuration.nix
];
};
};
# Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = {
"john@penguin-fw" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
"john@penguin-fw" = lib.homeManagerConfiguration {
modules = [ ./nix/home/penguin-fw.nix ];
pkgs = pkgsFor.x86_64-linux;
extraSpecialArgs = { inherit inputs outputs; };
modules = [
./nix/home/penguin-fw.nix
{
home = {
username = "john";
homeDirectory = "/home/john";
};
}
];
};
"john@penguin-duet" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.aarch64-linux;
"john@penguin-duet" = lib.homeManagerConfiguration {
modules = [ ./nix/home/penguin-duet.nix ];
pkgs = pkgsFor.aarch64-linux;
extraSpecialArgs = { inherit inputs outputs; };
modules = [
./nix/home/penguin-duet.nix
{
home = {
username = "john";
homeDirectory = "/home/john";
};
}
];
};
};
};

View File

@ -0,0 +1,25 @@
{ pkgs, ... }: {
# Common CLI apps
imports = [
./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

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

View File

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

View File

@ -1,32 +1,29 @@
{ inputs, outputs, lib, config, pkgs, ... }: {
imports = [
../lib/tmux.nix
../lib/vim.nix
];
../features/cli
] ++ (builtins.attrValues outputs.homeManagerModules);
nixpkgs.config = {
allowUnfree = true;
allowUnfreePredicate = (_: true);
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";
file = {
};
packages = with pkgs; [
babelfish
hugo
packer
powershell
terraform
tldr
vault
];
sessionVariables = {
EDITOR = "vim";
};
@ -59,9 +56,6 @@
};
};
htop.enable = lib.mkDefault true;
jq.enable = lib.mkDefault true;
};

15
nix/home/lib/chromeos.nix Normal file
View File

@ -0,0 +1,15 @@
{ 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,19 +1,11 @@
{ pkgs, lib, config, ... }: {
imports = [
./home/common.nix
./global
./lib/chromeos.nix
];
nixpkgs.config = {
allowUnfree = true;
allowUnfreePredicate = (_: true);
};
# packages
home.packages = with pkgs; [
obsidian
];
# XDG settings
xdg.enable = true;
xdg.mime.enable = true;
}

View File

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

View File

@ -4,4 +4,4 @@
{
# List your module files here
# my-module = import ./my-module.nix;
}
}

View File

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

View File

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