diff options
| Commit | 2cc50e3785c2668cb228f911939495d93ec24778 (patch) | |
|---|---|---|
| Author | 2023-09-23 12:30:49 +0300 | |
| Committer | 2023-09-23 14:16:28 +0300 | |
| Files | 99aea1296be5deb09afeee610037c88db6e23c7f | |
| nix-2cc50e3785c2668cb228f911939495d93ec24778.tar nix-2cc50e3785c2668cb228f911939495d93ec24778.tar.gz nix-2cc50e3785c2668cb228f911939495d93ec24778.zip | ||
| Parent | 35dba540098d2a012b443c522e9e0328db46e3d2 (diff) | |
[all] Added initial configuration
5 files changed, 226 insertions, 90 deletions
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | README.md | 91 | ||||
| -rw-r--r-- | configuration.nix | 97 | ||||
| -rw-r--r-- | packages.nix | 121 | ||||
| -rw-r--r-- | template.sysidentity.nix | 6 |
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..697854b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +sysidentity.nix @@ -1,92 +1,3 @@ # nix - - -## Getting started - -To make it easy for you to get started with GitLab, here's a list of recommended next steps. - -Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)! - -## Add your files - -- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files -- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command: - -``` -cd existing_repo -git remote add origin https://gitlab.com/Syndamia/nix.git -git branch -M main -git push -uf origin main -``` - -## Integrate with your tools - -- [ ] [Set up project integrations](https://gitlab.com/Syndamia/nix/-/settings/integrations) - -## Collaborate with your team - -- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/) -- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html) -- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically) -- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/) -- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html) - -## Test and Deploy - -Use the built-in continuous integration in GitLab. - -- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html) -- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/) -- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html) -- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/) -- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html) - -*** - -# Editing this README - -When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template. - -## Suggestions for a good README -Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information. - -## Name -Choose a self-explaining name for your project. - -## Description -Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors. - -## Badges -On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge. - -## Visuals -Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method. - -## Installation -Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection. - -## Usage -Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README. - -## Support -Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. - -## Roadmap -If you have ideas for releases in the future, it is a good idea to list them in the README. - -## Contributing -State if you are open to contributions and what your requirements are for accepting them. - -For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self. - -You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser. - -## Authors and acknowledgment -Show your appreciation to those who have contributed to the project. - -## License -For open source projects, say how it is licensed. - -## Project status -If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers. +My nixos configuration diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..d0e908b --- /dev/null +++ b/configuration.nix @@ -0,0 +1,97 @@ +# 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, ... }: + +let inherit (import ./sysidentity.nix) sysidentity; +in { + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ./packages.nix + ]; + + # Use the systemd-boot EFI boot loader. + # boot.loader.systemd-boot.enable = true; + # boot.loader.efi.canTouchEfiVariables = true; + # boot.loader.efi.efiSysMountPoint = "/boot/efi"; + + # Use the GRUB 2 boot loader + boot.loader.grub = { + enable = true; + copyKernels = true; + efiSupport = true; + efiInstallAsRemovable = true; + # Define on which hard drive you want to install Grub + device = "nodev"; # or "nodev" for efi only + }; + + networking.hostName = sysidentity.name; # 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 = "Europe/Sofia"; + + # 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 CUPS to print documents. + services.printing.enable = true; + + # Enable sound. + sound.enable = true; + # hardware.pulseaudio.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.kamen = { + isNormalUser = true; + extraGroups = [ "wheel" "audio" "video" "input" "lpadmin" ]; # Enable ‘sudo’ for the user. + packages = with pkgs; [ ]; + shell = pkgs.zsh; + }; + + environment.shells = with pkgs; [ zsh ]; + + # 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; + }; + + # 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? +} + diff --git a/packages.nix b/packages.nix new file mode 100644 index 0000000..5c5dd34 --- /dev/null +++ b/packages.nix @@ -0,0 +1,121 @@ +{ pkgs, ... }: + +let inherit (import ./sysidentity.nix) sysidentity; +in { + # List packages installed in system profile. To search, run: + # $ nix search wget + nixpkgs.config.allowUnfree = true; + environment.systemPackages = with pkgs; + let + cli-core = [ + # Hardware managing apps + pipewire libinput lm_sensors lshw chrony iotop + parted dosfstools mtpfs ntfs3g squashfsTools + # Network + wget git rsync inetutils vnstat + # Working with files + vim inotify-tools lsof + # General usage + zsh htop rlwrap bc ddrescue cron + ]; + cli-userspace = [ + # Working with files + ffmpeg img2pdf pdftk imagemagick pngcrush jpegoptim optipng gd kid3 pandoc libisoburn + # Archive formats + p7zip dpkg cdrtools zip unzip rar unrar rpm + # Misc + neofetch exa moc lazygit aspell + ]; + openboxDE-userspace = [ + terminator + # Settings and backup tools + feh xterm arandr pavucontrol blueberry piper + # Tray + libappindicator networkmanagerapplet pnmixer copyq flameshot barrier redshift + # File openers/players + audacious mpv libreoffice evince gnome.eog gnome.file-roller cinnamon.nemo-with-extensions gnome.seahorse + # File/image/audio editors + gimp inkscape texmaker krita ardour + # Web (app) clients + brave firefox bitwarden nextcloud-client thunderbird birdtray + # System + gnome.gnome-system-monitor udisks gnome.gnome-disk-utility baobab gnome.simple-scan peek gparted + obs-studio qbittorrent speedcrunch virt-manager + ]; + openboxDE-core = [ + # Essential libs + dbus cairo libnotify gtk3 yad gnome.zenity gnome.gvfs gmtp at-spi2-atk + # Main apps and their config apps + # window manager, compositor, taskbar, notifications, app menu, lockscreen, session manager + openbox lxappearance obconf picom tint2 dunst jgmenu i3lock-color lightdm lightdm-gtk-greeter + # General X11 tools + lxqt.lxqt-policykit xorg.xev xfontsel xorg.xmodmap xorg.xwininfo xorg.xprop clipnotify xdotool xautolock xcape xorg.setxkbmap xkbmon + devilspie2 sxhkd + ]; + laptop = [ + brightnessctl powertop upower libinput-gestures acpid tlp + ]; + desktop = [ + timeshift + ]; + dev = [ + # C/C++ + clang glibc gcc gdb valgrind pugixml + # .NET + dotnet-sdk mono + # Python + python3Minimal + # Android + android-tools heimdall + # Networking + apacheHttpd wireshark gns3-gui gns3-server + # awk + gawk mawk nawk + # DB + mysql sqlitebrowser + # Functional + racket ghc sbcl + + cloc go php fontforge + ]; + in cli-core ++ cli-userspace ++ openboxDE-userspace ++ openboxDE-core ++ dev ++ + (if sysidentity.type == "laptop" then laptop else desktop); + + fonts.fonts = with pkgs; [ + noto-fonts noto-fonts-emoji cm_unicode symbola + # CJK + noto-fonts-cjk arphic-ukai arphic-uming takao wqy_microhei wqy_zenhei + ]; + + security.polkit.enable = true; + + # List services that you want to enable: + programs = { + dconf.enable = true; + zsh.enable = true; + gnome-disks.enable = true; + }; + services = { + dbus.packages = with pkgs; [ gnome2.GConf ]; + udev.packages = with pkgs; [ gnome.gnome-settings-daemon ]; + + upower.enable = true; + httpd.enable = true; + tlp.enable = true; + udisks2.enable = true; # gnome-disks disk access + gnome.gnome-keyring.enable = true; + gvfs.enable = true; # MTP (for nemo) + + xserver = { + enable = true; + # xkbmap + layout = "us"; # TODO us,bg-custom + xkbOptions = "grp:alt_shift_toggle,lv3:switch,caps:escape"; + # Window manager + windowManager.openbox.enable = true; + # touchpad support + libinput.enable = true; + libinput.touchpad.naturalScrolling = true; + }; + }; +} diff --git a/template.sysidentity.nix b/template.sysidentity.nix new file mode 100644 index 0000000..6ea4115 --- /dev/null +++ b/template.sysidentity.nix @@ -0,0 +1,6 @@ +{ + sysidentity = { + name = ""; + type = ""; + }; +} |
