add nix fmt

This commit is contained in:
uf5 2023-05-03 23:07:03 +05:00
parent 691c6579c7
commit bfb9d8e17f
8 changed files with 46 additions and 34 deletions

View file

@ -1,5 +1,6 @@
{
description = "NixOS + standalone home-manager config flakes to get you started!";
description =
"NixOS + standalone home-manager config flakes to get you started!";
outputs = inputs: {
templates = {
minimal = {

View file

@ -33,9 +33,13 @@
# Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = {
# FIXME replace with your username@hostname
"your-username@your-hostname" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
extraSpecialArgs = { inherit inputs; }; # Pass flake inputs to our config
"your-username@your-hostname" =
home-manager.lib.homeManagerConfiguration {
pkgs =
nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
extraSpecialArgs = {
inherit inputs;
}; # Pass flake inputs to our config
# > Our main home-manager configuration file <
modules = [ ./home-manager/home.nix ];
};

View file

@ -42,7 +42,8 @@
# This will additionally add your inputs to the system's legacy channels
# Making legacy nix commands consistent as well, awesome!
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}")
config.nix.registry;
settings = {
# Enable flakes and new 'nix' command

View file

@ -31,20 +31,21 @@
"aarch64-darwin"
"x86_64-darwin"
];
in
rec {
in rec {
# Your custom packages
# Acessible through 'nix build', 'nix shell', etc
packages = forAllSystems (system:
let pkgs = nixpkgs.legacyPackages.${system};
in import ./pkgs { inherit pkgs; }
);
in import ./pkgs { inherit pkgs; });
# Devshell for bootstrapping
# Acessible through 'nix develop' or 'nix-shell' (legacy)
devShells = forAllSystems (system:
let pkgs = nixpkgs.legacyPackages.${system};
in import ./shell.nix { inherit pkgs; }
);
in import ./shell.nix { inherit pkgs; });
formatter = forAllSystems (system:
let pkgs = nixpkgs.legacyPackages.${system};
in pkgs.nixpkgs-fmt);
# Your custom packages and modifications, exported as overlays
overlays = import ./overlays { inherit inputs; };
@ -72,8 +73,10 @@
# Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = {
# FIXME replace with your username@hostname
"your-username@your-hostname" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
"your-username@your-hostname" =
home-manager.lib.homeManagerConfiguration {
pkgs =
nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
extraSpecialArgs = { inherit inputs outputs; };
modules = [
# > Our main home-manager configuration file <

View file

@ -50,7 +50,8 @@
# This will additionally add your inputs to the system's legacy channels
# Making legacy nix commands consistent as well, awesome!
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}") config.nix.registry;
nixPath = lib.mapAttrsToList (key: value: "${key}=${value.to.path}")
config.nix.registry;
settings = {
# Enable flakes and new 'nix' command

View file

@ -1,8 +1,9 @@
# 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 {
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;
})

View file

@ -1,13 +1,13 @@
# This file defines overlays
{ inputs, ... }:
{
{ 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: {
modifications = final: prev:
{
# example = prev.example.overrideAttrs (oldAttrs: rec {
# ...
# });

View file

@ -1,6 +1,7 @@
# 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) { } }: {
{ pkgs ? (import ../nixpkgs.nix) { } }:
{
# example = pkgs.callPackage ./example { };
}