nix #11

Manually merged
geoffrey merged 113 commits from nix into main 2023-12-09 21:43:01 +01:00
11 changed files with 45 additions and 35 deletions
Showing only changes of commit fe1303ccc9 - Show all commits

View file

@ -1,7 +0,0 @@
[mypy]
cache_dir = ~/.cache/mypy
ignore_missing_imports = True
disallow_untyped_defs = True
disallow_untyped_calls = True
disallow_incomplete_defs = True
disallow_untyped_decorators = True

View file

@ -324,7 +324,6 @@ in
}; };
xdg = { xdg = {
configFile = { configFile = {
# TODO Should be xdg.configFile
"ccache.conf" = { "ccache.conf" = {
text = "ccache_dir = ${config.xdg.cacheHome}/ccache"; text = "ccache_dir = ${config.xdg.cacheHome}/ccache";
}; };
@ -346,6 +345,9 @@ in
log-scale: yes log-scale: yes
''; '';
}; };
"pythonstartup.py" = {
text = (builtins.readFile ./pythonstartup.py);
};
}; };
}; };
home = { home = {

View file

@ -422,6 +422,27 @@
XDG_SCREENSHOTS_DIR = "${config.home.homeDirectory}/Screenshots"; XDG_SCREENSHOTS_DIR = "${config.home.homeDirectory}/Screenshots";
}; };
}; };
configFile = {
"pulse/client.conf" = {
text = ''cookie-file = .config/pulse/pulse-cookie'';
};
"xinitrc" =
let
nixgl = import
(builtins.fetchGit {
url = "https://github.com/nix-community/nixGL";
rev = "489d6b095ab9d289fe11af0219a9ff00fe87c7c5";
})
{ };
in
{
# TODO Configurable
source = pkgs.writeShellScript "xinitrc" ''
${pkgs.xorg.xrdb}/bin/xrdb ${config.xresources.path}
${nixgl.nixVulkanIntel}/bin/nixVulkanIntel ${nixgl.nixGLIntel}/bin/nixGLIntel ${config.xsession.windowManager.command}
'';
};
};
}; };
services = { services = {
unclutter.enable = true; unclutter.enable = true;
@ -477,24 +498,6 @@
}; };
home = { home = {
file = # TODO Should be a xdg.something instead of file in configHome
let
nixgl = import
(builtins.fetchGit {
url = "https://github.com/nix-community/nixGL";
rev = "489d6b095ab9d289fe11af0219a9ff00fe87c7c5";
})
{ };
in
{
"${config.xdg.configHome}/xinitrc" = {
# TODO Configurable
source = pkgs.writeShellScript "xinitrc" ''
${pkgs.xorg.xrdb}/bin/xrdb ${config.xresources.path}
${nixgl.nixVulkanIntel}/bin/nixVulkanIntel ${nixgl.nixGLIntel}/bin/nixGLIntel ${config.xsession.windowManager.command}
'';
};
};
packages = with pkgs; [ packages = with pkgs; [
# remote # remote
tigervnc tigervnc

View file

@ -1,10 +1,11 @@
import rlcompleter #!/usr/bin/env python3
import sys import sys
import os import os
# From https://github.com/python/cpython/blob/v3.7.0b5/Lib/site.py#L436 # From https://github.com/python/cpython/blob/v3.7.0b5/Lib/site.py#L436
# Changing the history file # Changing the history file
def register_readline(): def register_readline() -> None:
import atexit import atexit
try: try:
import readline import readline

View file

@ -1,4 +1,4 @@
{ pkgs, lib, ... }: { pkgs, lib, config, ... }:
let let
nixvim = import (builtins.fetchGit { nixvim = import (builtins.fetchGit {
url = "https://github.com/nix-community/nixvim"; url = "https://github.com/nix-community/nixvim";
@ -178,10 +178,23 @@ in
}; };
isort.enabled = true; isort.enabled = true;
mccabe.enabled = true; mccabe.enabled = true;
pycodestyle.enabled = true; pycodestyle = {
enabled = true;
maxLineLength = 88; # Compatibility with Black
};
pyflakes.enabled = true; pyflakes.enabled = true;
pylint.enabled = true; pylint.enabled = true;
pylsp_mypy.enabled = true; pylsp_mypy = {
enabled = true;
overrides = [
"--cache-dir=${config.xdg.cacheHome}/mypy"
"--ignore-missing-imports"
"--disallow-untyped-defs"
"--disallow-untyped-calls"
"--disallow-incomplete-defs"
"--disallow-untyped-decorators"
];
};
# FIXME Somehow no warning is shown # FIXME Somehow no warning is shown
# TODO Could add some, could also remove some # TODO Could add some, could also remove some
}; };

View file

View file

@ -1 +0,0 @@
cookie-file = .config/pulse/pulse-cookie

View file

@ -1,3 +0,0 @@
[pycodestyle]
# Compatibility with Black
max-line-length = 88

View file

@ -1,5 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# Optimizes everything the script can find in a folder, # Optimizes everything the script can find in a folder,
# meaning it will compress files as much as possible, # meaning it will compress files as much as possible,
# without losing any data (verification will be done # without losing any data (verification will be done
@ -8,6 +9,7 @@
# TODO Run in parallel # TODO Run in parallel
# TODO Lots of dupplicated code there # TODO Lots of dupplicated code there
# TODO Maybe replace part with https://github.com/toy/image_optim?
dir=${1:-$PWD} dir=${1:-$PWD}
total=$(mktemp) total=$(mktemp)