Use the unstable version for the nth time

I also fixed the long-time occuring error when using the newest version
of the channel (or the unstable one). It turns out to be a simple type
error with the `my.user' attribute. (To be honest the error messages are
quite horrible.)

On another note, I also accidentally bricked my NixOS setup after a
garbage collection and a horrible update. The breakage includes not
being able to use any of the builtin tools of Nix (e.g., nix, nix-env,
nixos-rebuild) due to a shared library error that has been garbage
collected. Which means I have to reinstall it.
(I seem to have a talent for breaking things, if only I'm paid for it.)
This commit is contained in:
Gabriel Arazas 2020-10-05 09:38:58 +08:00
parent 4aa4f638e1
commit 49592d7f01
30 changed files with 168 additions and 75 deletions

View File

@ -3,7 +3,7 @@ HOST := zilch
HOME := /home/$(USER)
DOTS := /etc/dotfiles
NIXOS_VERSION := 20.03
NIXOS_VERSION := 20.09
NIXOS_PREFIX := $(PREFIX)/etc/nixos
FLAGS := -I "config=$$(pwd)/config" \
-I "modules=$$(pwd)/modules" \
@ -14,9 +14,13 @@ config: $(NIXOS_PREFIX)/configuration.nix
home: $(HOME)/dotfiles
# The channels will be used on certain modules like in `packages/default.nix` where it will be referred to install certain packages from the unstable channel.
unstable_channels:
@sudo nix-channel --add "https://nixos.org/channels/nixos-unstable" nixos
@sudo nix-channel --add "https://github.com/rycee/home-manager/archive/master.tar.gz" home-manager
@sudo nix-channel --add "https://nixos.org/channels/nixpkgs-unstable" nixpkgs-unstable
channels:
@sudo nix-channel --add "https://nixos.org/channels/nixos-${NIXOS_VERSION}" nixos
@sudo nix-channel --add "https://nixos.org/channels/nixos-unstable" nixos-unstable
@sudo nix-channel --add "https://github.com/rycee/home-manager/archive/release-${NIXOS_VERSION}.tar.gz" home-manager
@sudo nix-channel --add "https://nixos.org/channels/nixpkgs-unstable" nixpkgs-unstable

View File

@ -74,10 +74,4 @@ device: username:
extraGroups = [ "wheel" "video" "libvirtd" ];
shell = pkgs.zsh;
};
# This value determines the NixOS release with which your system is to be
# compatible, in order to avoid breaking some software such as database
# servers. You should change this only after NixOS release notes say you
# should.
system.stateVersion = "20.03"; # Did you read the comment?
}

View File

@ -1,14 +1,18 @@
{ config, options, lib, ... }:
with lib;
let mkOptionStr = value: mkOption
{ type = types.str;
default = value; };
let
mkOptionStr = value: mkOption
{ type = types.str;
default = value; };
in {
imports = [
<home-manager/nixos>
./desktop
./dev
./drivers
./editors
./shell
./services
@ -23,7 +27,7 @@ in {
# Convenience aliases
home = mkOption { type = options.home-manager.users.type.functor.wrapped; };
user = mkOption { type = types.submodule; };
user = mkOption { type = options.users.users.type; };
packages = mkOption { type = with types; listOf package; };
# Environment

View File

@ -21,6 +21,7 @@ in {
}) # Bring the search engine to the desktop!
unison
magic-wormhole # Magically transfer stuff between your wormholes!
qbittorrent # Free version of uBittorrent.
transmission # One of the components for sailing the high seas.
syncthing # A peer-to-peer synchro summoning.
xfce.thunar # A graphical file manager.
@ -28,11 +29,6 @@ in {
udiskie # An automounter for external devices with authentication.
];
# Enable peer-to-peer synchro summoning service.
my.home.services = {
syncthing.enable = true;
};
# Clean 'yer home!
my.env = {
RECOLL_CONFDIR = "$XDG_DATA_HOME/recoll";

View File

@ -14,10 +14,18 @@ with lib;
# Enable fontconfig to easily discover fonts installed from home-manager.
fonts = {
enableFontDir = true;
enableGhostscriptFonts = true;
fontconfig.enable = true;
enableDefaultFonts = true;
fontconfig = {
enable = true;
defaultFonts = {
sansSerif = [ "Source Sans Pro" "IBM Plex Sans" ];
serif = [ "Source Serif Pro" "IBM Plex Serif" ];
monospace = [ "Source Code Pro" "IBM Plex Mono" ];
};
};
fonts = with pkgs; [
dejavu_fonts
fira-code # The programming font with fancy symbols.
ibm-plex # IBM's face, is it professional?
iosevka # The fancy monofont with fancy ligatures.

View File

@ -22,7 +22,7 @@ in {
my.packages = with pkgs;
[
font-manager # Self-explanatory name is self-explanatory.
imagemagick # A command-line tool for manipulating images.
imagemagick7 # A command-line tool for manipulating images.
graphviz # The biz central for graphical flowcharts.
] ++

View File

@ -19,19 +19,22 @@ in {
my.packages = with pkgs;
(if cfg.composition.enable then [
lilypond # Prevent your compositions to be forever lost when you're in grave by engraving them now (or whenever you feel like it).
unstable.musescore # A music composer for creating musical cheatsheets.
musescore # A music composer for creating musical cheatsheets.
soundfont-fluid # A soundfont for it or something.
unstable.supercollider # Programming platform for synthesizing them 'zics.
sonic-pi # A pie made up of them supersonic sounds created from electricity.
supercollider # Programming platform for synthesizing them 'zics.
] else []) ++
(if cfg.production.enable then [
unstable.ardour # A DAW focuses on hardware recording but it can be used for something else.
ardour # A DAW focuses on hardware recording but it can be used for something else.
audacity # Belongs in the great city of "Simple tools for short audio samples".
carla # A plugin host useful for a consistent hub for them soundfonts and SFZs.
fluidsynth # Synth for fluid sounds.
geonkick # Create them percussions.
helm # A great synthesizer plugin.
hydrogen # Them drum beats composition will get good.
unstable.polyphone # Edit your fonts for sound.
polyphone # Edit your fonts for sound.
#zrythm # An up-and-coming DAW in Linux town.
zynaddsubfx # Ze most advanced synthesizer I've seen so far (aside from the upcoming Vital syntehsizer).
# As of 2020-07-03, lmms has some trouble regarding Qt or something so at least use the "unstable" channel just to be safe.

View File

@ -12,10 +12,11 @@ with lib;
config = mkIf config.modules.dev.android.enable {
my.packages = with pkgs; [
unstable.android-studio # The apartment for Android development.
unstable.dart # It's JavaScript except saner and slimmer.
unstable.flutter # It's Electron except saner and slimmer.
unstable.kotlin # It's Java except saner and slimmer.
android-studio # The apartment for Android development.
dart # It's JavaScript except saner and slimmer.
flutter # It's Electron except saner and slimmer.
kotlin # It's Java except saner and slimmer.
scrcpy # Cast your phone over TCP/IP!
];
# Enable Android Debug Bridge for some device debugging.

View File

@ -12,7 +12,7 @@ with lib;
config = mkIf config.modules.dev.base.enable {
my.packages = with pkgs; [
caddy2 # THE ULTIMATE HTTPS/2 SERVER FOR 'YER GOLFIN' SESSIONS!!!
caddy # THE ULTIMATE HTTPS/2 SERVER FOR 'YER GOLFIN' SESSIONS!!!
cmake # Yo, I heard you like Makefiles.
cookiecutter # A project scaffolding tool.
gnumake # Make your life easier with GNU Make.

0
modules/dev/data.nix Normal file → Executable file
View File

View File

@ -13,6 +13,7 @@
./lisp.nix
./math.nix
./perl.nix
./python.nix
./rust.nix
./vcs.nix
];

View File

@ -38,7 +38,7 @@ in
# TODO: Make Neuron its own package.
(let
neuronRev = "3c46adea8cfa2262ac2d50d3d9b1a96cb13a512d";
neuronRev = "5c37dd3bbfff7d203883417bee2e2970d41cd70d";
neuronSrc = builtins.fetchTarball "https://github.com/srid/neuron/archive/${neuronRev}.tar.gz";
in import neuronSrc {}) # Neurons and zettels are good for the brain.
] ++

View File

@ -29,8 +29,8 @@ in
] else []) ++
(if cfg.unity3d.enable then [
unstable.unity3d # The Unity, not to be confused with a certain ideal.
unstable.unityhub # The ideal hub for your Unity projects.
unity3d # The Unity, not to be confused with a certain ideal.
unityhub # The ideal hub for your Unity projects.
] else []);
};
}

25
modules/dev/go.nix Executable file
View File

@ -0,0 +1,25 @@
# Ah yes, Rust...
# The programming language that made me appreciate/tolerate C++ even more.
{ config, options, lib, pkgs, ... }:
with lib;
{
options.modules.dev.rust = {
enable = mkOption {
type = types.bool;
default = false;
};
};
config = mkIf config.modules.dev.rust.enable {
my.packages = with pkgs; [
rustup
];
my.env = {
CARGO_HOME = "$XDG_DATA_HOME/cargo";
RUSTUP_HOME = "$XDG_DATA_HOME/rustup";
PATH = [ "$CARGO_HOME/bin" ];
};
};
}

View File

@ -21,7 +21,7 @@ in
config = {
my.packages = with pkgs;
(if cfg.deno.enable then [
unstable.deno # The Deltarune of Node.
deno # The Deltarune of Node.
] else []) ++
(if cfg.node.enable then [

View File

@ -12,23 +12,20 @@ in
type = types.bool;
default = false;
}; in {
python.enable = mkEnableOption;
enable = mkEnableOption;
r.enable = mkEnableOption;
};
config = {
config = mkIf cfg.enable {
my.packages = with pkgs; [
gnuplot # I came for the plots.
julia # A statistics-focused languaged named after a character in an iconic fighting game.
octave # Matlab's hipster brother.
] ++
(if cfg.python.enable then [
python # Serious question: do I really need to install this?
python38Packages.sympy # The Python library that always being noticed.
] else []) ++
(if cfg.r.enable then [
R # Rated G for accessibility.
rstudio # It's not that kind of studio.
] else []);
};
}

View File

@ -5,7 +5,7 @@ with lib;
let
perlWithPackages = pkgs.perl.withPackages (p: with pkgs.perlPackages;
[
ModernBuild
ModuleBuild
ModuleInfo
ModuleInstall
ModernPerl
@ -19,6 +19,6 @@ in {
};
config = mkIf config.modules.dev.perl.enable {
my.packages = perlWithPackages;
my.packages = [ perlWithPackages ];
};
}

39
modules/dev/python.nix Executable file
View File

@ -0,0 +1,39 @@
# Another language for portable shell scripting.
# This installs Python 3 with my usual packages.
# For projects with other libraries (e.g., Django, Pytorch), you can just have a `default.nix` (and a `shell.nix` for more convenience).
{ config, options, lib, pkgs, ... }:
with lib;
let
cfg = config.modules.dev.python;
in {
options.modules.dev.python = let
mkBoolOption = bool: mkOption {
type = types.bool;
default = bool;
}; in {
enable = mkBoolOption false;
math.enable = mkBoolOption false;
};
config = mkIf cfg.enable {
my.packages = with pkgs; [
(python37.withPackages (p: with python3Packages; [
beautifulsoup4 # How soups are beautiful again?
requests # The requests for your often-asked questions.
pytools # It's the little things that counts.
pytest # Try to make a good grade or else.
poetry # It rhymes...
scrapy # Create an extractor from a box of scraps.
setuptools # Setup your stuff.
]
++ (if cfg.math.enable then [
numpy # Numbers are also good, right?
sympy # When will you notice that math is good?
] else [])))
];
};
}

0
modules/dev/vcs.nix Normal file → Executable file
View File

7
modules/drivers/default.nix Executable file
View File

@ -0,0 +1,7 @@
{ config, lib, ... }:
{
imports = [
./veikk.nix
];
}

16
modules/drivers/veikk.nix Executable file
View File

@ -0,0 +1,16 @@
# Installs the VEIKK Linux driver at https://github.com/jlam55555/veikk-linux-driver.
{ config, options, lib, pkgs, ... }:
with lib;
{
options.modules.drivers.veikk = {
enable = mkOption {
type = types.bool;
default = false;
};
};
config = mkIf config.modules.drivers.veikk.enable {
boot.extraModulePackages = [ pkgs.veikk-linux-driver ];
};
}

View File

@ -4,6 +4,16 @@
{ config, options, lib, pkgs, ... }:
with lib;
let
emacsOrgProtocolDesktopEntry = pkgs.makeDesktopItem {
name = "org-protocol";
desktopName = "Org-Protocol";
exec = "emacsclient %u";
icon = "emacs-icon";
type = "Application";
mimeType = "x-scheme-handler/org-protocol";
};
in
{
options.modules.editors.emacs = {
enable = mkOption {
@ -14,7 +24,7 @@ with lib;
# Just make sure the unstable version of Emacs is available as a package by creating an overlay.
pkg = mkOption {
type = types.package;
default = pkgs.unstable.emacs;
default = pkgs.emacs;
};
};
@ -24,6 +34,8 @@ with lib;
epkgs.vterm
]))
emacsOrgProtocolDesktopEntry
# Doom dependencies
git
(ripgrep.override { withPCRE2 = true; })
@ -49,6 +61,9 @@ with lib;
## :tools editorconfig
editorconfig-core-c
## :tools lookup
wordnet
## :tools lookup & :lang org+roam
sqlite
];
@ -56,11 +71,5 @@ with lib;
fonts.fonts = with pkgs; [
emacs-all-the-icons-fonts
];
# Placing the Doom Emacs config.
my.home.xdg.configFile."doom" = {
source = ../../config/emacs;
recursive = true;
};
};
}

View File

@ -21,11 +21,6 @@ with lib;
withPython3 = true;
withRuby = true;
};
xdg.configFile."nvim" = {
source = ../../config/nvim;
recursive = true;
};
};
};
}

0
modules/editors/vscode.nix Normal file → Executable file
View File

View File

@ -22,6 +22,7 @@ with lib;
hexyl # Binary viewer with a cool name on the command-line.
hledger # Do your accountancy thing ON THE COMMAND LINE, sure why not!
httpie # Want a piece of the HTTP pie.
gitAndTools.tig # The Deltarune of Git.
gopass # The improved version of Password Store which is a password manager for hipsters.
graphviz # The biz central for graphical flowcharts.
maim # A command-line interface for parsing screenshots.
@ -34,5 +35,14 @@ with lib;
unzip # Unzip what? The world may never know.
youtube-dl # A program that can be sued for false advertisement as you can download from other video sources.
];
my.home = {
programs.bat = {
enable = true;
config = {
theme = "base16";
};
};
};
};
}

View File

@ -25,4 +25,5 @@ xsetroot -cursor_name left_ptr
# Rules
bspc rule -a code-oss desktop=^2
bspc rule -a firefox desktop=^1
bspc rule -a Emacs state=tiled

View File

@ -59,23 +59,7 @@
modules-left = bspwm
modules-center = date
modules-right = pulseaudio eth memory home-fs root-fs
[module/home-fs]
type = internal/fs
mount-0 = /home
format-margin = 0
format-padding = 0
label-margin = 0
label-padding = 0
format-mounted-prefix = ""
format-mounted-prefix-margin-right = 1
format-unmounted-prefix = ""
format-unmounted-prefix-margin-right = 1
label-mounted = %free%
label-unmounted = N/A
modules-right = pulseaudio eth memory root-fs
[module/root-fs]

View File

@ -35,7 +35,7 @@ window {
background-color: transparent;
height: 65%;
width: 45%;
width: 55%;
position: center;
location: center;
text-color: @foreground;

View File

@ -36,7 +36,7 @@ window {
background-color: transparent;
height: 65%;
width: 35%;
width: 45%;
position: center;
location: center;
text-color: @foreground;

View File

@ -28,8 +28,6 @@ with lib;
xserver = {
displayManager = {
lightdm.enable = true;
lightdm.greeters.mini.enable = true;
lightdm.greeters.mini.user = config.my.username;
defaultSession = "none+bspwm";
};
enable = true;
@ -77,6 +75,7 @@ with lib;
gtk-xft-hinting=1
gtk-xft-hintstyle=hintfull
gtk-xft-rgba=none
gtk-font-name=Sans 10
'';
}
];