Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP #3

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions configs/ags/default.nix

This file was deleted.

1 change: 0 additions & 1 deletion configs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
}:

{
ags = import ./ags { inherit pkgs; };
alacritty = import ./alacritty {
inherit
config
Expand Down
7 changes: 6 additions & 1 deletion configs/fish/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ let
inherit (pkgs) lib;
inherit (pkgs.stdenv) isDarwin isLinux;

dotfilesDir = config.home.homeDirectory + "/Dropbox/dotfiles";
dotfilesDir =
if config.modules.dropbox.enable then
"${config.home.homeDirectory}/Dropbox/dotfiles"
else
throw "Where are the dotfiles stored?";

colors = builtins.mapAttrs (name: hex: lib.strings.removePrefix "#" hex) (
import ./colors.nix { inherit colorscheme palette; }
);
Expand Down
2 changes: 2 additions & 0 deletions configs/neovim/after/ftplugin/cfg.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vim.opt_local.shiftwidth = 2
vim.opt_local.tabstop = 2
5 changes: 4 additions & 1 deletion home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ in
username = userName;
};

imports = [
./modules/home/all.nix
];

nix = {
package = pkgs.nixVersions.latest;
settings = {
Expand All @@ -172,7 +176,6 @@ in

programs = {
inherit (configs)
ags
alacritty
bat
direnv
Expand Down
2 changes: 1 addition & 1 deletion machines/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ let
allowUnfreePredicate =
pkg:
builtins.elem (lib.getName pkg) [
"megasync"
"dropbox"
"ookla-speedtest"
"spotify"
"zoom"
Expand Down
File renamed without changes.
File renamed without changes.
33 changes: 33 additions & 0 deletions modules/home/ags/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
config,
lib,
pkgs,
...
}:

with lib;
let
cfg = config.modules.ags;
in
{
options.modules.ags = {
enable = mkEnableOption "Ags";
};

config = mkIf cfg.enable ({
home.packages = [
(pkgs.hiPrio (
pkgs.writeShellApplication {
name = "ags";
runtimeInputs = [ pkgs.bun ];
text = "${pkgs.ags}/bin/ags";
}
))
];

programs.ags = {
enable = true;
configDir = ./.;
};
});
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 16 additions & 0 deletions modules/home/all.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{ pkgs, ... }:

let
inherit (pkgs.stdenv) isLinux isDarwin;
in
{
imports = [
./ags
./dropbox
];

modules = {
ags.enable = isLinux;
dropbox.enable = isLinux;
};
}
49 changes: 49 additions & 0 deletions modules/home/dropbox/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
config,
lib,
pkgs,
...
}:

with lib;
let
cfg = config.modules.dropbox;
in
{
options.modules.dropbox = {
enable = mkEnableOption "Dropbox";
};

config = mkIf cfg.enable {
home.packages = [ pkgs.dropbox-cli ];

systemd.user.services.dropbox = {
Unit = {
Description = "dropbox";
};

Install = {
WantedBy = [ "default.target" ];
};

Service =
let
dropboxCmd = "${pkgs.dropbox-cli}/bin/dropbox";
in
{
Type = "simple";
ExecStop = "${dropboxCmd} stop";
ExecStart = toString (
pkgs.writeShellScript "dropbox-start" ''
# get the dropbox bins if needed
if [[ ! -f $HOME/.dropbox-dist/VERSION ]]; then
${pkgs.coreutils}/bin/yes | ${dropboxCmd} update
fi

${pkgs.dropbox}/bin/dropbox
''
);
};
};
};
}