Skip to content

arminius-smh/dotfiles

Repository files navigation

dotfiles

update flake

# update all flake inputs
nix flake update
# update only specific flake inputs
nix flake update [input]

use template

nix flake init -t "path:$HOME/dotfiles/assets/devenvs#[language]"

load configurations

# rebuilds nixos and home-manager
./assets/scripts/rebuild

tips

override package source

# ,+ü in neovim for sha autofill
{pkgs, ...}: let
  PKG-git = pkgs.PKG.overrideAttrs (prev: {
    version = "git";
    src = pkgs.fetchFromGitHub {
      owner = "PKG";
      repo = "PKG";
      rev = "";
      sha256 = pkgs.lib.fakeSha256;  
};
  });
in {
  programs = {
    PKG = {
      enable = true;
      package = PKG-git;
    };
  };
}

or overlay:

  nixpkgs = {
    overlays = [
      (final: prev: {
        PKG = prev.PKG.overrideAttrs (oldAttrs: rec {
          pname = "PKG";
          version = "0-unstable-$DATE";

          src = prev.fetchFromGitHub {
            owner = "PKG";
            repo = "PKG";
            rev = "";
            sha256 = "";
          };
        });
      })
    ];
  };

replace module

  disabledModules = ["/path/to/module.nix"];
  imports = [
    ./my-own-module.nix # local import
    "${inputs.pkgs}/path/to/module.nix" # other input e.g. nixpkgs import
  ];

submodules

git submodule init && git submodule update

package dev

source: here

derivation.nix

{ stdenv }:
stdenv.mkDerivation rec {
  name = "program-${version}";
  version = "1.0";

  src = ./.;

  nativeBuildInputs = [ ];
  buildInputs = [ ];

  buildPhase = ''
    gcc program.c -o myprogram
  '';

  installPhase = ''
    mkdir -p $out/bin
    cp myprogram $out/bin
  '';
}

default.nix

{ pkgs ? import <nixpkgs> {} }:
pkgs.callPackage ./derivation.nix {}

then run:

nix-build

check auto-update

journalctl -xeu nixos-update.service

other

  • $DOTFILES_PATH is required to be set
  • private zsh functions etc. in $HOME/.config/zsh/.priv.zsh
  • stylus catppuccin themes: catppuccin
  • asahi widevine useragent: Mozilla/5.0 (X11; CrOS aarch64 15236.80.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.5414.125 Safari/537.36

Inspiration

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published