Giter VIP home page Giter VIP logo

flakes's Introduction

Hi 👋, I'm Einherjar

A toxic Bitcoin-maximalist and Rust/Python developer


bitcoin lightning rust python c cplusplus bdk nixos docker

flakes's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar realeinherjar avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

flakes's Issues

feat: use `oxalica/rust-overlay`

Add oxalica/rust-overlay:

{
  description = "My configuration";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    rust-overlay.url = "github:oxalica/rust-overlay";
  };

  outputs = { nixpkgs, rust-overlay, ... }: {
    nixosConfigurations = {
      hostname = nixpkgs.lib.nixosSystem {
        system = "x86_64-linux";
        modules = [
          ./configuration.nix # Your system configuration.
          ({ pkgs, ... }: {
            nixpkgs.overlays = [ rust-overlay.overlays.default ];
            # includes cargo, clippy, rustfmt
            environment.systemPackages = [ pkgs.rust-bin.stable.latest.default ];
          })
        ];
      };
    };
  };
}

feat: use disko for disk management

disko is an automated disk partitioning and formatting for NixOS.

Install via flakes:

{
  inputs.disko.url = "github:nix-community/disko";
  inputs.disko.inputs.nixpkgs.follows = "nixpkgs";

  outputs = { self, nixpkgs, disko }: {
    # change `yourhostname` to your actual hostname
    nixosConfigurations.yourhostname = nixpkgs.lib.nixosSystem {
      # change to your system:
      system = "x86_64-linux";
      modules = [
        ./configuration.nix
        disko.nixosModules.disko
      ];
    };
  };
}

Then add the following:

{ disks ? [ "/dev/vda" ], ... }: {
  # checkout the example folder for how to configure different disko layouts
  disko.devices = {
    disk = {
      vbd = {
        device = builtins.elemAt disks 0;
        type = "disk";
        content = {
          type = "table";
          format = "gpt";
          partitions = [
            {
              name = "ESP";
              start = "1MiB";
              end = "512MiB";
              type = "EF00";
              bootable = true;
              content = {
                type = "filesystem";
                format = "vfat";
                mountpoint = "/boot";
                mountOptions = [
                  "defaults"
                ];
              };
            }
            {
              name = "luks";
              start = "512MiB";
              end = "100%";
              part-type = "primary";
              bootable = true;
              content = {
                type = "luks";
                name = "crypted";
                type = "btrfs";
                extraOpenArgs = [ "-f" "--allow-discards" ];
                passwordFile = config.age.secrets.luks.path;
                subvolumes = {
                  "/nix" = {
                    mountOptions = [ "compress=zstd" "noatime" ];
                    mountpoint = "/nix";
                  };
                };
              };
            }
          ];
        };
      };
    };
    nodev = {
      "/" = {
        fsType = "tmpfs";
        mountOptions = [
          "defaults"
          "size=12G"
          "mode=755"
        ];
      };
    };
  };
}

secrets.nix add an entry:

"luks.age".publicKeys = [ einherjar ];

hosts/laptop/wayland/default.nix:

age.secrets = {
  ...
  luks.file = ../../../secrets/luks.age;
};

Additionally this script might help you: https://github.com/Ruixi-rebirth/flakes/blob/main/scripts/disko.sh

fix: Hyprland configs

in modules/desktop/hyprland/home.nix:

  • add wayland.windowManager.hyprland.xwayland.enable as true

  • write extraConfig as wayland.windowManager.hyprland.settings.
    Entries with the same key should be written as lists. Variables’ and colors’ names should be quoted
    Example:

    {
     decoration = {
       shadow_offset = "0 5";
       "col.shadow" = "rgba(00000099)";
     };
    
     "$mod" = "SUPER";
    
     bindm = [
       # mouse movements
       "$mod, mouse:272, movewindow"
       "$mod, mouse:273, resizewindow"
       "$mod ALT, mouse:272, resizewindow"
     ];
    }

Add `keyd`

services = {
  keyd = {
    enable = true;
    settings = {
      main = {
        # Maps capslock to escape when pressed and control when held
        capslock = "overload(control, esc)"; 
      };
    };
  };
};

Move from `kitty` to `foot` + `tmux`

foot.ini:

font=JetBrains Mono Nerd Font:size=12
initial-window-size-chars=190x60
bold-text-in-bright=yes
initial-window-mode=maximized

[key-bindings]
search-start=Control+Shift+f
show-urls-launch=Control+Shift+u

[colors]
alpha=0.95

# catppucin mocha
# catppuccin/foot
foreground=cdd6f4 # Text
background=1e1e2e # Base
regular0=45475a   # Surface 1
regular1=f38ba8   # red
regular2=a6e3a1   # green
regular3=f9e2af   # yellow
regular4=89b4fa   # blue
regular5=f5c2e7   # pink
regular6=94e2d5   # teal
regular7=bac2de   # Subtext 1
bright0=585b70    # Surface 2
bright1=f38ba8    # red
bright2=a6e3a1    # green
bright3=f9e2af    # yellow
bright4=89b4fa    # blue
bright5=f5c2e7    # pink
bright6=94e2d5    # teal
bright7=a6adc8    # Subtext 0

[csd]
hide-when-maximized=yes

# vim: ft=dosini

tmux config in https://github.com/catppuccin/tmux

  • Make sure to test terminalfloat (foot --title= or foot --app-id=), and terminal float does not launch with tmux attach.

tmux.conf

######################################################################
# START OF GENERAL CONFIGURATIONS
######################################################################

# set scroll history to 100,000 lines
set-option -g history-limit 100000

# Turn on interactivity with mouse 
set -g mouse on

# Enables italics in tmux
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",xterm-256color*:Tc"
set -ga terminal-overrides ",foot:Tc"

# Turns off the status bar
set -g status on

# Change the position of the status bar
# set-option -g status-position bottom

# TMUX and VIM Focus Events
set-option -g focus-events on

# Start window numbering at specific num
set -g base-index 1
setw -g pane-base-index 1

# Renumber windows on window close
set -g renumber-windows on

# Avoid ESC delay
set -s escape-time 0

# Fix titlebar
set -g set-titles on
set -g set-titles-string "#T"

# VIM mode
set -g mode-keys vi

#######################################################
# KEY BINDING
#######################################################

# Remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix

# C-b to server prefix in nested tmux stuff
bind-key -n C-b send-prefix

# New windows and panes are in current path
bind c new-window      -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind \" split-window -v -c "#{pane_current_path}"

# hjkl pane traversal
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

# copy to X clipboard
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi y send-keys -X copy-pipe 'xclip -in -selection clipboard &> /dev/null'
bind -T copy-mode-vi Enter send-keys -X cancel

# shortcut for moving tmux buffer to clipboard
# useful if you've selected with the mouse
bind-key -nr C-y run "tmux show-buffer | pbcopy" # doesn't work on MacOS

######################################################################
# END OF GENERAL CONFIGURATIONS
######################################################################

######################
### DESIGN CHANGES ###
######################

source-file ~/.config/tmux/base16-gruvbox-dark-hard.conf

######################
### STATUS BAR     ###
######################
set -g status-interval 1
# uptime
#set-option -ag status-right "#[fg=#b8bb26,bg=default]#(uptime | awk -F, '{sub(\".*up \",x,$1); print $1}')"
set-option -ag status-right "#[fg=#b8bb26,bg=default] up:#(uptime | cut -f 4-5 -d ' ' | cut -f 1 -d ',')"

catppuccin cmus theme

Make this:

### 'Catppuccin' theme for CMus (for 255 color terms)
set color_cmdline_bg=default
# Text Color White
set color_cmdline_fg=254
# Error Color Red
set color_error=211
# Info Color Yellow
set color_info=223
# Separator Color Blue
set color_separator=117

# Statusline background Black
set color_statusline_bg=default
#Statusline foreground #White
set color_statusline_fg=254

# Titleline background Green
set color_titleline_bg=151
# Titleline foreground Black
set color_titleline_fg=16

# Terminal default as background
set color_win_bg=default

# Currently Playing song Blue 
set color_win_cur=117
# Indicator over currently playing song Green
set color_win_cur_sel_bg=151
set color_win_cur_sel_fg=16

# Browser Directory Colors White
set color_win_dir=254

# Playlist browser general text color White
set color_win_fg=254
# Selected inactive Directory of currently playing Album/Song Maroon bg Black fg 
set color_win_inactive_cur_sel_bg=181
set color_win_inactive_cur_sel_fg=235

into ~/.config/cmus/catppuccin.theme and then in rc:

colorscheme catppuccin

add cmus config

  • .config/cmus/rc:

    bind -f common ^T push run opustags -s FIELD=VALUE -i {}
  • add opustags to nix pkgs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.