Added flake.nix

This commit is contained in:
niten 2021-09-30 17:02:50 -07:00
parent 3f509d0829
commit fe65fa2566
4 changed files with 77 additions and 52 deletions

View File

@ -1,5 +1,6 @@
{ config, lib, pkgs, ... }: { doom-emacs, niten-doom-config, config, lib, pkgs, ... }:
with lib;
let let
user-configs = { user-configs = {
niten = ./niten.nix; niten = ./niten.nix;
@ -7,11 +8,28 @@ let
viator = ./niten.nix; viator = ./niten.nix;
xiaoxuan = ./xiaoxuan.nix; xiaoxuan = ./xiaoxuan.nix;
}; };
hostname = config.instance.hostname;
enable-gui = config.fudo.hosts.${hostname}.enable-gui;
in { in {
generate-config = { username, user-email, home-dir, ... }:
{ enable-gui ? false, ... }: config.home-manager = {
import user-configs.${username} { useGlobalPkgs = true;
inherit config lib pkgs username user-email home-dir enable-gui;
users = let
generate-config = username: config-file: let
user-cfg = config.fudo.users.${username};
user-email = user-cfg.email;
home-dir = user-cfg.home-directory;
in import user-configs.${username}
{ inherit username user-email home-dir; };
in mapAttrs generate-config {
niten = ./niten.nix;
# FIXME: Root shouldn't have all this stuff installed!
root = ./niten.nix;
viator = ./niten.nix;
xiaoxuan = ./xiaoxuan.nix;
}; };
};
} }

View File

@ -1,31 +0,0 @@
{ config, lib, pkgs, ... }: let
doom-emacs-config = pkgs.fetchgit {
url = "https://git.fudo.org/niten/doom-emacs.git";
rev = "0ab1532c856ccdb6ce46c5948054279f439eb1f2";
sha256 = "06mh74i5hmb15xid7w31wjc4v339cgddd667bpaphqnw666sm08h";
};
doom-emacs-pkg = pkgs.fetchgit {
url = "https://github.com/vlaci/nix-doom-emacs.git";
rev = "fee14d217b7a911aad507679dafbeaa8c1ebf5ff";
sha256 = "1g0izscjh5nv4n0n1m58jc6z27i9pkbxs17mnb05a83ffdbmmva6";
};
in {
doom-emacs-package = pkgs.callPackage doom-emacs-pkg {
doomPrivateDir = doom-emacs-config;
extraPackages = with pkgs.emacsPackages; [
elpher
use-package
];
emacsPackagesOverlay = final: prev: {
irony = prev.irony.overrideAttrs (esuper: {
buildInputs = esuper.buildInputs
++ [ pkgs.cmake pkgs.libclang pkgs.clang ];
});
};
};
doom-emacs-config = doom-emacs-config;
}

24
flake.nix Normal file
View File

@ -0,0 +1,24 @@
{
description = "Fudo Home Manager Configuration";
inputs = {
home-manager.url = "github:nix-community/home-manager/release-21.05";
doom-emacs.url = "github:vlaci/nix-doom-emacs";
niten-doom-config = {
url = "https://git.fudo.org/niten/doom-emacs.git";
flake = false;
};
};
outputs = { self,
home-manager,
doom-emacs,
niten-doom-config, ... }: {
nixosModule = {
imports = [
home-manager.nixosModules.home-manager
(import ./default.nix { inherit doom-emacs niten-doom-config; })
];
};
};
}

View File

@ -1,15 +1,35 @@
{ config, lib, pkgs, username, user-email, home-dir, enable-gui, ... }: {
doom-emacs,
niten-doom-config,
config,
lib,
pkgs,
username,
user-email,
home-dir,
enable-gui,
...
}:
with lib; with lib;
let let
doom-emacs-packages = pkgs.callPackage ./doom-emacs-package.nix {}; doom-emacs-package = pkgs.callPackage doom-emacs {
doomPrivateDir = niten-doom-config;
extraPackages = with pkgs.emacsPackages; [
elpher
use-package
];
emacsPackagesOverlay = final: prev: {
irony = prev.irony.overrideAttrs (esuper: {
buildInputs = with pkgs;
esuper.buildInputs ++
[ cmake libclang clang ];
});
};
};
gui-packages = with pkgs; gui-packages = with pkgs; [
let
# steam-with-pipewire =
# (steam.override { extraLibraries = pkgs: [ pkgs.pipewire ]; });
in [
exodus exodus
firefox firefox
gnome.gnome-tweaks gnome.gnome-tweaks
@ -24,11 +44,6 @@ let
redshift redshift
signal-desktop signal-desktop
spotify spotify
# steam-with-pipewire
# steam-with-pipewire.run
# steamPackages.steamcmd
# steamPackages.steam-fonts
# steamPackages.steam-runtime
xclip xclip
]; ];
@ -49,7 +64,7 @@ let
enca enca
file file
fortune fortune
doom-emacs-packages.doom-emacs-package doom-emacs-package
git git
gnutls gnutls
gnupg gnupg
@ -123,7 +138,7 @@ in {
services = { services = {
emacs = { emacs = {
enable = true; enable = true;
package = doom-emacs-packages.doom-emacs-package; package = doom-emacs-package;
client = { client = {
enable = true; enable = true;
}; };
@ -183,7 +198,6 @@ in {
(load "default.el") (load "default.el")
(setq package-archives nil) (setq package-archives nil)
;; (add-to-list 'package-directory-list "~/.nix-profile/share/emacs/site-lisp/elpa")
(package-initialize) (package-initialize)
''; '';
@ -207,7 +221,7 @@ in {
# EDITOR = "${doom-emacs}/bin/emacsclient -t"; # EDITOR = "${doom-emacs}/bin/emacsclient -t";
ALTERNATE_EDITOR = ""; ALTERNATE_EDITOR = "";
DOOM_EMACS_SITE_PATH = "${doom-emacs-packages.doom-emacs-config}/site.d"; DOOM_EMACS_SITE_PATH = "${niten-doom-config}/site.d";
HISTCONTROL = "ignoredups:ignorespace"; HISTCONTROL = "ignoredups:ignorespace";
}; };