summaryrefslogtreecommitdiff
path: root/modules/nixfiles/profiles/dev/default.nix
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2022-09-14 12:08:10 +0300
committerAzat Bahawi <azat@bahawi.net>2022-09-14 12:08:10 +0300
commit6a02d658dde1fd5e9d9e84478796b6881b236578 (patch)
tree02b5e0372998ca089b22e2d78bfa499b736ee13e /modules/nixfiles/profiles/dev/default.nix
parentcc1ed99b3ec1cb8d025c11bc4db45bf643ef3780 (diff)
2022-09-14
Diffstat (limited to 'modules/nixfiles/profiles/dev/default.nix')
-rw-r--r--modules/nixfiles/profiles/dev/default.nix274
1 files changed, 273 insertions, 1 deletions
diff --git a/modules/nixfiles/profiles/dev/default.nix b/modules/nixfiles/profiles/dev/default.nix
index 1e0bd01..14c0730 100644
--- a/modules/nixfiles/profiles/dev/default.nix
+++ b/modules/nixfiles/profiles/dev/default.nix
@@ -1 +1,273 @@
-_: {imports = [./common.nix ./containers ./sql];}
+{
+ config,
+ lib,
+ pkgs,
+ ...
+}:
+with lib; let
+ cfg = config.nixfiles.modules.profiles.dev.default;
+in {
+ imports = [
+ ./containers.nix
+ ./sql.nix
+ ];
+
+ options.nixfiles.modules.profiles.dev.default.enable =
+ mkEnableOption "Catch-all profile for stuff related to software development and etc.";
+
+ config = mkIf cfg.enable {
+ nixfiles.modules = {
+ bat.enable = true;
+ curl.enable = true;
+ direnv.enable = true;
+ git.enable = true;
+ gnupg.enable = true;
+ nmap.enable = true;
+ wget.enable = true;
+ };
+
+ hm.home = {
+ file = {
+ ".editorconfig".text = ''
+ root = true
+
+ [*]
+ charset = utf-8
+ end_of_line = lf
+ indent_size = 4
+ indent_style = space
+ insert_final_newline = true
+ max_line_length = 80
+ trim_trailing_whitespace = true
+
+ [*.nix]
+ indent_size = 2
+ indent_style = space
+
+ [*.{S,s,asm}]
+ indent_size = 4
+ indent_style = tab
+
+ [*.{C,H,c,c++,cc,cpp,cxx,h,h++,hh,hpp,hxx}]
+ indent_size = 4
+ indent_style = tab
+
+ [*.{cl,clj,el,l,lisp,lsp,rkt,scm,ss}]
+ indent_size = 2
+ indent_style = space
+
+ [*.go]
+ indent_size = 4
+ indent_style = tab
+
+ [*.{py,pyx}]
+ indent_size = 4
+ indent_style = space
+
+ [*.{hs,lhs}]
+ indent_size = 2
+ indent_style = space
+
+ [*.{html,xhtml,xml}]
+ indent_size = 4
+ indent_style = tab
+
+ [*.json]
+ indent_size = 2
+ indent_style = space
+
+ [*.{yaml,yml}]
+ indent_size = 2
+ indent_style = space
+
+ [*.{toml,tml}]
+ indent_size = 4
+ indent_style = space
+
+ [*.{py,pyx}]
+ indent_size = 4
+ indent_style = space
+ max_line_length = 72
+
+ [*.zig]
+ indent_size = 4
+ indent_style = tab
+
+ [configure.ac]
+ indent_size = 4
+ indent_style = tab
+
+ [{Makefile*,*.mk}]
+ indent_size = 4
+ indent_style = tab
+
+ [{CMakeLists.txt,*.cmake}]
+ indent_size = 8
+ indent_style = tab
+
+ [*.tex]
+ indent_size = 4
+ indent_style = tab
+
+ [*.{md,adoc,rtf,txt}]
+ indent_size = 4
+ indent_style = tab
+ '';
+
+ ".ghc/ghci.conf".source = ./ghci.conf;
+
+ "${config.dirs.data}/stack/config.yaml".text = generators.toYAML {} {
+ templates.params = rec {
+ author-name = my.fullname;
+ author-email = my.email;
+ copyright = "Copyright (c) ${author-name} <${author-email}>";
+ github-username = my.username;
+ };
+ };
+
+ ".clang-format".text = generators.toYAML {} {
+ AccessModifierOffset = -4;
+ AlignAfterOpenBracket = "Align";
+ AlignConsecutiveAssignments = "Consecutive";
+ AlignConsecutiveBitFields = "Consecutive";
+ AlignConsecutiveDeclarations = "Consecutive";
+ AlignConsecutiveMacros = "Consecutive";
+ AlignEscapedNewlines = "Right";
+ AlignOperands = "Align";
+ AlignTrailingComments = false;
+ AllowAllArgumentsOnNextLine = false;
+ AllowAllConstructorInitializersOnNextLine = true;
+ AllowAllParametersOfDeclarationOnNextLine = true;
+ AllowShortBlocksOnASingleLine = "Never";
+ AllowShortCaseLabelsOnASingleLine = false;
+ AllowShortEnumsOnASingleLine = false;
+ AllowShortFunctionsOnASingleLine = "None";
+ AllowShortIfStatementsOnASingleLine = "Never";
+ AllowShortLambdasOnASingleLine = "Inline";
+ AllowShortLoopsOnASingleLine = false;
+ AlwaysBreakAfterDefinitionReturnType = "All";
+ AlwaysBreakAfterReturnType = "AllDefinitions";
+ AlwaysBreakBeforeMultilineStrings = false;
+ AlwaysBreakTemplateDeclarations = "Yes";
+ BinPackArguments = false;
+ BinPackParameters = false;
+ BreakBeforeBinaryOperators = "None";
+ BreakBeforeBraces = "Allman";
+ BreakBeforeTernaryOperators = true;
+ BreakConstructorInitializers = "BeforeComma";
+ BreakInheritanceList = "BeforeComma";
+ BreakStringLiterals = true;
+ ColumnLimit = 80;
+ CommentPragmas = "^ IWYU pragma:";
+ CompactNamespaces = false;
+ ConstructorInitializerAllOnOneLineOrOnePerLine = false;
+ ConstructorInitializerIndentWidth = 4;
+ ContinuationIndentWidth = 4;
+ Cpp11BracedListStyle = true;
+ DeriveLineEnding = false;
+ DerivePointerAlignment = false;
+ DisableFormat = false;
+ ExperimentalAutoDetectBinPacking = false;
+ FixNamespaceComments = true;
+ IncludeBlocks = "Regroup";
+ IndentCaseBlocks = false;
+ IndentCaseLabels = false;
+ IndentExternBlock = "NoIndent";
+ IndentGotoLabels = false;
+ IndentPPDirectives = "None";
+ IndentWidth = 4;
+ IndentWrappedFunctionNames = false;
+ KeepEmptyLinesAtTheStartOfBlocks = false;
+ Language = "Cpp";
+ MaxEmptyLinesToKeep = 1;
+ NamespaceIndentation = "None";
+ PointerAlignment = "Left";
+ ReflowComments = false;
+ SortIncludes = "CaseSensitive";
+ SortUsingDeclarations = true;
+ SpaceAfterCStyleCast = false;
+ SpaceAfterLogicalNot = false;
+ SpaceAfterTemplateKeyword = true;
+ SpaceBeforeAssignmentOperators = true;
+ SpaceBeforeCpp11BracedList = false;
+ SpaceBeforeCtorInitializerColon = true;
+ SpaceBeforeInheritanceColon = true;
+ SpaceBeforeParens = "ControlStatements";
+ SpaceBeforeRangeBasedForLoopColon = true;
+ SpaceInEmptyParentheses = false;
+ SpacesBeforeTrailingComments = 1;
+ SpacesInAngles = false;
+ SpacesInCStyleCastParentheses = false;
+ SpacesInContainerLiterals = false;
+ SpacesInParentheses = false;
+ SpacesInSquareBrackets = false;
+ Standard = "Latest";
+ TabWidth = 4;
+ UseTab = "Always";
+ };
+
+ ".gdbinit".text = ''
+ set confirm off
+ set verbose off
+ set editing off
+
+ set history expansion on
+
+ set height 0
+ set width 0
+
+ handle SIGALRM nostop print nopass
+ handle SIGBUS stop print nopass
+ handle SIGPIPE nostop print nopass
+ handle SIGSEGV stop print nopass
+
+ set print address on
+ set print elements 0
+ set print object on
+ set print pretty on
+ set print repeats 0
+ set print static-members on
+ set print vtbl on
+
+ set output-radix 10
+
+ set demangle-style gnu-v3
+
+ set disassembly-flavor intel
+
+ alias iv=info variables
+
+ alias da=disassemble
+
+ define fs
+ finish
+ step
+ end
+
+ define btc
+ backtrace
+ continue
+ end
+ '';
+ };
+
+ sessionVariables = with config.dirs; {
+ ANDROID_HOME = "${data}/android";
+ CABAL_CONFIG = "${data}/cabal/config";
+ CABAL_DIR = "${data}/cabal";
+ CARGO_HOME = "${data}/cargo";
+ GOPATH = "${data}/go";
+ PYTHONSTARTUP = ./pystartup.py;
+ STACK_ROOT = "${data}/stack";
+ };
+
+ packages = with pkgs; [
+ htmlq
+ jq
+ yq
+ ];
+ };
+
+ my.extraGroups = ["kvm"];
+ };
+}