Compare commits

...

11 Commits

@ -0,0 +1,114 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1687709756,
"narHash": "sha256-Y5wKlQSkgEK2weWdOu4J3riRd+kV/VCgHsqLNTTWQ/0=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "dbabf0ca0c0c4bce6ea5eaf65af5cb694d2082c7",
"type": "github"
},
"original": {
"owner": "numtide",
"ref": "dbabf0c",
"repo": "flake-utils",
"type": "github"
}
},
"idyllsPkgs": {
"inputs": {
"flake-utils": "flake-utils",
"mozilla": "mozilla",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1,
"narHash": "sha256-mce6yHa3GACWabfxuwU/mvdoVBFxbGOFX88KUqVtinM=",
"path": "./pkgs",
"type": "path"
},
"original": {
"path": "./pkgs",
"type": "path"
}
},
"mozilla": {
"locked": {
"lastModified": 1687771476,
"narHash": "sha256-TSpqz6qYVRoqkEdOCawEQ4/cWt/4pracmvw17HK1tgE=",
"owner": "mozilla",
"repo": "nixpkgs-mozilla",
"rev": "3a44b8783514e7d6db4b63df96071b6c2b014b07",
"type": "github"
},
"original": {
"owner": "mozilla",
"ref": "3a44b87",
"repo": "nixpkgs-mozilla",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1687729501,
"narHash": "sha256-mTLkMePoHUWvTCf3NuKbeYEea/tsikSIKBWwb9OfRr4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "35130d4b4f0b8c50ed2aceb909a538c66c91d4a0",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgsUnstable": {
"locked": {
"lastModified": 1687681650,
"narHash": "sha256-M2If+gRcfpmaJy/XbfSsRzLlPpoU4nr0NHnKKl50fd8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1c9db9710cb23d60570ad4d7ab829c2d34403de3",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"idyllsPkgs": "idyllsPkgs",
"nixpkgs": "nixpkgs",
"nixpkgsUnstable": "nixpkgsUnstable"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

@ -0,0 +1,22 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
idyllsPkgs = {
url = "path:./pkgs";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgsUnstable.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs, nixpkgsUnstable, idyllsPkgs }:
let mkhost = import ./machines/mkhost.nix;
mkhost' = system: args: mkhost system ({
inherit nixpkgs nixpkgsUnstable idyllsPkgs;
} // args);
in {
nixosConfigurations.hera = mkhost' "hera" {
system = "x86_64-linux";
user = "idylls";
};
};
}

@ -0,0 +1,131 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running `nixos-help`).
{ config, pkgs, currentSystem, currentSystemName, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelPackages = pkgs.linuxKernel.packages.linux_6_3;
networking.hostName = currentSystemName; # Define your hostname.
# Pick only one of the below networking options.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
# Set your time zone.
time.timeZone = "America/New_York";
services.ntp.enable = true;
# Configure network proxy if necessary
# networking.proxy.default = "http://user:password@proxy:port/";
# networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
# Select internationalisation properties.
i18n.defaultLocale = "en_US.UTF-8";
# console = {
# font = "Lat2-Terminus16";
# keyMap = "us";
# useXkbConfig = true; # use xkbOptions in tty.
# };
# Enable the X11 windowing system.
services.xserver = {
enable = true;
videoDrivers = ["nvidia"];
displayManager.startx.enable = true;
};
# Configure keymap in X11
# services.xserver.layout = "us";
# services.xserver.xkbOptions = "eurosign:e,caps:escape";
# Enable CUPS to print documents.
# services.printing.enable = true;
# Enable sound.
# sound.enable = true;
# hardware.pulseaudio.enable = true;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
security.wrappers.slock = {
setuid = true;
source = "${pkgs.slock}/bin/slock";
owner = "root";
group = "root";
};
services.syncthing = {
enable = true;
dataDir = "/dev/null";
openDefaultPorts = true;
configDir = "/home/idylls/.config/syncthing";
user = "idylls";
group = "users";
guiAddress = "127.0.0.1:8384";
};
services.tailscale.enable = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
# environment.systemPackages = with pkgs; [
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
# wget
# ];
environment.systemPackages = with pkgs; [
fish
tailscale
];
nix.settings.experimental-features = ["nix-command" "flakes"];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.
# system.copySystemConfiguration = true;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It's perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.05"; # Did you read the comment?
}

@ -0,0 +1,65 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "vmd" "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ "dm-snapshot" ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/284bc3be-458d-4511-bff7-bdde1a357f03";
fsType = "ext4";
};
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/03a5f6ae-e646-4f6d-8fd8-3305a38d67cc";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/069C-DFB0";
fsType = "vfat";
};
fileSystems."/mnt/games" =
{ device = "/dev/disk/by-uuid/ddc55423-6859-4cb2-b898-08d2c57b9346";
fsType = "ext4";
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp5s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware = {
opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
nvidia = {
modesetting.enable = true;
open = true;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.latest;
};
};
nixpkgs.config.allowUnfree = true;
}

@ -0,0 +1,26 @@
name: { nixpkgs, idyllsPkgs, nixpkgsUnstable, system, user }@inputs:
let pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
};
pkgsUnstable = nixpkgsUnstable.legacyPackages.${system};
pkgsIdylls = idyllsPkgs.packages.${system};
in nixpkgs.lib.nixosSystem {
modules = [
./${name}/configuration.nix
./../users/${user}/configuration.nix
{
config._module.args = {
inherit pkgsUnstable pkgsIdylls;
pkgs = nixpkgs.lib.mkForce pkgs;
currentSystem = system;
currentSystemName = name;
};
}
];
}

@ -0,0 +1,7 @@
let utils = import ./utils.nix;
in final: prev:
let buildRustPlatform = utils.buildRustPlatform { inherit (final) rustChannelOf makeRustPlatform; };
in {
emacs = final.callPackage (import ./emacs { inherit (prev) emacs; }) {};
eww = final.callPackage ./eww { inherit buildRustPlatform; };
}

@ -0,0 +1,98 @@
{ emacs
, src ? null
, version ? "3a50773"
, hash ? "sha256-7aTinkM+EodoPtuqNXwssQf9fd0EYvyZ/vDA4KE0aew="
}:
{ fetchFromGitHub
, lib
, stdenv
, substituteAll
, libgccjit
, pkg-config
, makeWrapper
, texinfo
, autoreconfHook
, gettext
, gnutls
, harfbuzz
, jansson
, libxml2
, ncurses
, libotf
, gtk3-x11
, sqlite
, tree-sitter
, cairo
, librsvg
}:
let orElse = (import ../utils.nix).orElse;
src' = orElse src (fetchFromGitHub {
owner = "emacs-mirror";
repo = "emacs";
rev = version;
sha256 = hash;
});
libGccJitLibraryPaths = [
"${lib.getLib libgccjit}/lib/gcc"
"${lib.getLib stdenv.cc.libc}/lib"
] ++ lib.optionals (stdenv.cc?cc.libgcc) [
"${lib.getLib stdenv.cc.cc.libgcc}/lib"
];
in emacs.overrideAttrs (final: prev: {
inherit version;
src = src';
patches = [
(substituteAll {
src = ./patch-native-comp.patch;
backendPath = (lib.concatStringsSep " "
(builtins.map (x: ''"-B${x}"'') ([
# Paths necessary so the JIT compiler finds its libraries:
"${lib.getLib libgccjit}/lib"
] ++ libGccJitLibraryPaths ++ [
# Executable paths necessary for compilation (ld, as):
"${lib.getBin stdenv.cc.cc}/bin"
"${lib.getBin stdenv.cc.bintools}/bin"
"${lib.getBin stdenv.cc.bintools.bintools}/bin"
])));
})
];
CFLAGS = "-march=native -mtune=native -O2 -pipe";
CXXFLAGS = "-march=native -mtune=native -O2 -pipe";
configureFlags = [
"--without-all" # Just our options
"--enable-link-time-optimization"
"--with-x-toolkit=gtk3"
"--with-json"
"--with-rsvg"
"--with-cairo"
"--with-harfbuzz"
"--with-libotf"
"--with-threads"
"--with-modules"
"--with-native-compilation"
"--with-file-notifications=yes"
"--without-compress-install"
"--with-x"
"--with-xml2"
"--with-zlib"
"--with-xinput2"
"--with-gnutls"
"--with-tree-sitter"
];
nativeBuildInputs = [
pkg-config
makeWrapper
texinfo
autoreconfHook
];
buildInputs = [
gettext gnutls harfbuzz.dev jansson libxml2 ncurses libotf gtk3-x11
(lib.lowPrio libgccjit) sqlite tree-sitter cairo librsvg
];
})

@ -0,0 +1,14 @@
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 22fb08e..c7ffb6c 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -188,7 +188,8 @@ and above."
(defcustom native-comp-driver-options
(cond ((eq system-type 'darwin) '("-Wl,-w"))
- ((eq system-type 'cygwin) '("-Wl,-dynamicbase")))
+ ((eq system-type 'cygwin) '("-Wl,-dynamicbase"))
+ (t '(@backendPath@)))
"Options passed verbatim to the native compiler's back-end driver.
Note that not all options are meaningful; typically only the options
affecting the assembler and linker are likely to be useful.

@ -0,0 +1,33 @@
{ fetchFromGitHub, buildRustPlatform, pkg-config, glib, gtk3, gcc, lib, ... }:
let pname = "eww";
version = "25e50eda";
src = fetchFromGitHub {
owner = "elkowar";
repo = pname;
rev = version;
hash = "sha256-8e6gHSg6FDp6nU5v89D44Tqb1lR5aQpS0lXOVqzoUS4=";
};
rustPlatform = buildRustPlatform {
channel = "nightly";
date = "2022-08-27";
sha256 = "sha256-2ScxT2W4bH3TwXImNaGSJi+EajTYYkaeU5nBhYMYac4=";
};
in rustPlatform.buildRustPackage {
inherit pname version src;
cargoHash = "sha256-IWdMXPxTh5MCcd1THTrR37O2EckbN92mtB69TOnTGY8=";
buildNoDefaultFeatures = true;
buildFeatures = [ "x11" ];
patches = [ ./fix_battery_capacity.patch ];
nativeBuildInputs = [ pkg-config ];
buildInputs = [ glib.dev gtk3.dev gcc ];
meta = with lib; {
description = "ElKowars wacky widgets";
homepage = "https://github.com/elkowar/eww";
license = licenses.mit;
};
}

@ -0,0 +1,13 @@
diff --git a/crates/eww/src/config/system_stats.rs b/crates/eww/src/config/system_stats.rs
index 3ba426d..7650cdb 100644
--- a/crates/eww/src/config/system_stats.rs
+++ b/crates/eww/src/config/system_stats.rs
@@ -152,7 +152,7 @@ pub fn get_battery_capacity() -> Result<String> {
}
}
if total == 0_f64 {
- return Ok(String::from(""));
+ return Ok(String::from("null"));
}
json.push_str(&format!(r#" "total_avg": {:.1}}}"#, (current / total) * 100_f64));

@ -0,0 +1,79 @@
{
"nodes": {
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1687709756,
"narHash": "sha256-Y5wKlQSkgEK2weWdOu4J3riRd+kV/VCgHsqLNTTWQ/0=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "dbabf0ca0c0c4bce6ea5eaf65af5cb694d2082c7",
"type": "github"
},
"original": {
"owner": "numtide",
"ref": "dbabf0c",
"repo": "flake-utils",
"type": "github"
}
},
"mozilla": {
"locked": {
"lastModified": 1687771476,
"narHash": "sha256-TSpqz6qYVRoqkEdOCawEQ4/cWt/4pracmvw17HK1tgE=",
"owner": "mozilla",
"repo": "nixpkgs-mozilla",
"rev": "3a44b8783514e7d6db4b63df96071b6c2b014b07",
"type": "github"
},
"original": {
"owner": "mozilla",
"ref": "3a44b87",
"repo": "nixpkgs-mozilla",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1687729501,
"narHash": "sha256-mTLkMePoHUWvTCf3NuKbeYEea/tsikSIKBWwb9OfRr4=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "35130d4b4f0b8c50ed2aceb909a538c66c91d4a0",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"mozilla": "mozilla",
"nixpkgs": "nixpkgs"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

@ -0,0 +1,17 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
mozilla.url = "github:mozilla/nixpkgs-mozilla/3a44b87";
flake-utils.url = "github:numtide/flake-utils/dbabf0c";
};
outputs = { self, flake-utils, nixpkgs, mozilla }:
let mkPackages = (import ./packages.nix) {
inherit nixpkgs;
rustOverlay = mozilla.overlays.rust;
};
systems = [ "x86_64-linux" ];
in flake-utils.lib.eachSystem systems (system: {
packages = mkPackages system;
});
}

@ -0,0 +1,12 @@
{ nixpkgs, rustOverlay }: system:
let pkgs = nixpkgs.legacyPackages.${system};
rustPkgs = rustOverlay pkgs pkgs;
buildRustPlatform = (import ./utils.nix).buildRustPlatform {
inherit (rustPkgs) rustChannelOf;
inherit (pkgs) makeRustPlatform;
};
in {
eww = pkgs.callPackage ./eww { inherit buildRustPlatform; };
emacs = pkgs.callPackage (import ./emacs { inherit (pkgs) emacs; }) {};
}

@ -0,0 +1,13 @@
{
buildRustPlatform = { rustChannelOf, makeRustPlatform }: args:
let rust = (rustChannelOf {
inherit (args) channel date sha256;
}).rust;
rustPlatform = makeRustPlatform {
rustc = rust;
cargo = rust;
};
in rustPlatform;
orElse = nullable: def: if (nullable != null) then nullable else def;
}

@ -0,0 +1,32 @@
{ pkgs, pkgsUnstable, pkgsIdylls, ... }:
{
programs.fish.enable = true;
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
};
programs.gnupg.agent = {
enable = true;
pinentryFlavor = "gtk2";
};
users.users.idylls = {
isNormalUser = true;
extraGroups = [ "wheel" ]; # Enable sudo for the user.
packages = [
# Dev Tools
pkgs.git pkgsIdylls.emacs pkgs.kitty pkgs.fd pkgsIdylls.eww pkgs.deno
pkgs.ripgrep
# Desktop
pkgs.rofi pkgs.i3 pkgs.sxhkd pkgs.keepassxc pkgs.dunst pkgs.slock
pkgs.nitrogen pkgs.lxappearance pkgs.gnome.adwaita-icon-theme
pkgs.gnome.gnome-themes-extra
# Applications
pkgs.firefox pkgs.discord pkgsUnstable.signal-desktop pkgs.chromium
];
shell = pkgs.fish;
};
}
Loading…
Cancel
Save