Compare commits

...

4 Commits

Author SHA1 Message Date
marc
098edb7f44 Use grub in reykjavik + add grub theme 2022-12-04 19:31:40 +01:00
marc
ccaca2cbe1 Config changes 2022-12-04 19:31:30 +01:00
marc
69e1dc2eb4 Added devenv and moved config files 2022-11-25 20:16:46 +01:00
marc
ebbbd0d179 Added NUR overlay 2022-11-25 16:34:57 +01:00
47 changed files with 330 additions and 65 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

View File

@@ -18,7 +18,6 @@
(setq doom-unicode-font (font-spec :family "Iosevka Nerd Font" :size 15))
;; Themeing
;; (load! "themes/base16-samfelag.el")
(use-package base16-theme
:init (add-to-list 'custom-theme-load-path "~/.config/doom/themes")
:ensure t
@@ -137,12 +136,13 @@
(load! "modules/prettify-utils.el")
(pretty-hook python-mode
;; ("def" "𝙛")
("def" "")
;; ("class" "𝙘")
'("None" "")
'("lambda" "λ")
'("not in" "")
'("in" ""))
("None" "")
("lambda" "λ")
("not in" "")
("in" ""))
(pretty-hook emacs-lisp-mode)

View File

@@ -153,7 +153,9 @@
php ; perl's insecure younger brother
;;plantuml ; diagrams for confusing people more
;;purescript ; javascript, but functional
python ; beautiful is better than ugly
(python
+lsp
+pyright) ; beautiful is better than ugly
;;qt ; the 'cutest' gui framework ever
;;racket ; a DSL for DSLs
;;raku ; the artist formerly known as perl6

View File

@@ -50,7 +50,6 @@
;(unpin! t)
(package! base16-theme)
(package! parinfer)
;; Editor

View File

@@ -50,7 +50,7 @@ mainbox {
imagebox {
padding: 20px;
background-color: transparent;
background-image: url("~/.config/rofi/menus/launcher/flor01.png", width);
background-image: url("~/.config/rofi/nix.png", width);
orientation: vertical;
children: [ "inputbar", "dummy", "mode-switcher" ];
}

93
data/devenv/devenv.sh Normal file
View File

@@ -0,0 +1,93 @@
#!/usr/bin/env sh
SANDBOXES_DIR=$HOME/sandbox
TEMPLATES_DIR=$XDG_DATA_HOME/devenv/templates
list_templates() {
echo "The available templates are:"
ls $TEMPLATES_DIR
}
check_template () {
TEMPLATE=$1
if [ -z "$TEMPLATE" ]; then
echo "No template given"
list_templates
return 1
elif [ ! -e "$TEMPLATES_DIR/$TEMPLATE" ]; then
echo "The given template '$TEMPLATE' doesn't exist!"
list_templates
return 1
fi
}
devenv_install() {
TEMPLATE=$1
install -m 644 $TEMPLATES_DIR/$TEMPLATE/* ./
echo "use flake . --impure" > .envrc
direnv allow
}
devenv_init() {
TEMPLATE=$1
if ! check_template $TEMPLATE ; then
return 1
fi
devenv_install $TEMPLATE
}
devenv_sandbox() {
DIRECTORY=$1
if [ -z "$DIRECTORY" ]; then
show_help_sandbox
return 1
fi
SANDBOX_DIR="$SANDBOXES_DIR/$DIRECTORY"
TEMPLATE=$2
if [ -z "$TEMPLATE" ]; then
TEMPLATE=$DIRECTORY
fi
if ! check_template $TEMPLATE; then
return 1
fi
if [ ! -e $SANDBOX_DIR ]; then
echo "Creating sandbox at $SANDBOX_DIR with template $TEMPLATE"
mkdir -p $SANDBOX_DIR
cd $SANDBOX_DIR
devenv_init $TEMPLATE
else
cd $SANDBOX_DIR
fi
}
show_help_sandbox() {
echo "Usage: devenv sandbox <directory> [<template>]"
echo ""
echo " directory: The sandbox directory to go to."
echo " template: If the directory doesn't exist, the template to use for that sandbox"
echo " Defaults to directory if not given."
echo ""
}
show_help() {
echo "Usage: devenv <action>"
echo "Available actions:"
echo ""
echo " init: Initialize a dev env in the current directory"
echo " sandbox: Go to a sandbox directory using a template"
echo ""
}
case "$1" in
init)
shift
devenv_init $@
;;
sandbox)
shift
devenv_sandbox $@
;;
*)
show_help
;;
esac

View File

@@ -0,0 +1,37 @@
{
description = "Development flake for this python project";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
python = pkgs.python39;
pythonPackages = pkgs.python39Packages;
projectDependencies = with pythonPackages; [
];
in {
devShells.default = pkgs.mkShell {
nativeBuildInputs = [ pkgs.bashInteractive ];
buildInputs = with pkgs; [
# Core python dependencies
python
pythonPackages.pip
pythonPackages.virtualenv
# IDE tools
pythonPackages.isort
nodePackages.pyright
# Development tools
black
pythonPackages.ipython
pythonPackages.pytest
pythonPackages.setuptools
] ++ projectDependencies;
};
});
}

View File

@@ -0,0 +1,32 @@
{
description = "Development flake for this rust project";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
projectDependencies = with pkgs; [
];
in {
devShells.default = pkgs.mkShell {
nativeBuildInputs = [ pkgs.bashInteractive ];
buildInputs = with pkgs; [
# Core rust dependencies
rustc
cargo
# Development tools
rustfmt
rust-analyzer
clippy
] ++ projectDependencies;
LD_LIBRARY_PATH = nixpkgs.lib.makeLibraryPath projectDependencies;
RUST_BACKTRACE = 1;
};
});
}

39
flake.lock generated
View File

@@ -50,6 +50,26 @@
"type": "github"
}
},
"grub2-themes": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1668213765,
"narHash": "sha256-mTx1jAy6AOY4moWRGvCHYnUNX4qBL/ba47ZcIkhczJM=",
"owner": "vinceliuice",
"repo": "grub2-themes",
"rev": "c106dfb9b5b18ad092ff0f952f2b734933e8283e",
"type": "github"
},
"original": {
"owner": "vinceliuice",
"repo": "grub2-themes",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@@ -135,12 +155,29 @@
"type": "github"
}
},
"nur": {
"locked": {
"lastModified": 1669288341,
"narHash": "sha256-lGwsFdSDb+IBXSJwKhNLOP2yt7PDXxbL0uxN9ZVOy8I=",
"owner": "nix-community",
"repo": "NUR",
"rev": "107aad385e04edf5b4bd4136bf8defcd890ecfc7",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "NUR",
"type": "github"
}
},
"root": {
"inputs": {
"emacs-overlay": "emacs-overlay",
"grub2-themes": "grub2-themes",
"home-manager": "home-manager",
"nix-colors": "nix-colors",
"nixpkgs": "nixpkgs_2"
"nixpkgs": "nixpkgs_2",
"nur": "nur"
}
}
},

View File

@@ -3,15 +3,25 @@
inputs = {
# - Nixpkgs ----------------------------------
nixpkgs.url = "github:nixos/nixpkgs/nixos-22.05";
# - Home-Manager -----------------------------
home-manager.url = "github:nix-community/home-manager/release-22.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
nix-colors.url = "github:misterio77/nix-colors";
# - NUR --------------------------------------
nur.url = "github:nix-community/NUR";
# - Overlays ---------------------------------
emacs-overlay.url = "github:nix-community/emacs-overlay";
# - Themeing ---------------------------------
grub2-themes.url = "github:vinceliuice/grub2-themes";
grub2-themes.inputs.nixpkgs.follows = "nixpkgs";
nix-colors.url = "github:misterio77/nix-colors";
};
outputs = inputs @ { self, nixpkgs, home-manager, ... }:
@@ -21,7 +31,7 @@
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = import ./overlays;
overlays = import ./overlays { inherit inputs; };
};
lib = nixpkgs.lib.extend
@@ -38,6 +48,7 @@
[
inputs.home-manager.nixosModules.home-manager
inputs.nix-colors.homeManagerModule
inputs.grub2-themes.nixosModule
]
# All my personal modules
++ (lib.my.mapModulesRec' (toString ./modules) import);

View File

@@ -18,7 +18,19 @@ in
# - Bootloader ---------------------------------
boot.loader.systemd-boot.enable = true;
boot.loader = {
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot/efi";
};
grub = {
enable = true;
efiSupport = true;
#efiInstallAsRemovable = true; # in case canTouchEfiVariables doesn't work for your system
device = "nodev";
};
grub2-theme.enable = true;
};
# - Themeing ---------------------------------
@@ -54,7 +66,7 @@ in
dev.git.userName = "marc";
dev.git.userEmail = "marc@sastre.cat";
dev.direnv.enable = true;
dev.devenv.enable = true;
# - Other apps -------------------------------
app.spotify.enable = true;

View File

@@ -18,7 +18,7 @@
fsType = "ext4";
};
"/boot" = {
"/boot/efi" = {
device = "/dev/disk/by-label/BOOT";
fsType = "vfat";
};
@@ -39,8 +39,8 @@
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
# # Keyboard light
# services.udev.extraRules = ''
# SUBSYSTEM=="usb", ATTR{idVendor}=="048d", ATTR{idProduct}=="c101", MODE="0666"
# '';
# Keyboard light
services.udev.extraRules = ''
SUBSYSTEM=="usb", ATTR{idVendor}=="048d", ATTR{idProduct}=="c101", MODE="0666"
'';
}

View File

@@ -16,7 +16,7 @@ in
(nerdfonts.override { fonts = [ "Iosevka" ]; })
];
hm.xdg.configFile."alacritty/alacritty.yml".source = ../../config/.config/alacritty/alacritty.yml;
hm.xdg.configFile."alacritty/alacritty.yml".source = ../../config/alacritty/alacritty.yml;
# - Themeing ---------------------------------
hm.xdg.configFile."alacritty/theme.yml".text = ''

View File

@@ -16,5 +16,19 @@ in
samfelag.modules.desktop.i3.extraKeybindings = lib.mkIf i3Cfg.enable {
"${i3Cfg.mod}+Shift+i" = "exec ${pkgs.firefox}/bin/firefox";
};
hm.programs.firefox = {
enable = true;
# extensions = with pkgs.nur.repos.rycee.firefox-addons; [
# # See https://nur.nix-community.org/repos/rycee/
# firefox-color
# ];
profiles.default = {
id = 0;
name = "Default";
isDefault = true;
};
};
};
}

View File

@@ -13,9 +13,9 @@ let
'';
# Paths
paths = {
config = ../../config/.config/polybar/config.ini;
bars = ../../config/.config/polybar/bars;
scripts = ../../config/.config/polybar/scripts;
config = ../../config/polybar/config.ini;
bars = ../../config/polybar/bars;
scripts = ../../config/polybar/scripts;
};
in {

View File

@@ -1,7 +1,8 @@
{ config, lib, pkgs, ... }:
{ config, lib, pkgs, inputs, ... }:
let
cfg = config.samfelag.modules.desktop.rofi;
nix-colors-lib = inputs.nix-colors.lib-contrib { inherit pkgs; };
in
{
options.samfelag.modules.desktop.rofi = {
@@ -12,16 +13,22 @@ in
rofi
];
hm.xdg.configFile."rofi/menus".source = ../../config/.config/rofi/menus;
hm.xdg.configFile."rofi/menus".source = ../../config/rofi/menus;
hm.xdg.configFile."rofi/nix.png".source = nix-colors-lib.nixWallpaperFromScheme {
scheme = config.colorScheme;
width = 600;
height = 600;
logoScale = 2.0;
};
# Themeing ---------------------------------
hm.xdg.configFile."rofi/theme.rasi".text = ''
* {
font: "Iosevka Nerd Font 10";
background: #${config.colorScheme.colors.base00};
background-alt: #${config.colorScheme.colors.base01};
background-alt: #${config.colorScheme.colors.base02};
foreground: #${config.colorScheme.colors.base05};
selected: #${config.colorScheme.colors.base02};
selected: #${config.colorScheme.colors.base03};
active: #${config.colorScheme.colors.base07};
urgent: #${config.colorScheme.colors.base06};
}

26
modules/dev/devenv.nix Normal file
View File

@@ -0,0 +1,26 @@
# Custom package to quickly set up development environments for different
# programing languages
{ config, lib, pkgs, ... }:
let
cfg = config.samfelag.modules.dev.devenv;
in
{
options.samfelag.modules.dev.devenv = {
enable = lib.mkEnableOption "devenv";
};
config = lib.mkIf cfg.enable {
hm.xdg.dataFile."devenv/devenv.sh".source = ../../data/devenv/devenv.sh;
hm.xdg.dataFile."devenv/templates".source = ../../data/devenv/templates;
hm.programs.zsh.shellAliases = {
devenv = "source $HOME/.local/share/devenv/devenv.sh";
};
# - Requirements -----------------------------
samfelag.modules.dev.direnv.enable = true;
};
}

View File

@@ -41,33 +41,6 @@ in {
libtool
cmake
# # :lang cc
# ccls
# cmake
# gcc
# glslang
# # :lang haskell
# stack
# haskellPackages.ghcide
# haskellPackages.hoogle
# # :lang latex && :lang org (latex preview)
# (texlive.combine { inherit (texlive) scheme-full; })
# # biber
# # :lang nix
# nixfmt
# # :lang python
# black
# python3
# python3Packages.isort
# # python3Packages.python-language-server
# python3Packages.pytest
# python3Packages.setuptools
# nodePackages.pyright
# # :tools lookup & :lang org +roam
# sqlite
# # :tools direnv
# direnv
# Fonts
emacs-all-the-icons-fonts
# fira-code
@@ -119,8 +92,6 @@ in {
system.userActivationScripts = {
installDoomEmacs = ''
EMACS_FOLDER="$HOME/.config/emacs"
echo $XDG_CONFIG_HOME
echo $EMACS_FOLDER
if [ ! -d "$EMACS_FOLDER" ]; then
${pkgs.git}/bin/git clone --depth=1 --single-branch "https://github.com/doomemacs/doomemacs" "$EMACS_FOLDER"
fi

View File

@@ -17,6 +17,6 @@ in
ripgrep
tldr
];
hm.xdg.configFile."shell".source = ../../config/.config/shell;
hm.xdg.configFile."shell".source = ../../config/shell;
};
}

View File

@@ -59,10 +59,20 @@ in
name = "powerlevel10k";
src = "${pkgs.zsh-powerlevel10k}/share/zsh-powerlevel10k";
}
{
name = "zsh-nix-shell";
file = "nix-shell.plugin.zsh";
src = pkgs.fetchFromGitHub {
owner = "chisui";
repo = "zsh-nix-shell";
rev = "v0.5.0";
sha256 = "0za4aiwwrlawnia4f29msk822rj9bgcygw6a8a6iikiwzjjz0g91";
};
}
];
};
hm.xdg.configFile."zsh/.p10k.zsh".source = ../../config/.config/zsh/.p10k.zsh;
hm.xdg.configFile."zsh/.p10k.zsh".source = ../../config/zsh/.p10k.zsh;
};
}

View File

@@ -1,3 +1,5 @@
{ inputs, ... }:
[
(import ./discord.nix)
(import ./discord.nix { })
(import ./nur.nix { nur = inputs.nur; })
]

View File

@@ -1,6 +1,9 @@
self: super:
{
discord = super.discord.overrideAttrs (_: {
src = builtins.fetchTarball https://discord.com/api/download?platform=linux&format=tar.gz;
});
}
{ ... }:
(
final: prev:
{
discord = prev.discord.overrideAttrs (_: {
src = builtins.fetchTarball https://discord.com/api/download?platform=linux&format=tar.gz;
});
}
)

9
overlays/nur.nix Normal file
View File

@@ -0,0 +1,9 @@
{ nur, ... }:
(
final: prev: {
nur = import nur {
nurpkgs = prev;
pkgs = prev;
};
}
)