Added flake.nix
This commit is contained in:
parent
3f509d0829
commit
fe65fa2566
28
default.nix
28
default.nix
|
@ -1,5 +1,6 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{ doom-emacs, niten-doom-config, config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
user-configs = {
|
||||
niten = ./niten.nix;
|
||||
|
@ -7,11 +8,28 @@ let
|
|||
viator = ./niten.nix;
|
||||
xiaoxuan = ./xiaoxuan.nix;
|
||||
};
|
||||
|
||||
hostname = config.instance.hostname;
|
||||
enable-gui = config.fudo.hosts.${hostname}.enable-gui;
|
||||
|
||||
in {
|
||||
generate-config = { username, user-email, home-dir, ... }:
|
||||
{ enable-gui ? false, ... }:
|
||||
import user-configs.${username} {
|
||||
inherit config lib pkgs username user-email home-dir enable-gui;
|
||||
|
||||
config.home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
|
||||
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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
|
@ -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; })
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
46
niten.nix
46
niten.nix
|
@ -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;
|
||||
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;
|
||||
let
|
||||
# steam-with-pipewire =
|
||||
# (steam.override { extraLibraries = pkgs: [ pkgs.pipewire ]; });
|
||||
in [
|
||||
gui-packages = with pkgs; [
|
||||
exodus
|
||||
firefox
|
||||
gnome.gnome-tweaks
|
||||
|
@ -24,11 +44,6 @@ let
|
|||
redshift
|
||||
signal-desktop
|
||||
spotify
|
||||
# steam-with-pipewire
|
||||
# steam-with-pipewire.run
|
||||
# steamPackages.steamcmd
|
||||
# steamPackages.steam-fonts
|
||||
# steamPackages.steam-runtime
|
||||
xclip
|
||||
];
|
||||
|
||||
|
@ -49,7 +64,7 @@ let
|
|||
enca
|
||||
file
|
||||
fortune
|
||||
doom-emacs-packages.doom-emacs-package
|
||||
doom-emacs-package
|
||||
git
|
||||
gnutls
|
||||
gnupg
|
||||
|
@ -123,7 +138,7 @@ in {
|
|||
services = {
|
||||
emacs = {
|
||||
enable = true;
|
||||
package = doom-emacs-packages.doom-emacs-package;
|
||||
package = doom-emacs-package;
|
||||
client = {
|
||||
enable = true;
|
||||
};
|
||||
|
@ -183,7 +198,6 @@ in {
|
|||
(load "default.el")
|
||||
|
||||
(setq package-archives nil)
|
||||
;; (add-to-list 'package-directory-list "~/.nix-profile/share/emacs/site-lisp/elpa")
|
||||
(package-initialize)
|
||||
'';
|
||||
|
||||
|
@ -207,7 +221,7 @@ in {
|
|||
# EDITOR = "${doom-emacs}/bin/emacsclient -t";
|
||||
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";
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue